@arcgis/core 5.2.0-next.160 → 5.2.0-next.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0a5a9885ee6f5b5f99f0.js → 167b057ad50e6aef54de.js} +1 -1
- package/assets/esri/core/workers/chunks/17c6d66b47aa690df0d4.js +1 -0
- package/assets/esri/core/workers/chunks/{15bcf7cfe603f2ee1a24.js → 28104681ba161967039f.js} +1 -1
- package/assets/esri/core/workers/chunks/{842893e75696428d536f.js → 3b0808ee3c4facfaca3d.js} +1 -1
- package/assets/esri/core/workers/chunks/{eebbde81e56d69dc602f.js → 44f90e75c1dc3d726a95.js} +1 -1
- package/assets/esri/core/workers/chunks/{77ebacfdf8e57f2e03f1.js → 46c5371c7a627537098c.js} +11 -11
- package/assets/esri/core/workers/chunks/5daa9429808ca31279f2.js +1 -0
- package/assets/esri/core/workers/chunks/{60737732ce495bbdd0fc.js → 5f4feca26102088ea565.js} +1 -1
- package/assets/esri/core/workers/chunks/6da7229433105a69eb3f.js +1 -0
- package/assets/esri/core/workers/chunks/83f29a159b8b5197e76a.js +1 -0
- package/assets/esri/core/workers/chunks/849879c8aed16315194c.js +1 -0
- package/assets/esri/core/workers/chunks/{1d77c8c59b0118c7e77b.js → 85bba551057366cd00ae.js} +1 -1
- package/assets/esri/core/workers/chunks/{9401cc22373566e1171e.js → 8a7b02037151767542f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{4eae066673484986d4c1.js → 8e4a7027d171fb60e51e.js} +1 -1
- package/assets/esri/core/workers/chunks/{32b351b047ce1eb58146.js → 9ce8b9b80da146a5bbf5.js} +1 -1
- package/assets/esri/core/workers/chunks/a2fcbc494333376192aa.js +1 -0
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +1 -0
- package/assets/esri/core/workers/chunks/{f1df76f098a3cc924832.js → b5df193c93e9c19f9700.js} +1 -1
- package/assets/esri/core/workers/chunks/{28b74bc77f7c13080074.js → be97a629e2ae4d13ceb3.js} +1 -1
- package/assets/esri/core/workers/chunks/{d33360c4f85203edafff.js → bf4d913e523eae2fda28.js} +1 -1
- package/assets/esri/core/workers/chunks/{172cfeb5f415e4662432.js → d7429b58c90e015263ad.js} +1 -1
- package/assets/esri/core/workers/chunks/{612104dff305ff062dfa.js → dfc81e66196c402f39b4.js} +2 -2
- package/assets/esri/core/workers/chunks/{02f8654852d389583891.js → e04fb83ab2634bc15cc7.js} +1 -1
- package/assets/esri/core/workers/chunks/f74ae0eff3f08978e607.js +1 -0
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +2 -5
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +125 -133
- package/config.d.ts +62 -34
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/core/workers/Connection.d.ts +58 -89
- package/core/workers.d.ts +45 -54
- package/geometry/support/Indices.js +1 -1
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/ray.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +7 -5
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/MapImageLayer.d.ts +9 -3
- package/layers/MapNotesLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.d.ts +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +16 -16
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/support/Sublayer.d.ts +29 -15
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/package.json +2 -2
- package/rest/layerSources/DynamicDataLayer.d.ts +4 -2
- package/rest/layerSources/DynamicDataLayer.js +1 -1
- package/rest/layerSources/DynamicMapLayer.d.ts +1 -1
- package/rest/layerSources/DynamicWorkspaceLayer.d.ts +45 -0
- package/rest/layerSources/DynamicWorkspaceLayer.js +2 -0
- package/rest/layerSources/typeUtils.js +2 -0
- package/rest/print.js +1 -1
- package/rest/query/operations/queryRelatedRecords.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/symbols/LineSymbol3D.d.ts +5 -3
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +6 -0
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +6 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/DragZoom.js +1 -1
- package/views/3d/input/handlers/MouseWheelFov.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/manipulators/ResizeManipulator.js +1 -1
- package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
- package/views/3d/interactive/manipulators/ShiftManipulator.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/extrudePolygon.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/TextureReference.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/BreakpointsOwner.d.ts +6 -0
- package/views/SceneView.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
- package/views/interactive/editGeometry/operations/ScaleVertex.js +1 -1
- package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/types.d.ts +3 -0
- package/views/webgl/ShaderBuilder.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/Search/LocatorSearchSource.d.ts +22 -1
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +2 -0
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/ItemBase.d.ts +2 -0
- package/widgets/support/SelectionList/ItemBase.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/3e3e076fa5e8d5d5f33f.js +0 -1
- package/assets/esri/core/workers/chunks/510502a4c9a2ba8d3f7b.js +0 -1
- package/assets/esri/core/workers/chunks/7d212c415f2709037408.js +0 -1
- package/assets/esri/core/workers/chunks/abb9e820d2871fa7acae.js +0 -1
- package/assets/esri/core/workers/chunks/ade5fdcd08dcbac74740.js +0 -1
- package/assets/esri/core/workers/chunks/b390b9cde2884755e8be.js +0 -1
- package/assets/esri/core/workers/chunks/e8bf653376a607f00897.js +0 -1
- package/assets/esri/core/workers/chunks/f4a7aa3cdbc0c429c359.js +0 -1
package/config.d.ts
CHANGED
|
@@ -236,35 +236,26 @@ export interface Config {
|
|
|
236
236
|
* An object with properties that control various aspects of [the workers framework](https://developers.arcgis.com/javascript/latest/references/core/core/workers/).
|
|
237
237
|
*
|
|
238
238
|
* @example
|
|
239
|
-
* //
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
* .
|
|
251
|
-
*
|
|
252
|
-
* })
|
|
253
|
-
* .then((result) => {
|
|
254
|
-
* console.log(result);
|
|
255
|
-
* });
|
|
239
|
+
* // Load an ESM worker module and invoke its "getMaxNumber" function.
|
|
240
|
+
*
|
|
241
|
+
* const connection = await workers.open(new URL("./workersFolder/Calculator.js", import.meta.url).href, {
|
|
242
|
+
* isESM: true
|
|
243
|
+
* });
|
|
244
|
+
*
|
|
245
|
+
* try {
|
|
246
|
+
* // Invoke the worker function and receive its result on the main thread.
|
|
247
|
+
* const result = await connection.invoke("getMaxNumber", [0, 1, 2, 3, 4]);
|
|
248
|
+
* console.log(result);
|
|
249
|
+
* } finally {
|
|
250
|
+
* connection.close();
|
|
251
|
+
* }
|
|
256
252
|
*
|
|
257
253
|
* //*********************************************************
|
|
258
|
-
* // module:
|
|
254
|
+
* // module: workersFolder/Calculator.js
|
|
259
255
|
* //*********************************************************
|
|
260
|
-
*
|
|
261
|
-
* return
|
|
262
|
-
*
|
|
263
|
-
* getMaxNumber: function (number) {
|
|
264
|
-
* return Math.max.apply(null, numbers);
|
|
265
|
-
* }
|
|
266
|
-
* };
|
|
267
|
-
* });
|
|
256
|
+
* export function getMaxNumber(numbers) {
|
|
257
|
+
* return Math.max(...numbers);
|
|
258
|
+
* }
|
|
268
259
|
*/
|
|
269
260
|
workers: WorkersConfig;
|
|
270
261
|
}
|
|
@@ -294,27 +285,64 @@ export interface ApiKeysScopeConfig {
|
|
|
294
285
|
}
|
|
295
286
|
|
|
296
287
|
export interface WorkersConfig {
|
|
297
|
-
/**
|
|
288
|
+
/**
|
|
289
|
+
* The absolute URL to the AMD or SystemJS loader used in the worker. The AMD CDN build has a default value for when this property isn't set. This is required when using custom workers.
|
|
290
|
+
*
|
|
291
|
+
* @deprecated since version 5.2. AMD/SystemJS worker loading is deprecated. Use ESM worker modules with [workers.open()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open) instead. See this [ESM sample](https://github.com/Esri/jsapi-resources/tree/main/templates/geometry-operator-worker).
|
|
292
|
+
*/
|
|
298
293
|
loaderUrl?: string;
|
|
299
294
|
/**
|
|
300
295
|
* This is used by the `@arcgis/core` npm package to control where to load a custom build of the `RemoteClient` from.
|
|
301
|
-
* By default, `RemoteClient` is loaded from the API's [assets](https://developers.arcgis.com/javascript/latest/working-with-assets/).
|
|
296
|
+
* By default, `RemoteClient` is loaded from the API's [assets](https://developers.arcgis.com/javascript/latest/working-with-assets/).
|
|
297
|
+
*
|
|
298
|
+
* `RemoteClient` is the SDK’s internal worker-side runtime. It loads and instantiates the worker module, then manages communication with the main thread through the worker connection.
|
|
299
|
+
*
|
|
300
|
+
* @deprecated since version 5.2. Custom worker runtime paths are deprecated. Use the default worker runtime with ESM worker modules opened via [workers.open()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open).
|
|
302
301
|
*/
|
|
303
302
|
workerPath?: string;
|
|
304
|
-
/**
|
|
303
|
+
/**
|
|
304
|
+
* The AMD configuration object that is set in each worker.
|
|
305
|
+
*
|
|
306
|
+
* @deprecated since version 5.2. AMD/SystemJS worker loading is deprecated. Use ESM worker modules with [workers.open()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open) instead.
|
|
307
|
+
*/
|
|
305
308
|
loaderConfig?: WorkersLoaderConfig;
|
|
306
309
|
}
|
|
307
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Configuration for the legacy AMD worker loader.
|
|
313
|
+
*
|
|
314
|
+
* @deprecated since version 5.2. AMD/SystemJS worker loading is deprecated. Use ESM worker modules with [workers.open()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open) instead.
|
|
315
|
+
*/
|
|
308
316
|
export interface WorkersLoaderConfig {
|
|
309
|
-
/**
|
|
317
|
+
/**
|
|
318
|
+
* The AMD loader loads all code relative to the baseUrl.
|
|
319
|
+
*
|
|
320
|
+
* @deprecated since version 5.2. AMD/SystemJS worker loading is deprecated. Use ESM worker modules with [workers.open()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open) instead.
|
|
321
|
+
*/
|
|
310
322
|
baseUrl?: string;
|
|
311
|
-
/**
|
|
323
|
+
/**
|
|
324
|
+
* Determines if the specified feature capabilities are supported.
|
|
325
|
+
*
|
|
326
|
+
* @deprecated since version 5.2. AMD/SystemJS worker loading is deprecated. Use ESM worker modules with [workers.open()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open) instead.
|
|
327
|
+
*/
|
|
312
328
|
has?: Record<string, any>;
|
|
313
|
-
/**
|
|
329
|
+
/**
|
|
330
|
+
* Map paths in module identifiers to different paths.
|
|
331
|
+
*
|
|
332
|
+
* @deprecated since version 5.2. AMD/SystemJS worker loading is deprecated. Use ESM worker modules with [workers.open()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open) instead.
|
|
333
|
+
*/
|
|
314
334
|
map?: Record<string, Record<string, string>>;
|
|
315
|
-
/**
|
|
335
|
+
/**
|
|
336
|
+
* An array of objects which provide the package name and its location.
|
|
337
|
+
*
|
|
338
|
+
* @deprecated since version 5.2. AMD/SystemJS worker loading is deprecated. Use ESM worker modules with [workers.open()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open) instead.
|
|
339
|
+
*/
|
|
316
340
|
packages?: object[];
|
|
317
|
-
/**
|
|
341
|
+
/**
|
|
342
|
+
* Map of module id fragments to file paths.
|
|
343
|
+
*
|
|
344
|
+
* @deprecated since version 5.2. AMD/SystemJS worker loading is deprecated. Use ESM worker modules with [workers.open()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open) instead.
|
|
345
|
+
*/
|
|
318
346
|
paths?: Record<string, string>;
|
|
319
347
|
}
|
|
320
348
|
|
package/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@5.2.0-next.
|
|
2
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@5.2.0-next.162/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
|
package/core/has.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const e=globalThis,t={...e.esriConfig?.has};function has(n){return typeof t[n]==`function`?t[n]=t[n](e):t[n]}has.add=(e,n,r,i)=>{(i||t[e]===void 0)&&(t[e]=n),r&&has(e)},has.cache=t,has.add(`big-integer-warning-enabled`,!0),has.add(`esri-deprecation-warnings`,!0),has.add(`esri-tests-disable-screenshots`,!1),has.add(`esri-tests-use-full-window`,!1),has.add(`esri-tests-post-to-influx`,!0),has.add(`esri-cim-animations-enable-status`,`enabled`),has.add(`esri-cim-animations-spotlight`,!1),has.add(`esri-cim-animations-freeze-time`,!1),(()=>{has.add(`host-webworker`,e.WorkerGlobalScope!==void 0&&self instanceof e.WorkerGlobalScope);let t=typeof window<`u`&&typeof location<`u`&&typeof document<`u`&&window.location===location&&window.document===document;if(has.add(`host-browser`,t),has.add(`host-node`,!!(typeof e.process==`object`&&e.process.versions?.node&&e.process.versions.v8)),has.add(`dom`,t),has(`host-browser`)){let e=navigator,t=e.userAgent,n=e.appVersion,r=parseFloat(n);if(has.add(`wp`,parseFloat(t.split(`Windows Phone`)[1])||void 0),has.add(`msapp`,parseFloat(t.split(`MSAppHost/`)[1])||void 0),has.add(`khtml`,n.includes(`Konqueror`)?r:void 0),has.add(`edge`,parseFloat(t.split(`Edge/`)[1])||void 0),has.add(`opr`,parseFloat(t.split(`OPR/`)[1])||void 0),has.add(`webkit`,!has(`wp`)&&!has(`edge`)&&parseFloat(t.split(`WebKit/`)[1])||void 0),has.add(`chrome`,!has(`edge`)&&!has(`opr`)&&parseFloat(t.split(`Chrome/`)[1])||void 0),has.add(`android`,!has(`wp`)&&parseFloat(t.split(`Android `)[1])||void 0),has.add(`safari`,n.includes(`Safari`)&&!has(`wp`)&&!has(`chrome`)&&!has(`android`)&&!has(`edge`)&&!has(`opr`)?parseFloat(n.split(`Version/`)[1]):void 0),has.add(`mac`,n.includes(`Macintosh`)),!has(`wp`)&&/(iPhone|iPod|iPad)/.test(t)){let e=RegExp.$1.replace(/P/,`p`),n=/OS ([\d_]+)/.test(t)?RegExp.$1:`1`,r=parseFloat(n.replace(/_/,`.`).replaceAll(`_`,``));has.add(e,r),has.add(`ios`,r)}has(`webkit`)||(t.includes(`Gecko`)&&!has(`wp`)&&!has(`khtml`)&&!has(`edge`)&&has.add(`mozilla`,r),has(`mozilla`)&&has.add(`ff`,parseFloat(t.split(`Firefox/`)[1]||t.split(`Minefield/`)[1])||void 0))}})(),(()=>{if(e.navigator){let e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),n=/iPhone/i.test(e);t&&has.add(`esri-mobile`,t),n&&has.add(`esri-iPhone`,n),has.add(`esri-geolocation`,!!navigator.geolocation)}has.add(`esri-wasm`,`WebAssembly`in e),has.add(`esri-temporal`,`Temporal`in e),has.add(`esri-performance-mode-frames-between-render`,20),has.add(`esri-force-performance-mode`,!1),has.add(`esri-shared-array-buffer`,()=>{let t=`SharedArrayBuffer`in e,n=e.crossOriginIsolated===!1;return t&&!n}),has.add(`wasm-simd`,()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))),has.add(`esri-atomics`,`Atomics`in e),has.add(`esri-workers`,`Worker`in e),has.add(`web-feat:cache`,`caches`in e),has.add(`esri-workers-arraybuffer-transfer`,!has(`safari`)||Number(has(`safari`))>=12),has.add(`min-workers-pool-size`,2),has.add(`max-workers-pool-size`,has(`esri-mobile`)?3:8),has.add(`featurelayer-simplify-thresholds`,[.5,.5,.5,.5]),has.add(`featurelayer-simplify-payload-size-factors`,[1,1,4]),has.add(`featurelayer-animation-enabled`,!0),has.add(`featurelayer-hybrid-tile-enabled`,!0),has.add(`featurelayer-snapshot-enabled`,!0),has.add(`featurelayer-snapshot-initial-tolerance`,0),has.add(`featurelayer-snapshot-point-min-threshold`,8e4),has.add(`featurelayer-snapshot-point-max-threshold`,4e5),has.add(`featurelayer-snapshot-multipoint-min-threshold`,2e4),has.add(`featurelayer-snapshot-multipoint-max-threshold`,1e5),has.add(`featurelayer-snapshot-polygon-min-threshold`,2e3),has.add(`featurelayer-snapshot-polygon-max-threshold`,2e3),has.add(`featurelayer-snapshot-polyline-min-threshold`,2e3),has.add(`featurelayer-snapshot-polyline-max-threshold`,2e3),has.add(`featurelayer-snapshot-max-vertex-count`,25e4),has.add(`featurelayer-snapshot-non-hosted-exceedslimit-enabled`,!0),has.add(`featurelayer-snapshot-concurrency`,4),has.add(`featurelayer-snapshot-allow-editable`,!1),has.add(`featurelayer-snapshot-coverage`,.1),has.add(`featurelayer-pixel-buffering-enabled`,!0),has.add(`featurelayer-query-max-depth`,4),has.add(`featurelayer-query-max-page-size`,8e3),has.add(`featurelayer-query-pausing-enabled`,!1),has.add(`featurelayer-query-tile-concurrency`,4),has.add(`featurelayer-query-tile-max-features`,6e5),has.add(`featurelayer-advanced-symbols`,!1),has.add(`featurelayer-pbf`,!0),has.add(`featurelayer-pbf-statistics`,!1),has.add(`featurelayer-pbf-true-curves`,!0),has.add(`feature-layers-workers`,!0),has.add(`feature-polyline-generalization-factor`,1),has.add(`featurelayer-relative-time-queries-enabled`,!0),has.add(`featurelayer-relative-time-queries-bin-window-public`,1),has.add(`featurelayer-relative-time-queries-bin-window-private`,60),has.add(`parquetlayer-full-query-feature-count`,5e5),has.add(`parquetlayer-persistence-enabled`,!0),has.add(`parquetlayer-cache-enabled`,!0),has.add(`parquetlayer-legacy-field-overrides-enabled`,!1),has.add(`sketch-layer-enabled`,!1),has.add(`mapview-transitions-duration`,200),has.add(`mapview-essential-goto-duration`,200),has.add(`mapview-srswitch-adjust-rotation-scale-threshold`,24e6),has.add(`mapserver-pbf-version-support`,10.81),has.add(`mapservice-popup-identify-max-tolerance`,20),has.add(`request-queue-concurrency-global`,64),has.add(`request-queue-concurrency-hosted`,16),has.add(`request-queue-concurrency-non-hosted`,16),has.add(`curve-densification-coarse-segments`,128),has.add(`curve-densification-max-segments`,2e3),has.add(`curve-densification-min-segments`,3),has.add(`curve-densification-pixel-deviation`,.5),has.add(`view-readyState-waiting-delay`,1e3),has.add(`gradient-depth-bias`,.01),has.add(`gradient-depth-epsilon`,1e-8)
|
|
2
|
+
const e=globalThis,t={...e.esriConfig?.has};function has(n){return typeof t[n]==`function`?t[n]=t[n](e):t[n]}has.add=(e,n,r,i)=>{(i||t[e]===void 0)&&(t[e]=n),r&&has(e)},has.cache=t,has.add(`big-integer-warning-enabled`,!0),has.add(`esri-deprecation-warnings`,!0),has.add(`esri-tests-disable-screenshots`,!1),has.add(`esri-tests-use-full-window`,!1),has.add(`esri-tests-post-to-influx`,!0),has.add(`esri-cim-animations-enable-status`,`enabled`),has.add(`esri-cim-animations-spotlight`,!1),has.add(`esri-cim-animations-freeze-time`,!1),(()=>{has.add(`host-webworker`,e.WorkerGlobalScope!==void 0&&self instanceof e.WorkerGlobalScope);let t=typeof window<`u`&&typeof location<`u`&&typeof document<`u`&&window.location===location&&window.document===document;if(has.add(`host-browser`,t),has.add(`host-node`,!!(typeof e.process==`object`&&e.process.versions?.node&&e.process.versions.v8)),has.add(`dom`,t),has(`host-browser`)){let e=navigator,t=e.userAgent,n=e.appVersion,r=parseFloat(n);if(has.add(`wp`,parseFloat(t.split(`Windows Phone`)[1])||void 0),has.add(`msapp`,parseFloat(t.split(`MSAppHost/`)[1])||void 0),has.add(`khtml`,n.includes(`Konqueror`)?r:void 0),has.add(`edge`,parseFloat(t.split(`Edge/`)[1])||void 0),has.add(`opr`,parseFloat(t.split(`OPR/`)[1])||void 0),has.add(`webkit`,!has(`wp`)&&!has(`edge`)&&parseFloat(t.split(`WebKit/`)[1])||void 0),has.add(`chrome`,!has(`edge`)&&!has(`opr`)&&parseFloat(t.split(`Chrome/`)[1])||void 0),has.add(`android`,!has(`wp`)&&parseFloat(t.split(`Android `)[1])||void 0),has.add(`safari`,n.includes(`Safari`)&&!has(`wp`)&&!has(`chrome`)&&!has(`android`)&&!has(`edge`)&&!has(`opr`)?parseFloat(n.split(`Version/`)[1]):void 0),has.add(`mac`,n.includes(`Macintosh`)),!has(`wp`)&&/(iPhone|iPod|iPad)/.test(t)){let e=RegExp.$1.replace(/P/,`p`),n=/OS ([\d_]+)/.test(t)?RegExp.$1:`1`,r=parseFloat(n.replace(/_/,`.`).replaceAll(`_`,``));has.add(e,r),has.add(`ios`,r)}has(`webkit`)||(t.includes(`Gecko`)&&!has(`wp`)&&!has(`khtml`)&&!has(`edge`)&&has.add(`mozilla`,r),has(`mozilla`)&&has.add(`ff`,parseFloat(t.split(`Firefox/`)[1]||t.split(`Minefield/`)[1])||void 0))}})(),(()=>{if(e.navigator){let e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),n=/iPhone/i.test(e);t&&has.add(`esri-mobile`,t),n&&has.add(`esri-iPhone`,n),has.add(`esri-geolocation`,!!navigator.geolocation)}has.add(`esri-wasm`,`WebAssembly`in e),has.add(`esri-temporal`,`Temporal`in e),has.add(`esri-performance-mode-frames-between-render`,20),has.add(`esri-force-performance-mode`,!1),has.add(`esri-shared-array-buffer`,()=>{let t=`SharedArrayBuffer`in e,n=e.crossOriginIsolated===!1;return t&&!n}),has.add(`wasm-simd`,()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))),has.add(`esri-atomics`,`Atomics`in e),has.add(`esri-workers`,`Worker`in e),has.add(`web-feat:cache`,`caches`in e),has.add(`esri-workers-arraybuffer-transfer`,!has(`safari`)||Number(has(`safari`))>=12),has.add(`min-workers-pool-size`,2),has.add(`max-workers-pool-size`,has(`esri-mobile`)?3:8),has.add(`featurelayer-simplify-thresholds`,[.5,.5,.5,.5]),has.add(`featurelayer-simplify-payload-size-factors`,[1,1,4]),has.add(`featurelayer-animation-enabled`,!0),has.add(`featurelayer-hybrid-tile-enabled`,!0),has.add(`featurelayer-snapshot-enabled`,!0),has.add(`featurelayer-snapshot-initial-tolerance`,0),has.add(`featurelayer-snapshot-point-min-threshold`,8e4),has.add(`featurelayer-snapshot-point-max-threshold`,4e5),has.add(`featurelayer-snapshot-multipoint-min-threshold`,2e4),has.add(`featurelayer-snapshot-multipoint-max-threshold`,1e5),has.add(`featurelayer-snapshot-polygon-min-threshold`,2e3),has.add(`featurelayer-snapshot-polygon-max-threshold`,2e3),has.add(`featurelayer-snapshot-polyline-min-threshold`,2e3),has.add(`featurelayer-snapshot-polyline-max-threshold`,2e3),has.add(`featurelayer-snapshot-max-vertex-count`,25e4),has.add(`featurelayer-snapshot-non-hosted-exceedslimit-enabled`,!0),has.add(`featurelayer-snapshot-concurrency`,4),has.add(`featurelayer-snapshot-allow-editable`,!1),has.add(`featurelayer-snapshot-coverage`,.1),has.add(`featurelayer-pixel-buffering-enabled`,!0),has.add(`featurelayer-query-max-depth`,4),has.add(`featurelayer-query-max-page-size`,8e3),has.add(`featurelayer-query-pausing-enabled`,!1),has.add(`featurelayer-query-tile-concurrency`,4),has.add(`featurelayer-query-tile-max-features`,6e5),has.add(`featurelayer-advanced-symbols`,!1),has.add(`featurelayer-pbf`,!0),has.add(`featurelayer-pbf-statistics`,!1),has.add(`featurelayer-pbf-true-curves`,!0),has.add(`feature-layers-workers`,!0),has.add(`feature-polyline-generalization-factor`,1),has.add(`featurelayer-relative-time-queries-enabled`,!0),has.add(`featurelayer-relative-time-queries-bin-window-public`,1),has.add(`featurelayer-relative-time-queries-bin-window-private`,60),has.add(`parquetlayer-full-query-feature-count`,5e5),has.add(`parquetlayer-persistence-enabled`,!0),has.add(`parquetlayer-cache-enabled`,!0),has.add(`parquetlayer-legacy-field-overrides-enabled`,!1),has.add(`sketch-layer-enabled`,!1),has.add(`mapview-transitions-duration`,200),has.add(`mapview-essential-goto-duration`,200),has.add(`mapview-srswitch-adjust-rotation-scale-threshold`,24e6),has.add(`mapserver-pbf-version-support`,10.81),has.add(`mapservice-popup-identify-max-tolerance`,20),has.add(`request-queue-concurrency-global`,64),has.add(`request-queue-concurrency-hosted`,16),has.add(`request-queue-concurrency-non-hosted`,16),has.add(`curve-densification-coarse-segments`,128),has.add(`curve-densification-max-segments`,2e3),has.add(`curve-densification-min-segments`,3),has.add(`curve-densification-pixel-deviation`,.5),has.add(`view-readyState-waiting-delay`,1e3),has.add(`gradient-depth-bias`,.01),has.add(`gradient-depth-epsilon`,1e-8),!has(`host-webworker`)&&has(`host-browser`)&&(has.add(`esri-csp-restrictions`,()=>{try{Function()}catch{return!0}return!1}),has.add(`esri-url-encodes-apostrophe`,()=>{let e=window.document.createElement(`a`);return e.href=`?'`,e.href.includes(`?%27`)}))})();export{has as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{createTask as e}from"./asyncUtils.js";import t from"./Collection.js";import{destroyHandle as n,removeIfHandle as r}from"./handleUtils.js";import{ignoreAbortErrors as i,isAborted as a,createAbortError as o}from"./promiseUtils.js";import{on as s}from"./reactiveUtils.js";function c(e,n,r){let i=r?.createCollection?.()??new t,a=r?.recycleItems?new l:null,o=(e,t=0)=>{if(!e?.length)return;let n=i.splice(t,e.length);a?a.processRemoved(e):n.forEach(d)},c=(e,t=0)=>{if(!e?.length)return;let r=[];for(let t of e){let e=a?.use(t);if(e)r.push(e);else{let e=n(t);a?.register(t,e),r.push(e)}}i.addMany(r,t)},u=s(e,`after-splice`,({added:e,start:t,removed:n})=>{o(n,t),c(e,t)},{sync:!0,onListenerRemove:e=>o(e.items),onListenerAdd:e=>c(e.items)});return i.addHandles(u),i}class l{constructor(){this._originalToMapped=new Map,this._removedItemCandidates=new Set,this._garbageCollectionQueued=!1}processRemoved(e){if(!e?.length)return;let{_removedItemCandidates:t}=this;for(let n of e)this._getItem(n)?.markRemoved()&&(t.add(n),this._queueGarbageCollection())}use(e){let t=this._getItem(e);return t&&(t.removed=!1),t?.item}register(e,t){this._originalToMapped.set(e,new u(t))}_getItem(e){return this._originalToMapped.get(e)}_queueGarbageCollection(){this._garbageCollectionQueued||(this._garbageCollectionQueued=!0,queueMicrotask(()=>this._garbageCollectCandidates()))}_garbageCollectCandidates(){this._garbageCollectionQueued=!1;let{_removedItemCandidates:e}=this,t=Array.from(e);e.clear(),t.forEach(e=>this._garbageCollectIfRemoved(e))}_garbageCollectIfRemoved(e){let{_originalToMapped:t}=this,n=this._getItem(e);n?.removed&&(d(n.item),t.delete(e))}}class u{constructor(e){this.item=e,this.removed=!1}markRemoved(){return this.removed=!0,!0}}function d(e){typeof e==`object`&&e&&(`destroy`in e&&typeof e.destroy==`function`?e.destroy():r(e))}function f(r,s,l){let u=new t,f=c(r,t=>e(async e=>{let n=await s(t,e);if(a(e))throw d(n),o();return n}),l),p=()=>null,m=async e=>{let t=await e.promise,n=f.indexOf(e);n<0
|
|
2
|
+
import{createTask as e}from"./asyncUtils.js";import t from"./Collection.js";import{destroyHandle as n,removeIfHandle as r}from"./handleUtils.js";import{ignoreAbortErrors as i,isAborted as a,createAbortError as o}from"./promiseUtils.js";import{on as s}from"./reactiveUtils.js";function c(e,n,r){let i=r?.createCollection?.()??new t,a=r?.recycleItems?new l:null,o=(e,t=0)=>{if(!e?.length)return;let n=i.splice(t,e.length);a?a.processRemoved(e):n.forEach(d)},c=(e,t=0)=>{if(!e?.length)return;let r=[];for(let t of e){let e=a?.use(t);if(e)r.push(e);else{let e=n(t);a?.register(t,e),r.push(e)}}i.addMany(r,t)},u=s(e,`after-splice`,({added:e,start:t,removed:n})=>{o(n,t),c(e,t)},{sync:!0,onListenerRemove:e=>o(e.items),onListenerAdd:e=>c(e.items)});return i.addHandles(u),i}class l{constructor(){this._originalToMapped=new Map,this._removedItemCandidates=new Set,this._garbageCollectionQueued=!1}processRemoved(e){if(!e?.length)return;let{_removedItemCandidates:t}=this;for(let n of e)this._getItem(n)?.markRemoved()&&(t.add(n),this._queueGarbageCollection())}use(e){let t=this._getItem(e);return t&&(t.removed=!1),t?.item}register(e,t){this._originalToMapped.set(e,new u(t))}_getItem(e){return this._originalToMapped.get(e)}_queueGarbageCollection(){this._garbageCollectionQueued||(this._garbageCollectionQueued=!0,queueMicrotask(()=>this._garbageCollectCandidates()))}_garbageCollectCandidates(){this._garbageCollectionQueued=!1;let{_removedItemCandidates:e}=this,t=Array.from(e);e.clear(),t.forEach(e=>this._garbageCollectIfRemoved(e))}_garbageCollectIfRemoved(e){let{_originalToMapped:t}=this,n=this._getItem(e);n?.removed&&(d(n.item),t.delete(e))}}class u{constructor(e){this.item=e,this.removed=!1}markRemoved(){return this.removed=!0,!0}}function d(e){typeof e==`object`&&e&&(`destroy`in e&&typeof e.destroy==`function`?e.destroy():r(e))}function f(r,s,l){let u=new t,f=c(r,t=>e(async e=>{let n=await s(t,e);if(a(e))throw d(n),o();return n}),l),p=()=>null,m=async e=>{let t=await e.promise,n=f.indexOf(e);if(n<0){d(t);return}u.splice(n,1,t)};u.addMany(f.items.map(p));for(let e of f)i(m(e));let h=f.on(`after-splice`,({added:e,start:t,deleteCount:n})=>{let r=u.splice(t,n);for(let e of r)d(e);if(e?.length){u.addMany(e.map(p),t);for(let t of e)i(m(t))}});return u.addHandles([n(f),h]),u}export{c as mapCollection,f as mapCollectionAsync};
|
|
@@ -49,30 +49,23 @@ export interface InvokeOptions extends AbortOptions {
|
|
|
49
49
|
*
|
|
50
50
|
* ```js
|
|
51
51
|
* // Module loaded in main thread
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* .
|
|
63
|
-
*
|
|
64
|
-
* connection.close();
|
|
65
|
-
* connection = null;
|
|
66
|
-
*
|
|
67
|
-
* return result;
|
|
68
|
-
* });
|
|
52
|
+
* import { open } from "@arcgis/core/core/workers.js";
|
|
53
|
+
*
|
|
54
|
+
* export async function getSumAsync(numbers) {
|
|
55
|
+
* const connection = await open(new URL("./calculator.js", import.meta.url).href, {
|
|
56
|
+
* isESM: true
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* try {
|
|
60
|
+
* return await connection.invoke("getSum", numbers);
|
|
61
|
+
* } finally {
|
|
62
|
+
* connection.close();
|
|
63
|
+
* }
|
|
69
64
|
* }
|
|
70
65
|
*
|
|
71
66
|
* // Invoke our method.
|
|
72
|
-
* getSumAsync([0, 2, 4, 6, 8])
|
|
73
|
-
*
|
|
74
|
-
* console.log("Result:", result);
|
|
75
|
-
* });
|
|
67
|
+
* const result = await getSumAsync([0, 2, 4, 6, 8]);
|
|
68
|
+
* console.log("Result:", result);
|
|
76
69
|
* ```
|
|
77
70
|
*
|
|
78
71
|
* <span id="multiple-parameters"></span>
|
|
@@ -102,55 +95,37 @@ export interface InvokeOptions extends AbortOptions {
|
|
|
102
95
|
*
|
|
103
96
|
* ```js
|
|
104
97
|
* // Module loaded in main thread
|
|
105
|
-
* export function mapMultiplyAsync(numbers, factor) {
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* numbers: numbers,
|
|
116
|
-
* factor: factor
|
|
117
|
-
* });
|
|
118
|
-
* })
|
|
119
|
-
* .then(function(result) {
|
|
120
|
-
* // close the connection after we are done.
|
|
121
|
-
* connection.close();
|
|
122
|
-
* connection = null;
|
|
123
|
-
*
|
|
124
|
-
* return result;
|
|
98
|
+
* export async function mapMultiplyAsync(numbers, factor) {
|
|
99
|
+
* const connection = await open(new URL("./calculator.js", import.meta.url).href, {
|
|
100
|
+
* isESM: true
|
|
101
|
+
* });
|
|
102
|
+
*
|
|
103
|
+
* try {
|
|
104
|
+
* // Invoke mapMultiply and pass an object with two key-value pairs.
|
|
105
|
+
* return await connection.invoke("mapMultiply", {
|
|
106
|
+
* numbers: numbers,
|
|
107
|
+
* factor: factor
|
|
125
108
|
* });
|
|
109
|
+
* } finally {
|
|
110
|
+
* connection.close();
|
|
111
|
+
* }
|
|
126
112
|
* }
|
|
127
113
|
*
|
|
128
114
|
* // Invoke the method.
|
|
129
|
-
* mapMultiplyAsync([0, 2, 4, 6, 8], 2)
|
|
130
|
-
*
|
|
131
|
-
* console.log("Result:", result);
|
|
132
|
-
* });
|
|
115
|
+
* const result = await mapMultiplyAsync([0, 2, 4, 6, 8], 2);
|
|
116
|
+
* console.log("Result:", result);
|
|
133
117
|
* ```
|
|
134
118
|
*
|
|
135
119
|
* <span id="using-transferables"></span>
|
|
136
120
|
* ## Using transferables
|
|
137
121
|
*
|
|
138
|
-
*
|
|
122
|
+
* [Transferable objects](https://developer.mozilla.org/docs/Web/API/Web_Workers_API/Transferable_objects) can be used
|
|
139
123
|
* to transfer data between main and worker thread to avoid copying the data. With this approach,
|
|
140
124
|
* the ownership of the object is transferred to the other context. Use this technique to transfer large
|
|
141
125
|
* chuck of memory with [ArrayBuffers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer),
|
|
142
126
|
* a [MessagePort](https://developer.mozilla.org/docs/Web/API/MessagePort),
|
|
143
127
|
* or an [ImageBitmap](https://developer.mozilla.org/docs/Web/API/ImageBitmap).
|
|
144
128
|
*
|
|
145
|
-
* > [!CAUTION]
|
|
146
|
-
* >
|
|
147
|
-
* > **Note**
|
|
148
|
-
* >
|
|
149
|
-
* > The `Transferable` interface technically no longer exists. The functionality of `Transferable` objects still exists,
|
|
150
|
-
* > however, but is implemented at a more fundamental level
|
|
151
|
-
* > (technically speaking, using the `[Transferable]` [WebIDL](https://developer.mozilla.org/docs/Glossary/WebIDL)
|
|
152
|
-
* > extended attribute). See also [Transferable objects](https://developer.mozilla.org/docs/Web/API/Web_Workers_API/Transferable_objects).
|
|
153
|
-
*
|
|
154
129
|
* To transfer an object to the worker, use the `transferList` parameter of the [invoke()](https://developers.arcgis.com/javascript/latest/references/core/core/workers/Connection/#invoke) method.
|
|
155
130
|
* For the remote method to return or resolve with a transferable object, the result returned must have
|
|
156
131
|
* two properties: `result` and `transferList`, `result` being an object and `transferList` the array
|
|
@@ -184,26 +159,19 @@ export interface InvokeOptions extends AbortOptions {
|
|
|
184
159
|
*
|
|
185
160
|
* ```js
|
|
186
161
|
* // Module loaded in main thread
|
|
187
|
-
* export function mapMultiplyFloat64Async(numbers, factor) {
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* numbers: numbers,
|
|
197
|
-
* factor: factor
|
|
198
|
-
* });
|
|
199
|
-
* })
|
|
200
|
-
* .then(function(result) {
|
|
201
|
-
* // close the connection after we are done.
|
|
202
|
-
* connection.close();
|
|
203
|
-
* connection = null;
|
|
204
|
-
*
|
|
205
|
-
* return result;
|
|
162
|
+
* export async function mapMultiplyFloat64Async(numbers, factor) {
|
|
163
|
+
* const connection = await open(new URL("./calculator.js", import.meta.url).href, {
|
|
164
|
+
* isESM: true
|
|
165
|
+
* });
|
|
166
|
+
*
|
|
167
|
+
* try {
|
|
168
|
+
* return await connection.invoke("mapMultiplyFloat64", {
|
|
169
|
+
* numbers: numbers,
|
|
170
|
+
* factor: factor
|
|
206
171
|
* });
|
|
172
|
+
* } finally {
|
|
173
|
+
* connection.close();
|
|
174
|
+
* }
|
|
207
175
|
* }
|
|
208
176
|
*
|
|
209
177
|
* // Invoke our method.
|
|
@@ -213,11 +181,9 @@ export interface InvokeOptions extends AbortOptions {
|
|
|
213
181
|
* floats[2] = 4;
|
|
214
182
|
* floats[3] = 6;
|
|
215
183
|
* floats[4] = 8;
|
|
216
|
-
* mapMultiplyFloat64Async(floats, 2)
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
* console.log("Result:", resultFloats);
|
|
220
|
-
* });
|
|
184
|
+
* const result = await mapMultiplyFloat64Async(floats, 2);
|
|
185
|
+
* const resultFloats = new Float64Array(result);
|
|
186
|
+
* console.log("Result:", resultFloats);
|
|
221
187
|
* ```
|
|
222
188
|
*
|
|
223
189
|
* @since 4.2
|
|
@@ -250,16 +216,19 @@ export default abstract class Connection {
|
|
|
250
216
|
* const controller = new AbortController();
|
|
251
217
|
* const signal = controller.signal;
|
|
252
218
|
*
|
|
253
|
-
* //
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
* }
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
219
|
+
* // Invoke a function on a worker thread.
|
|
220
|
+
* async function invokeWithTimeout() {
|
|
221
|
+
* try {
|
|
222
|
+
* const result = await connection.invoke("myLongRunningRemoteFunction", { someParameter: 10 }, {
|
|
223
|
+
* signal
|
|
224
|
+
* });
|
|
225
|
+
* console.log(result);
|
|
226
|
+
* } catch (error) {
|
|
227
|
+
* console.error(error);
|
|
228
|
+
* }
|
|
229
|
+
* }
|
|
230
|
+
*
|
|
231
|
+
* invokeWithTimeout();
|
|
263
232
|
*
|
|
264
233
|
* // if the call it takes more than 10 secs, abort:
|
|
265
234
|
* setTimeout(() => {
|
package/core/workers.d.ts
CHANGED
|
@@ -32,14 +32,18 @@ import type { AbortOptions } from "./promiseUtils.js";
|
|
|
32
32
|
*
|
|
33
33
|
* Possible Value | Description
|
|
34
34
|
* ---------------|------------
|
|
35
|
-
* distributed | The module is loaded in each available worker. Each
|
|
36
|
-
* dedicated | The module is loaded in
|
|
37
|
-
* local | The module
|
|
35
|
+
* distributed | The module is loaded in each available worker. Each invocation is handled by an available worker. Use this strategy when the module is stateless and does not need to retain data between invocations.
|
|
36
|
+
* dedicated | The module is loaded in a single worker, and all invocations are handled by that worker. Use this strategy when the module needs to retain state between invocations or maintain stateful communication with the main thread.
|
|
37
|
+
* local | The module runs on the main thread instead of in a worker. Use this strategy when worker execution is unavailable or not desired. This can affect UI responsiveness.
|
|
38
38
|
*/
|
|
39
39
|
export type OpenStrategy = "distributed" | "dedicated" | "local";
|
|
40
40
|
|
|
41
41
|
export interface OpenOptions extends AbortOptions {
|
|
42
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* An object containing methods that the worker module can call on the main thread.
|
|
44
|
+
* In a custom worker class, declare a `remoteClient` property and use
|
|
45
|
+
* `this.remoteClient.invoke("methodName", data)` to invoke a method on this object.
|
|
46
|
+
*/
|
|
43
47
|
client?: any;
|
|
44
48
|
/**
|
|
45
49
|
* Indicates whether the module is an ES module.
|
|
@@ -51,7 +55,7 @@ export interface OpenOptions extends AbortOptions {
|
|
|
51
55
|
*/
|
|
52
56
|
isESM?: boolean;
|
|
53
57
|
/**
|
|
54
|
-
* Indicates how to load the module. See
|
|
58
|
+
* Indicates how to load the module. See [OpenStrategy](https://developers.arcgis.com/javascript/latest/references/core/core/workers/#OpenStrategy) for a list of possible values.
|
|
55
59
|
*
|
|
56
60
|
* @default distributed
|
|
57
61
|
*/
|
|
@@ -66,67 +70,54 @@ export interface OpenOptions extends AbortOptions {
|
|
|
66
70
|
* @returns Resolves to an instance of [Connection](https://developers.arcgis.com/javascript/latest/references/core/core/workers/Connection/).
|
|
67
71
|
* @see [Connection](https://developers.arcgis.com/javascript/latest/references/core/core/workers/Connection/)
|
|
68
72
|
* @example
|
|
69
|
-
*
|
|
70
|
-
* // to a folder called workersFolder.
|
|
71
|
-
* esriConfig.workers.loaderConfig = {
|
|
72
|
-
* paths: {
|
|
73
|
-
* myWorkers: new URL("./workersFolder", document.baseURI).href
|
|
74
|
-
* }
|
|
75
|
-
* };
|
|
73
|
+
* import { open } from "@arcgis/core/core/workers.js";
|
|
76
74
|
*
|
|
77
|
-
* //
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* .
|
|
84
|
-
*
|
|
85
|
-
*
|
|
75
|
+
* // Load an ESM worker module and invoke its "getMaxNumber" function.
|
|
76
|
+
* const connection = await open(new URL("./workersFolder/Calculator.js", import.meta.url).href, {
|
|
77
|
+
* isESM: true
|
|
78
|
+
* });
|
|
79
|
+
* try {
|
|
80
|
+
* // Invoke the worker function and receive its result on the main thread.
|
|
81
|
+
* const result = await connection.invoke("getMaxNumber", [0, 1, 2, 3, 4]);
|
|
82
|
+
* console.log(result);
|
|
83
|
+
* } finally {
|
|
84
|
+
* connection.close();
|
|
85
|
+
* }
|
|
86
86
|
*
|
|
87
87
|
* //*********************************************************
|
|
88
|
-
* // module:
|
|
88
|
+
* // module: workersFolder/Calculator.js
|
|
89
89
|
* //*********************************************************
|
|
90
|
-
*
|
|
91
|
-
* return
|
|
92
|
-
*
|
|
93
|
-
* getMaxNumber: function (number) {
|
|
94
|
-
* return Math.max.apply(null, numbers);
|
|
95
|
-
* }
|
|
96
|
-
* };
|
|
97
|
-
* });
|
|
90
|
+
* export function getMaxNumber(numbers) {
|
|
91
|
+
* return Math.max(...numbers);
|
|
92
|
+
* }
|
|
98
93
|
* @example
|
|
99
|
-
* // Load
|
|
100
|
-
*
|
|
101
|
-
*
|
|
94
|
+
* // Load an ESM worker module that calls a function on the main thread.
|
|
95
|
+
* const connection = await open(new URL("./workerScripts/TimeOfDay.js", import.meta.url).href, {
|
|
96
|
+
* isESM: true,
|
|
102
97
|
* client: {
|
|
103
|
-
* getCurrentTime
|
|
98
|
+
* getCurrentTime() {
|
|
104
99
|
* return Date.now();
|
|
105
100
|
* }
|
|
106
101
|
* }
|
|
107
|
-
* })
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* .
|
|
112
|
-
*
|
|
113
|
-
*
|
|
102
|
+
* });
|
|
103
|
+
*
|
|
104
|
+
* try {
|
|
105
|
+
* const result = await connection.invoke("timeOfTheDay");
|
|
106
|
+
* console.log(result);
|
|
107
|
+
* } finally {
|
|
108
|
+
* connection.close();
|
|
109
|
+
* }
|
|
114
110
|
*
|
|
115
111
|
* //*********************************************************
|
|
116
|
-
* // module: workerScripts/
|
|
112
|
+
* // module: workerScripts/TimeOfDay.js
|
|
117
113
|
* //*********************************************************
|
|
114
|
+
* export default class TimeOfTheDay {
|
|
115
|
+
* remoteClient;
|
|
118
116
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* return remoteClient.invoke("getCurrentTime")
|
|
125
|
-
* .then((time) => {
|
|
126
|
-
* return "The time is " + time;
|
|
127
|
-
* });
|
|
128
|
-
* }
|
|
129
|
-
* };
|
|
130
|
-
* });
|
|
117
|
+
* async timeOfTheDay() {
|
|
118
|
+
* const time = await this.remoteClient.invoke("getCurrentTime");
|
|
119
|
+
* return `The time is ${time}`;
|
|
120
|
+
* }
|
|
121
|
+
* }
|
|
131
122
|
*/
|
|
132
123
|
export function open(modulePath: string, options?: OpenOptions): Promise<Connection>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{nativeArrayMaxSize as e,isTypedArray as t}from"../../core/typedArrayUtil.js";function n(e){return r(e,!0)}function r(n,r){if(Array.isArray(n)){if(n.length<e)return n}else if(n.length<e)return Array.from(n);let i=!0,o=!0;return n.some((e,t)=>(i&&=e===0,o&&=e===t,!i&&!o)),i?
|
|
2
|
+
import{nativeArrayMaxSize as e,isTypedArray as t}from"../../core/typedArrayUtil.js";function n(e){return r(e,!0)}function r(n,r){if(Array.isArray(n)){if(n.length<e)return n}else if(n.length<e)return Array.from(n);let i=!0,o=!0;return n.some((e,t)=>(i&&=e===0,o&&=e===t,!i&&!o)),i?g(n.length):o?d(n.length):t(n)&&n.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?n:a(n,!r)}function i(t,n){return t.length<e?Array.from(t):n<256?Uint8Array.from(t):n<2**16?Uint16Array.from(t):Uint32Array.from(t)}function a(e,n){for(let r of e){if(r>=65536)return t(e)?e:new Uint32Array(e);r>=256&&(n=!1)}return n?new Uint8Array(e):new Uint16Array(e)}function o(t,n=t){return t<=e?Array(t):n<=65536?new Uint16Array(t):new Uint32Array(t)}function s(e,t,n){if(t.length===0)return e.slice();if(e.length===0)return t.slice();let r=o(e.length+t.length,n);for(let t=0;t<e.length;++t)r[t]=e[t];for(let n=0;n<t.length;++n)r[e.length+n]=t[n];return r}let c=m(131072);const l=[0],u=(()=>{let e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(t){return t===1?l:t<e?p(t):t<u.length?new Uint16Array(u.buffer,0,t):(t>c.length&&(c=m(Math.max(2*c.length,t))),new Uint32Array(c.buffer,0,t))}function f(t){return t===1?[0]:t<e?p(t):t<u.length?new Uint16Array(u.buffer,0,t).slice():(t>c.length&&(c=m(Math.max(2*c.length,t))),new Uint32Array(c.buffer,0,t).slice())}function p(e){let t=Array(e).fill(0);for(let n=0;n<e;n++)t[n]=n;return t}function m(e){let t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let h=new Uint8Array(65536);function g(t){if(t===1)return l;if(t<e)return Array(t).fill(0);if(t>h.length){let e=Math.max(2*h.length,t);h=new Uint8Array(e)}return new Uint8Array(h.buffer,0,t)}function _(){c=m(131072),h=new Uint8Array(65536)}function v(e){return`byteLength`in e?e.byteLength:e.length*8}export{r as compactIndices,n as compactMeshIndices,s as concatIndexArrays,d as getContinuousIndexArray,g as getZeroIndexArray,v as indexArrayByteSize,i as indexArrayFrom,f as newContinuousIndexArray,o as newIndexArray,_ as pruneIndexArrays};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clamp as e,floatEqualUlp as t}from"../../core/mathUtils.js";import n from"../Extent.js";function r(e){return e}function i(e=Q){return r([e[0],e[1],e[2],e[3]])}function a(e){return r([e[0],e[1],e[2],e[3]])}function o(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function s(e,t,n,r,a=i()){return a[0]=e,a[1]=t,a[2]=n,a[3]=r,a}function c(e,t=i()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function l(e,t,r=new n){return r.xmin=e[0],r.ymin=e[1],r.xmax=e[2],r.ymax=e[3],r.spatialReference=t,r}function u(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function d(e,t){t<e[0]&&(e[0]=t),t>e[2]&&(e[2]=t)}function f(e,t){t<e[1]&&(e[1]=t),t>e[3]&&(e[3]=t)}function p(e,{xmin:t,ymin:n,xmax:r,ymax:i}){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],r),e[3]=Math.max(e[3],i)}function m(e,t,n){if(t==null){o(n,e);return}if(`length`in t)U(t)?(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3])):(t.length===2||t.length===3)&&(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[0]),n[3]=Math.max(e[3],t[1]));else switch(t.type){case`extent`:n[0]=Math.min(e[0],t.xmin),n[1]=Math.min(e[1],t.ymin),n[2]=Math.max(e[2],t.xmax),n[3]=Math.max(e[3],t.ymax);break;case`point`:n[0]=Math.min(e[0],t.x),n[1]=Math.min(e[1],t.y),n[2]=Math.max(e[2],t.x),n[3]=Math.max(e[3],t.y)}}function h(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3])}function g(e,t,n=e){let r=t.length,i=e[0],a=e[1],o=e[2],s=e[3];for(let e=0;e<r;e++){let n=t[e];i=Math.min(i,n[0]),a=Math.min(a,n[1]),o=Math.max(o,n[0]),s=Math.max(s,n[1])}return n[0]=i,n[1]=a,n[2]=o,n[3]=s,n}function _(e){for(let t=0;t<4;t++)if(!isFinite(e[t]))return!1;return!0}function v(e){return e==null||e[0]>=e[2]?0:e[2]-e[0]}function y(e){return e==null||e[1]>=e[3]?0:e[3]-e[1]}function b(e){return v(e)*y(e)}function x(e){return v(e)>0&&y(e)>0}function S(e,t=[0,0]){return t[0]=(e[0]+e[2])/2,t[1]=(e[1]+e[3])/2,t}function C(e){let t=v(e),n=y(e);return Math.sqrt(t*t+n*n)}function w(e,t){return O(e,t[0],t[1])}function T(e,t){let n=t.radius,r=(e[0]+e[2])*.5,i=Math.abs(t.center[0]-r),a=(e[2]-e[0])*.5;if(i>n+a)return!1;let o=(e[1]+e[3])*.5,s=(e[3]-e[1])*.5,c=Math.abs(t.center[1]-o);if(c>n+s)return!1;if(i<a||c<s)return!0;let l=i-a,u=c-s;return l*l+u*u<=n*n}function E(e,t,n){let r=e[0],i=e[1],a=e[2],o=e[3],{x:s,y:c}=t,{x:l,y:u}=n,d=(e,t)=>(u-c)*e+(s-l)*t+(l*c-s*u)<0,f=d(r,o),p=d(a,o),m=d(a,i),h=d(r,i);return!(f===p&&p===m&&m===h&&h===f||s<r&&l<r||s>a&&l>a||c>o&&u>o||c<i&&u<i)}function D(e,t){return e?O(e,t.x,t.y):!1}function O(e,t,n){return t>=e[0]&&n>=e[1]&&t<=e[2]&&n<=e[3]}function k(e,t,n,r){return t>=e[0]-r&&n>=e[1]-r&&t<=e[2]+r&&n<=e[3]+r}function A(e,t,n){return t[0]>=e[0]-n&&t[1]>=e[1]-n&&t[0]<=e[2]+n&&t[1]<=e[3]+n}function j(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function M(e,t,n){return Math.max(t[0],e[0])-n<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])-n<=Math.min(t[3],e[3])}function N(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function P(e,t,n){return t==null?o(n,e):(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3]),n)}function F(t,n,r){if(n==null)return o(r,t);let i=n[0],a=n[1],s=n[2],c=n[3];return r[0]=e(t[0],i,s),r[1]=e(t[1],a,c),r[2]=e(t[2],i,s),r[3]=e(t[3],a,c),r}function I(e,t){let n=(e[0]+e[2])/2,r=(e[1]+e[3])/2,i=Math.max(Math.abs(t[0]-n)-v(e)/2,0),a=Math.max(Math.abs(t[1]-r)-y(e)/2,0);return Math.sqrt(i*i+a*a)}function L(e,t){t[0]=e[2]-e[0],t[1]=e[3]-e[1]}function R(e,t,n,r){return r??=e,r[0]=e[0]+t,r[1]=e[1]+n,r[2]=e[2]+t,r[3]=e[3]+n,r}function z(e,t,n=e){return n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n}function B(e,t,n=e){return n[0]=t[0],n[1]=t[1],n!==e&&(n[2]=e[2],n[3]=e[3]),n}function V(e,t,n=e){return n[2]=t[0],n[3]=t[1],n!==e&&(n[0]=e[0],n[1]=e[1]),e}function H(e){return e?o(e,Z):i(Z)}function U(e){return e!=null&&e.length===4}function W(e){return(v(e)===0||!isFinite(e[0]))&&(y(e)===0||!isFinite(e[1]))}function G(e,t){return!U(e)||!U(t)?e===t:e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function K(e,n,r){return e!=null&&n!=null&&e.every((e,i)=>t(e,n[i],r))}function q(e,t,n){return t==null?!1:n?n.contains(e[0],e[2],t[0])&&n.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:N(e,t)}function J(e,t,n){return e==null?!1:n?(n.contains(t[0],t[2],e[0])||n.contains(t[0],t[2],e[2])||n.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):j(e,t)}function Y(e,t){if(t.length!==4||e[0]===e[2]||e[1]===e[3])return!1;for(let n=0;n<t.length;n++){let r=t[n],i=t[(n+1)%t.length];if(r[0]!==e[0]&&r[0]!==e[2]||r[1]!==e[1]&&r[1]!==e[3])return!1;let a=r[1]===i[1]&&r[0]!==i[0],o=r[0]===i[0]&&r[1]!==i[1];if(!a&&!o)return!1}return!0}const X=r([-1/0,-1/0,1/0,1/0]),Z=r([1/0,1/0,-1/0,-1/0]),Q=r([0,0,0,0]),$=r([0,0,1,1]);export{_ as allFinite,K as almostEquals,b as area,S as center,a as clone,N as contains,w as containsPoint,D as containsPointObject,A as containsPointWithMargin,O as containsXY,k as containsXYWithMargin,o as copy,i as create,C as diagonal,I as distance,H as empty,G as equals,Y as equalsPoints,m as expand,p as expandExtentInPlace,u as expandPointInPlace,g as expandWithNestedArray,h as expandWithRect,d as expandXInPlace,f as expandYInPlace,c as fromExtent,s as fromValues,x as hasArea,y as height,F as intersection,j as intersects,E as intersectsSegment,T as intersectsSphere,M as intersectsWithMargin,U as is,W as isPoint,Z as negativeInfinity,R as offset,z as pad,X as positiveInfinity,q as rectangleContainsRectangleCyclicalAware,J as rectanglesIntersectCyclicalAware,V as setMax,B as setMin,L as size,l as toExtent,P as union,$ as unit,v as width,Q as zero};
|
|
2
|
+
import{clamp as e,floatEqualUlp as t}from"../../core/mathUtils.js";import n from"../Extent.js";function r(e){return e}function i(e=Q){return r([e[0],e[1],e[2],e[3]])}function a(e){return r([e[0],e[1],e[2],e[3]])}function o(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function s(e,t,n,r,a=i()){return a[0]=e,a[1]=t,a[2]=n,a[3]=r,a}function c(e,t=i()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function l(e,t,r=new n){return r.xmin=e[0],r.ymin=e[1],r.xmax=e[2],r.ymax=e[3],r.spatialReference=t,r}function u(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function d(e,t){t<e[0]&&(e[0]=t),t>e[2]&&(e[2]=t)}function f(e,t){t<e[1]&&(e[1]=t),t>e[3]&&(e[3]=t)}function p(e,{xmin:t,ymin:n,xmax:r,ymax:i}){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],r),e[3]=Math.max(e[3],i)}function m(e,t,n){if(t==null){o(n,e);return}if(`length`in t)U(t)?(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3])):(t.length===2||t.length===3)&&(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[0]),n[3]=Math.max(e[3],t[1]));else switch(t.type){case`extent`:n[0]=Math.min(e[0],t.xmin),n[1]=Math.min(e[1],t.ymin),n[2]=Math.max(e[2],t.xmax),n[3]=Math.max(e[3],t.ymax);break;case`point`:n[0]=Math.min(e[0],t.x),n[1]=Math.min(e[1],t.y),n[2]=Math.max(e[2],t.x),n[3]=Math.max(e[3],t.y)}}function h(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3])}function g(e,t,n=e){let r=t.length,i=e[0],a=e[1],o=e[2],s=e[3];for(let e=0;e<r;e++){let n=t[e];i=Math.min(i,n[0]),a=Math.min(a,n[1]),o=Math.max(o,n[0]),s=Math.max(s,n[1])}return n[0]=i,n[1]=a,n[2]=o,n[3]=s,n}function _(e){for(let t=0;t<4;t++)if(!isFinite(e[t]))return!1;return!0}function v(e){return e==null||e[0]>=e[2]?0:e[2]-e[0]}function y(e){return e==null||e[1]>=e[3]?0:e[3]-e[1]}function b(e){return v(e)*y(e)}function x(e){return v(e)>0&&y(e)>0}function S(e,t=[0,0]){return t[0]=(e[0]+e[2])/2,t[1]=(e[1]+e[3])/2,t}function C(e){let t=v(e),n=y(e);return Math.sqrt(t*t+n*n)}function w(e,t){return O(e,t[0],t[1])}function T(e,t){let n=t.radius,r=(e[0]+e[2])*.5,i=Math.abs(t.center[0]-r),a=(e[2]-e[0])*.5;if(i>n+a)return!1;let o=(e[1]+e[3])*.5,s=(e[3]-e[1])*.5,c=Math.abs(t.center[1]-o);if(c>n+s)return!1;if(i<a||c<s)return!0;let l=i-a,u=c-s;return l*l+u*u<=n*n}function E(e,t,n){let r=e[0],i=e[1],a=e[2],o=e[3],{x:s,y:c}=t,{x:l,y:u}=n,d=(e,t)=>(u-c)*e+(s-l)*t+(l*c-s*u)<0,f=d(r,o),p=d(a,o),m=d(a,i),h=d(r,i);return!(f===p&&p===m&&m===h&&h===f||s<r&&l<r||s>a&&l>a||c>o&&u>o||c<i&&u<i)}function D(e,t){return e?O(e,t.x,t.y):!1}function O(e,t,n){return t>=e[0]&&n>=e[1]&&t<=e[2]&&n<=e[3]}function k(e,t,n,r){return t>=e[0]-r&&n>=e[1]-r&&t<=e[2]+r&&n<=e[3]+r}function A(e,t,n){return t[0]>=e[0]-n&&t[1]>=e[1]-n&&t[0]<=e[2]+n&&t[1]<=e[3]+n}function j(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function M(e,t,n){return Math.max(t[0],e[0])-n<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])-n<=Math.min(t[3],e[3])}function N(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function P(e,t,n){return t==null?o(n,e):(n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3]),n)}function F(t,n,r){if(n==null)return o(r,t);let i=n[0],a=n[1],s=n[2],c=n[3];return r[0]=e(t[0],i,s),r[1]=e(t[1],a,c),r[2]=e(t[2],i,s),r[3]=e(t[3],a,c),r}function I(e,t){let n=(e[0]+e[2])/2,r=(e[1]+e[3])/2,i=Math.max(Math.abs(t[0]-n)-v(e)/2,0),a=Math.max(Math.abs(t[1]-r)-y(e)/2,0);return Math.sqrt(i*i+a*a)}function L(e,t){t[0]=e[2]-e[0],t[1]=e[3]-e[1]}function R(e,t,n,r){return r??=e,r[0]=e[0]+t,r[1]=e[1]+n,r[2]=e[2]+t,r[3]=e[3]+n,r}function z(e,t,n=e){return n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n}function B(e,t,n=e){return n[0]=t[0],n[1]=t[1],n!==e&&(n[2]=e[2],n[3]=e[3]),n}function V(e,t,n=e){return n[2]=t[0],n[3]=t[1],n!==e&&(n[0]=e[0],n[1]=e[1]),e}function H(e){return e?o(e,Z):i(Z)}function U(e){return e!=null&&e.length===4}function W(e){return(v(e)===0||!isFinite(e[0]))&&(y(e)===0||!isFinite(e[1]))}function G(e,t){return!U(e)||!U(t)?e==null&&t==null||e===t:e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function K(e,n,r){return e!=null&&n!=null&&e.every((e,i)=>t(e,n[i],r))}function q(e,t,n){return t==null?!1:n?n.contains(e[0],e[2],t[0])&&n.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:N(e,t)}function J(e,t,n){return e==null?!1:n?(n.contains(t[0],t[2],e[0])||n.contains(t[0],t[2],e[2])||n.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):j(e,t)}function Y(e,t){if(t.length!==4||e[0]===e[2]||e[1]===e[3])return!1;for(let n=0;n<t.length;n++){let r=t[n],i=t[(n+1)%t.length];if(r[0]!==e[0]&&r[0]!==e[2]||r[1]!==e[1]&&r[1]!==e[3])return!1;let a=r[1]===i[1]&&r[0]!==i[0],o=r[0]===i[0]&&r[1]!==i[1];if(!a&&!o)return!1}return!0}const X=r([-1/0,-1/0,1/0,1/0]),Z=r([1/0,1/0,-1/0,-1/0]),Q=r([0,0,0,0]),$=r([0,0,1,1]);export{_ as allFinite,K as almostEquals,b as area,S as center,a as clone,N as contains,w as containsPoint,D as containsPointObject,A as containsPointWithMargin,O as containsXY,k as containsXYWithMargin,o as copy,i as create,C as diagonal,I as distance,H as empty,G as equals,Y as equalsPoints,m as expand,p as expandExtentInPlace,u as expandPointInPlace,g as expandWithNestedArray,h as expandWithRect,d as expandXInPlace,f as expandYInPlace,c as fromExtent,s as fromValues,x as hasArea,y as height,F as intersection,j as intersects,E as intersectsSegment,T as intersectsSphere,M as intersectsWithMargin,U as is,W as isPoint,Z as negativeInfinity,R as offset,z as pad,X as positiveInfinity,q as rectangleContainsRectangleCyclicalAware,J as rectanglesIntersectCyclicalAware,V as setMax,B as setMin,L as size,l as toExtent,P as union,$ as unit,v as width,Q as zero};
|
package/geometry/support/ray.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{ObjectStack as e}from"../../core/ObjectStack.js";import{set as t,invert as n}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as i,subtract as a,exactEquals as o,dot as s,normalize as c,cross as l,sub as u,set as d,add as f,scale as p}from"../../core/libs/gl-matrix-2/math/vec3.js";import{clone as m,create as h}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as g}from"./vectorStacks.js";function _(e){return e?v(m(e.origin),m(e.direction)):v(h(),h())}function v(e,t){return{origin:e,direction:t}}function y(e,t){return o(e.origin,t.origin)&&o(e.direction,t.direction)}function b(e,t){let n=D.get();return n.origin=e,n.direction=t,n}function x(e,t=_()){return C(e.origin,e.direction,t)}function S(e,t,n=_()){return i(n.origin,e),a(n.direction,t,e),n}function C(e,t,n=_()){return i(n.origin,e),i(n.direction,t),n}function w(e,t){let n=l(g.get(),c(g.get(),e.direction),a(g.get(),t,e.origin));return s(n,n)}function T(e,t,n){let r=s(e.direction,a(n,t,e.origin));return f(n,e.origin,p(n,e.direction,r)),n}function E(e,r,i,a){let o=e.origin,m=r.origin,h=e.direction,g=r.direction,_=s(c(k,h),c(A,g));if(Math.abs(_)>=1)return null;let v=l(k,h,g),y=u(O,m,o),b=t(j,h[0],h[1],h[2],-g[0],-g[1],-g[2],v[0],v[1],v[2]),x=n(j,b);if(x==null)return[i,a];let S=s(d(k,x[0],x[3],x[6]),y),C=s(d(A,x[1],x[4],x[7]),y);return f(i,o,p(O,h,S)),f(a,m,p(O,g,C)),[i,a]}const D=new e(()=>_()),O=h(),k=h(),A=h(),j=r();export{T as closestPoint,E as closestPoints,x as copy,_ as create,w as distance2,y as equals,S as fromPoints,C as fromValues,b as wrap};
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.
|
|
2
|
+
import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.162`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
|