@arcgis/core 4.28.0-next.20230621 → 4.28.0-next.20230623
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/Basemap.js +1 -1
- package/arcade/ArcadeModuleResolver.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeTimeUtils.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0380e9f61b6f3ca85139.js +1 -0
- package/assets/esri/core/workers/chunks/0bd95f46a0a9005a19f9.js +1 -0
- package/assets/esri/core/workers/chunks/0c621046b7211cdde980.js +1 -0
- package/assets/esri/core/workers/chunks/0e0267739728e5413f1d.js +1 -0
- package/assets/esri/core/workers/chunks/{39079bcfd35ed73c4e34.js → 156e801a3262f0ac79c0.js} +1 -1
- package/assets/esri/core/workers/chunks/19b4f02fb2392d964582.js +1 -0
- package/assets/esri/core/workers/chunks/1ae75f5282e983f6d768.js +1 -0
- package/assets/esri/core/workers/chunks/2179b3e9e532ca8ef982.js +1 -0
- package/assets/esri/core/workers/chunks/21aaa7fa0e5482670010.js +1 -0
- package/assets/esri/core/workers/chunks/26212a08ea383547335b.js +1 -0
- package/assets/esri/core/workers/chunks/{2420ec029236ab31d908.js → 2882a55a971af1f7858b.js} +1 -1
- package/assets/esri/core/workers/chunks/294285f2822c101326ec.js +1 -0
- package/assets/esri/core/workers/chunks/29f9a380610e4fd98a7c.js +1 -0
- package/assets/esri/core/workers/chunks/303238fc2fcdbb277981.js +1 -0
- package/assets/esri/core/workers/chunks/{3db8ae98799c752afe60.js → 34958516e604d487c625.js} +1 -1
- package/assets/esri/core/workers/chunks/3bee743f4c9370045a5d.js +1 -0
- package/assets/esri/core/workers/chunks/{8e08968505483dc58e00.js → 40ee4e0a5000a08c3abd.js} +1 -1
- package/assets/esri/core/workers/chunks/4128e45e17c9e5280e11.js +1 -0
- package/assets/esri/core/workers/chunks/4f88c4d1d2103843aca8.js +1 -0
- package/assets/esri/core/workers/chunks/505792ce8cbbddd2e815.js +1 -0
- package/assets/esri/core/workers/chunks/{3d42fa4ab5f8632d690a.js → 5237b3938be0d4bc6045.js} +1 -1
- package/assets/esri/core/workers/chunks/{57077e608f20d3a931e8.js → 570e94f4fbefc856d303.js} +1 -1
- package/assets/esri/core/workers/chunks/{4b235d1b6a72773cd4f4.js → 57bb8516fa998a0fba78.js} +1 -1
- package/assets/esri/core/workers/chunks/57bf3ff01d738cedc292.js +1 -0
- package/assets/esri/core/workers/chunks/{1e9e68312cd865358260.js → 60486acc5dacf73f851a.js} +1 -1
- package/assets/esri/core/workers/chunks/6208f2dfa9dfd3bca000.js +1 -0
- package/assets/esri/core/workers/chunks/64008bde5d3ffd9f2499.js +1 -0
- package/assets/esri/core/workers/chunks/69f51a7768bf51c9e346.js +1 -0
- package/assets/esri/core/workers/chunks/719f741a0e45c3e694ba.js +1 -0
- package/assets/esri/core/workers/chunks/{cfe379a78a983373b3ac.js → 7304f45f5622a68253e4.js} +1 -1
- package/assets/esri/core/workers/chunks/733b70d6e5c466a67e9c.js +1 -0
- package/assets/esri/core/workers/chunks/7694521b44681d52b713.js +1 -0
- package/assets/esri/core/workers/chunks/840fd05ceaa038c476d6.js +1 -0
- package/assets/esri/core/workers/chunks/89f7fd2ab92aa14fe0c0.js +1 -0
- package/assets/esri/core/workers/chunks/8a6f29f2ebd59783bb1b.js +1 -0
- package/assets/esri/core/workers/chunks/9d487b7817ccf5bceff6.js +1 -0
- package/assets/esri/core/workers/chunks/{42b6315e21c4c1345ba5.js → 9f5337a80963e0b3c009.js} +1 -1
- package/assets/esri/core/workers/chunks/a0face18b3ea567999ef.js +1 -0
- package/assets/esri/core/workers/chunks/b773c8854e98384ac8ac.js +1 -0
- package/assets/esri/core/workers/chunks/{fb44d872b9dbadcf8ccf.js → b9ef05c22bc3e395bcb3.js} +1 -1
- package/assets/esri/core/workers/chunks/bc5e34200776cfc83d5b.js +1 -0
- package/assets/esri/core/workers/chunks/{cfc3dcca2b69d20d5375.js → c0b9cc091efd5db827de.js} +1 -1
- package/assets/esri/core/workers/chunks/c9f5e949830196ad9458.js +1 -0
- package/assets/esri/core/workers/chunks/{036301f545aba2b8e485.js → cc15e28a99694120556d.js} +1 -1
- package/assets/esri/core/workers/chunks/ce7f575a6c2053c7ca17.js +1 -0
- package/assets/esri/core/workers/chunks/ce9c99cee3d1a3963e7c.js +1 -0
- package/assets/esri/core/workers/chunks/cf9a87b53ea74bae6a37.js +1 -0
- package/assets/esri/core/workers/chunks/d16850b98a53ade0de10.js +1 -0
- package/assets/esri/core/workers/chunks/d24f7ef6eca8c91b90b4.js +1 -0
- package/assets/esri/core/workers/chunks/dbd86e4b7983873cbe7c.js +1 -0
- package/assets/esri/core/workers/chunks/{3c3f65913006b84b2289.js → de20572d334abd4a7d82.js} +1 -1
- package/assets/esri/core/workers/chunks/e009e7f074a572894f48.js +1 -0
- package/assets/esri/core/workers/chunks/{cb004c492e22c50f9bfa.js → f3eb89cff63e00f036c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2a423d9ce8bb784267c.js → f53f20c7100092823487.js} +1 -1
- package/assets/esri/core/workers/chunks/f6040205c50e2795a1a0.js +1 -0
- package/assets/esri/core/workers/chunks/{915734255a79bff3ef0f.js → fcd54e9e64c2864f183c.js} +1 -1
- package/assets/esri/t9n/common.json +1 -1
- package/assets/esri/t9n/common_en.json +1 -1
- package/assets/esri/themes/base/_core.scss +6 -2
- package/assets/esri/themes/base/_mixins.scss +0 -147
- package/assets/esri/themes/base/widgets/_AreaMeasurement2D.scss +0 -8
- package/assets/esri/themes/base/widgets/_AreaMeasurement3D.scss +0 -8
- package/assets/esri/themes/base/widgets/_DirectLineMeasurement3D.scss +0 -1
- package/assets/esri/themes/base/widgets/_DistanceMeasurement2D.scss +0 -1
- package/assets/esri/themes/base/widgets/_MeasurementWidgetContent.scss +67 -0
- package/assets/esri/themes/base/widgets/_Slice.scss +17 -54
- package/assets/esri/themes/base/widgets/_UnitSelect.scss +14 -0
- 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/assets/esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D.json +1 -1
- package/assets/esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D_en.json +1 -1
- package/assets/esri/widgets/AreaMeasurement3D/t9n/AreaMeasurement3D.json +1 -1
- package/assets/esri/widgets/AreaMeasurement3D/t9n/AreaMeasurement3D_en.json +1 -1
- package/assets/esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D.json +1 -1
- package/assets/esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D_en.json +1 -1
- package/assets/esri/widgets/DistanceMeasurement2D/t9n/DistanceMeasurement2D.json +1 -1
- package/assets/esri/widgets/DistanceMeasurement2D/t9n/DistanceMeasurement2D_en.json +1 -1
- package/chunks/HUDMaterial.glsl.js +39 -39
- package/chunks/HighlightBlur.glsl.js +2 -2
- package/chunks/ShadowHighlight.glsl.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/core/HandleOwner.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/support/{WatchUpdatingTracking.js → UpdatingHandles.js} +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/geometry/projection.js +1 -1
- package/interfaces.d.ts +270 -5
- package/kernel.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.d.ts +4 -0
- package/layers/LinkChartLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/support/TileInfoTilemapCache.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/sources/DataTileSource.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/labelPlacement.js +1 -1
- package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/SceneViewPerformanceInfo.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +6 -7
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/I3SSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/overlay/ViewOverlay.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm/FormExpressionArcadeExecutor.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +5 -0
- package/widgets/support/UnitSelect.js +5 -0
- package/assets/esri/core/workers/chunks/0254165377538522c830.js +0 -1
- package/assets/esri/core/workers/chunks/07f16ea775b39a1a4a7b.js +0 -1
- package/assets/esri/core/workers/chunks/170c72126d10b1fdb2b0.js +0 -1
- package/assets/esri/core/workers/chunks/1bbc868d2430103951eb.js +0 -1
- package/assets/esri/core/workers/chunks/1d2ef88a8d028adef102.js +0 -1
- package/assets/esri/core/workers/chunks/2ef70c9b2484a11b7435.js +0 -1
- package/assets/esri/core/workers/chunks/39ae4b9b766f674bc6f2.js +0 -1
- package/assets/esri/core/workers/chunks/3b3d676b609c47a77164.js +0 -1
- package/assets/esri/core/workers/chunks/3d9a8cb638cf9b8ca4b3.js +0 -1
- package/assets/esri/core/workers/chunks/42f3421740a5479559dc.js +0 -1
- package/assets/esri/core/workers/chunks/45629ff775e77234b227.js +0 -1
- package/assets/esri/core/workers/chunks/52315f93a6f0ad59bd90.js +0 -1
- package/assets/esri/core/workers/chunks/5bb96e602d7cecbecf54.js +0 -1
- package/assets/esri/core/workers/chunks/63322229183f1d4eaa70.js +0 -1
- package/assets/esri/core/workers/chunks/642510b0371311ff8e16.js +0 -1
- package/assets/esri/core/workers/chunks/6995ace1d25d67c98d0e.js +0 -1
- package/assets/esri/core/workers/chunks/7e4013f8c31c9a9438c6.js +0 -1
- package/assets/esri/core/workers/chunks/82939ead43848a13f765.js +0 -1
- package/assets/esri/core/workers/chunks/8b6b963230df56850580.js +0 -1
- package/assets/esri/core/workers/chunks/95ff92d7caa34664d58f.js +0 -1
- package/assets/esri/core/workers/chunks/9e570cd4a48c30c83ae6.js +0 -1
- package/assets/esri/core/workers/chunks/a9e9297267614c4c4f3b.js +0 -1
- package/assets/esri/core/workers/chunks/b052463ffb7cb32306dc.js +0 -1
- package/assets/esri/core/workers/chunks/b31974524932e638df8c.js +0 -1
- package/assets/esri/core/workers/chunks/b75b4b132dbd9cb9d372.js +0 -1
- package/assets/esri/core/workers/chunks/c1dfbda75abc748a6ca4.js +0 -1
- package/assets/esri/core/workers/chunks/c8702e53a8ad6cf6ab85.js +0 -1
- package/assets/esri/core/workers/chunks/c90416e7bf29eb1d4536.js +0 -1
- package/assets/esri/core/workers/chunks/cad7a2092ea7f51dbd8b.js +0 -1
- package/assets/esri/core/workers/chunks/d0e2b42dca51711f2c6f.js +0 -1
- package/assets/esri/core/workers/chunks/d2a127f7bb0e2ba14a13.js +0 -1
- package/assets/esri/core/workers/chunks/df96824a6f76bad1370c.js +0 -1
- package/assets/esri/core/workers/chunks/e097f41bbfac00250477.js +0 -1
- package/assets/esri/core/workers/chunks/e3243d120a23a9b48392.js +0 -1
- package/assets/esri/core/workers/chunks/e55f80b774e090a0aa04.js +0 -1
- package/assets/esri/core/workers/chunks/e668c7e2e61aae6ca6e0.js +0 -1
- package/assets/esri/core/workers/chunks/ef900614353505afb210.js +0 -1
- package/assets/esri/core/workers/chunks/f0299d93a95f40ea7cf7.js +0 -1
- package/assets/esri/core/workers/chunks/f23b95d7e51a144ad065.js +0 -1
- package/assets/esri/core/workers/chunks/f263e73a25fae4beffae.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{result as i}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import has from"../../../core/has.js";import s from"../../../core/Error.js";import{clone as a}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{destroyMaybe as n,removeMaybe as o,abortMaybe as h}from"../../../core/maybe.js";import{EsriPromiseMixin as c}from"../../../core/Promise.js";import{createAbortError as u,isAbortError as d,eachAlways as m}from"../../../core/promiseUtils.js";import{initial as p,whenOnce as _,watch as f,syncAndInitial as y,sync as g}from"../../../core/reactiveUtils.js";import{property as x}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as F}from"../../../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as v}from"../../../core/support/WatchUpdatingTracking.js";import{isHostedAgolService as T}from"../../support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as E}from"../../support/layerUtils.js";import{projectGeometry as w}from"../../../portal/support/geometryServiceUtils.js";import C from"../../../rest/support/StatisticDefinition.js";import{FeatureTileFetcher3D as b}from"../../../views/3d/layers/support/FeatureTileFetcher3D.js";import{FeatureTileFetcher3DDebugger as D}from"../../../views/3d/layers/support/FeatureTileFetcher3DDebugger.js";import S from"../../../views/3d/support/debugFlags.js";let O=class extends(c(t)){set extent(e){if(null!=e&&!e.spatialReference.equals(this.layerView.view.spatialReference))return void l.getLogger(this).error("#extent=","extent needs to be in the same spatial reference as the view");const t=this._get("extent");if(t===e)return;if(null!=t&&e&&t.equals(e))return;const i=null!=e?e.clone():null;this._set("extent",i)}get updating(){return!!(null!=this._tileFetcher&&this._tileFetcher.updating||null!=this._fetchDataInfoPromise||"tiles"===this.mode&&this.layerView.view.featureTiles&&this.layerView.view.featureTiles.updating||this._watchUpdatingTracking&&this._watchUpdatingTracking.updating)}get updatingTotal(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.expectedFeatureDiff:0}get memoryForUnusedFeatures(){return null!=this._tileFetcher?this._tileFetcher.memoryForUnusedFeatures:0}get maximumNumberOfFeaturesExceeded(){return!(null==this._tileFetcher||!this._tileFetcher.maximumNumberOfFeaturesExceeded)}get maximumNumberOfFeatures(){return null!=this.displayFeatureLimit?this.displayFeatureLimit.maximumNumberOfFeatures:0}set maximumNumberOfFeatures(e){e!==this.maximumNumberOfFeatures&&this._overrideIfSome("maximumNumberOfFeatures",e)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden("maximumNumberOfFeatures")}get mode(){const e=this.layerView.layer;if("feature"===e.type&&null!=e.infoFor3D)return"snapshot";if(!1===this.layerView.view.qualitySettings?.graphics3D?.snapshotAvailable||this.serviceDataCount===L.NO_SERVICE_DATA_COUNT||this.vertexLimitExceeded)return"tiles";const t=this.layerView.view,i=t&&t.featureTiles,r=i&&i.tilingScheme;if(e&&e.minScale&&this.serviceDataExtent&&r){const t=this._approximateExtentSizeAtScale(e.minScale,r);if((this.serviceDataExtent.width/t+this.serviceDataExtent.height/t)/2>L.MAX_SNAPSHOT_MIN_SCALE_FACTOR)return"tiles"}return!this.maximumNumberOfFeatures||this.serviceDataCount<=this.maximumNumberOfFeatures?"snapshot":"tiles"}get maxTotalSnapshotVertices(){const e=this._get("maxTotalSnapshotVertices")||0,t="snapshot"===this.mode&&null!=this._tileFetcher&&this._tileFetcher.totalVertices||0;return Math.max(e,t)}_approximateExtentSizeAtScale(e,t){const i=this.layerView.view,r=Math.ceil((i.width/t.pixelSize+i.height/t.pixelSize)/2),s=t.levels[0];return r*((s.tileSize[0]/(s.scale/e)+s.tileSize[1]/(s.scale/e))/2)}get tileDescriptors(){return"snapshot"===this.mode?new r([{id:"dummy-tile-full-extent",lij:[0,0,0]}]):this.layerView.view.featureTiles?this.layerView.view.featureTiles.tiles:new r}get test(){return{fetchDataInfoPromise:this._fetchDataInfoPromise,tileFetcher:this._tileFetcher}}constructor(e){super(e),this.type="feature-tile-3d",this._watchUpdatingTracking=new v,this.serviceDataExtent=null,this.serviceDataCount=L.NO_SERVICE_DATA_COUNT,this.vertexLimitExceeded=!1,this.displayFeatureLimit=null,this._suspended=!1,this._tileFetcher=null,this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null,this._lifeCycleAbortController=new AbortController}initialize(){this._watchUpdatingTracking.add((()=>this.vertexLimitInfo),(()=>this._watchUpdatingTracking.addPromise(this._updateVertexLimitExceeded(null,this._lifeCycleAbortController.signal)))),this._watchUpdatingTracking.add((()=>this.mode),(()=>this._modeChanged()),p),this.addResolvingPromise(Promise.resolve().then((()=>this._verifyCapabilities())).then((()=>this._watchUpdatingTracking.addPromise(this._fetchServiceDataInfo()))).then((()=>this._initializeTileFetcher())))}_verifyCapabilities(){const e=this.layerView.layer;if("ogc-feature"!==e.type&&!E(e)?.operations.supportsQuery)throw new s("graphicscontroller:query-capability-required","Service requires query capabilities to be used as a feature layer",{layer:e})}destroy(){this._cancelFetchServiceDataInfo(),this._tileFetcher=n(this._tileFetcher),this._tilesHandle=o(this._tilesHandle),this._lifeCycleAbortController=h(this._lifeCycleAbortController),this._watchUpdatingTracking.destroy(),this._set("_watchUpdatingTracking",null)}suspend(){this._suspended||(this._suspended=!0,null!=this._tileFetcher&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,null!=this._tileFetcher&&this._tileFetcher.resume())}restart(){const e=()=>{null!=this._tileFetcher&&this._tileFetcher.restart()};this._watchUpdatingTracking.addPromise(this._fetchServiceDataInfo().then(e,e))}refetch(){const e=()=>{null!=this._tileFetcher&&this._tileFetcher.refetch()};this._watchUpdatingTracking.addPromise(this._fetchServiceDataInfo().then(e,e))}_initializeTileFetcher(){const e=this.layerView.view;if(!e)return;const t=_((()=>e.featureTiles?.tilingScheme),this._lifeCycleAbortController.signal);this._watchUpdatingTracking.addPromise(t),t.then((()=>{const{layerView:t,tileDescriptors:i}=this,r=t.layer,s=new b({context:this.context,filterExtent:this.extent,tileDescriptors:i,features:this.graphics});this._tileFetcher=s,this._suspended?this._tileFetcher.suspend():this._tileFetcher.resume();const a=this.layerView.view.resourceController;a&&this.addHandles(f((()=>a.memoryController?.memoryFactor),(e=>s.memoryFactor=e),y));const l="polygon"===this.context.geometryType?"polygonLodFactor":"polyline"===this.context.geometryType?"polylineLodFactor":null;l&&this.addHandles(f((()=>this.layerView.view?.qualitySettings?.graphics3D?.[l]),(e=>s.lodFactor=e||1),p));const n=e=>{s.maximumNumberOfFeatures=e,s.useTileCount=this.serviceDataCount>e},o=e=>s.useTileCount=e>this.maximumNumberOfFeatures;"ogc-feature"!==r.type&&this._watchUpdatingTracking.add((()=>r.createQueryVersion),(()=>this._dataFilterChanged())),this._watchUpdatingTracking.add((()=>t.availableFields),((e,t)=>this._availableFieldsChanged(t,e))),this._watchUpdatingTracking.add((()=>t.requiredFields),((e,t)=>this._requiredFieldsChanged(t,e))),this.addHandles([r.on("apply-edits",(e=>this._applyEdits(e))),f((()=>this.extent),(e=>s.filterExtent=e),g),f((()=>this.tileDescriptors),(e=>s.tileDescriptors=e),g),f((()=>this.maximumNumberOfFeatures),n,y),f((()=>this.serviceDataCount),o,y),f((()=>S.FEATURE_TILE_FETCH_SHOW_TILES),(t=>{t&&s&&!s.debugger?(s.debugger=new D(s,e.featureTiles.tilingScheme.toTileInfo(),e),s.debugger.update()):!t&&this._tileFetcher&&s.debugger&&(s.debugger.destroy(),s.debugger=null)}),y)]),this._supportsExceedsLimitQuery||this._watchUpdatingTracking.add((()=>this.maxTotalSnapshotVertices),(()=>this._watchUpdatingTracking.addPromise(this._updateVertexLimitExceeded(null,this._lifeCycleAbortController.signal))))})).catch((()=>{}))}_modeChanged(){switch(this.mode){case"tiles":this._tilesHandle||(this._tilesHandle=this.layerView.view.featureTiles.addClient());break;default:l.getLogger(this).warn("Unhandled feature layer mode "+this.mode);case"snapshot":null!=this._tilesHandle&&(this._tilesHandle.remove(),this._tilesHandle=null)}}_dataFilterChanged(){this._set("maxTotalSnapshotVertices",0),this.notifyChange("maxTotalSnapshotVertices"),this.refetch()}_applyEdits(e){null!=this._tileFetcher&&this._tileFetcher.applyEdits(e).then((e=>{if(e){if(!this._lifeCycleAbortController)throw u();e.exceededTransferLimit?this.layerView.layer.refresh():(e.deletedFeatures.length||e.updatedFeatures.length||e.addedFeatures.length)&&this._watchUpdatingTracking.addPromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}})).catch((e=>{if(!d(e))throw e}))}_availableFieldsChanged(e,t){null!=this._tileFetcher&&N(this._tileFetcher.availableFields,t)&&this.refetch()}_requiredFieldsChanged(e,t){null!=this._tileFetcher&&N(this._tileFetcher.availableFields,t)&&this.restart()}_createVertexLimitExceededQuery(e){const t=this.layerView.layer,i=t.createQuery();return i.returnGeometry=!1,i.outStatistics=[new C({statisticType:"exceedslimit",maxVertexCount:e,outStatisticFieldName:"exceedslimit",maxPointCount:1e8,maxRecordCount:1e8})],t.capabilities?.query.supportsCacheHint&&(i.cacheHint=!0),i}_createDataInfoQuery(){const e=this.layerView.layer,t=e.createQuery();return t.returnGeometry=!1,t.outSpatialReference=this.layerView.view.spatialReference,e.capabilities?.query.supportsCacheHint&&(t.cacheHint=!0),t}_fullExtentIsAccurate(){const e=this.layerView.layer;if(e.definitionExpression)return!1;switch(e.type){case"feature":case"oriented-imagery":return T(e.url);case"csv":case"geojson":case"ogc-feature":case"wfs":return!0;default:return}}async _updateServiceDataExtent(e){try{await this._tryUpdateServiceDataExtent(e)}catch(t){d(t)||this._set("serviceDataExtent",a(this.layerView.fullExtentInLocalViewSpatialReference))}}async _tryUpdateServiceDataExtent(e){const t=this.layerView,i=t.layer,r=i.capabilities?.query.supportsExtent??!1,s=a(t.fullExtentInLocalViewSpatialReference),l=i.fullExtent,n=this._fullExtentIsAccurate(),o=this.serviceDataCount;if(r&&o<=L.MAX_FEATURE_COUNT_FOR_EXTENT&&(!s||!n)&&"queryExtent"in i){const t=this._createDataInfoQuery(),r=await i.queryExtent(t,{timeout:L.QUERY_EXTENT_TIMEOUT,signal:e});this._set("serviceDataExtent",r.extent)}else if(s)this._set("serviceDataExtent",s);else if(null!=l){const r="portalItem"in i?i.portalItem:null,s=await w(l,t.view.spatialReference,r,e);this._set("serviceDataExtent",s)}else this._set("serviceDataExtent",null)}async _updateServiceDataCount(e){const t=this.layerView.layer;if(!("queryFeatureCount"in t)||!has("featurelayer-snapshot-enabled"))return void this._set("serviceDataCount",L.NO_SERVICE_DATA_COUNT);const r=await i(t.queryFeatureCount(this._createDataInfoQuery(),{timeout:L.QUERY_STATISTICS_TIMEOUT,signal:e}));if(!0===r.ok)this._set("serviceDataCount",r.value);else{if(d(r.error))throw r.error;this._set("serviceDataCount",L.NO_SERVICE_DATA_COUNT)}}get vertexLimitInfo(){if(null==this.displayFeatureLimit||null==this.displayFeatureLimit.averageSymbolComplexity)return null;const{averageSymbolComplexity:e,maximumTotalNumberOfPrimitives:t}=this.displayFeatureLimit,{primitivesPerCoordinate:i,primitivesPerFeature:r}=e,s=this._get("vertexLimitInfo");return null==s||s.maximumTotalNumberOfPrimitives!==t||s.primitivesPerCoordinate!==i||s.primitivesPerFeature!==r?{primitivesPerCoordinate:i,primitivesPerFeature:r,maximumTotalNumberOfPrimitives:t}:s}get _supportsExceedsLimitQuery(){const e=this.layerView.layer;return null!=e.capabilities&&e.capabilities.operations&&e.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case"point":case"multipoint":return 1;case"polygon":return 4;case"polyline":return 2;case"multipatch":case"mesh":return 3;default:return 0}}async _updateVertexLimitExceeded(e,t){const r=this.vertexLimitInfo;if(null==r)return void this._set("vertexLimitExceeded",!1);const s=r.primitivesPerFeature<=0,a=this._minimumNumberOfVerticesForGeometry>1;if(!s&&!a)return void this._set("vertexLimitExceeded",!1);const{primitivesPerFeature:l,primitivesPerCoordinate:n,maximumTotalNumberOfPrimitives:o}=r;let h;0!==l&&null!=e&&await e;const c=this.serviceDataCount,u=c!==L.NO_SERVICE_DATA_COUNT;if(h=u?Math.ceil((o-c*l)/(n||1)):Math.ceil(o/(n||1)),a&&(h=Math.min(h,A)),u&&this._minimumNumberOfVerticesForGeometry*c>h)return void this._set("vertexLimitExceeded",!0);if(!this._supportsExceedsLimitQuery||!has("featurelayer-snapshot-enabled"))return void this._set("vertexLimitExceeded",this.maxTotalSnapshotVertices>h);const m=await i(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(h),{timeout:L.QUERY_STATISTICS_TIMEOUT,signal:t}));if(!1===m.ok){if(d(m.error))throw m.error;return void this._set("vertexLimitExceeded",!1)}const p=m.value.features[0];p&&p.attributes?this._set("vertexLimitExceeded",!!p.attributes.exceedslimit):this._set("vertexLimitExceeded",!1)}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo();let e=new AbortController;const t=e.signal,i=this._updateServiceDataCount(t),r=m([i,this._updateVertexLimitExceeded(i,t)]),s=r.then((()=>this._updateServiceDataExtent(t))).catch((e=>{d(e)||l.getLogger(this).error("#fetchServiceDataInfo()",e)})).then((()=>{s===this._fetchDataInfoPromise&&(this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null),e=null}));return e&&(this._fetchDataInfoPromise=s),this._fetchDataInfoAbortController=e,r.then((()=>{}),(()=>{}))}_cancelFetchServiceDataInfo(){const e=this._fetchDataInfoAbortController;e&&(this._fetchDataInfoAbortController=null,this._fetchDataInfoPromise=null,e.abort())}get debug(){return{storedFeatures:null!=this._tileFetcher?this._tileFetcher.storedFeatures:0,totalFeatures:null!=this._tileFetcher?this._tileFetcher.totalFeatures:0,totalVertices:null!=this._tileFetcher?this._tileFetcher.totalVertices:0,missingTiles:null!=this._tileFetcher?this._tileFetcher.missingTiles:0}}};e([x({readOnly:!0})],O.prototype,"type",void 0),e([x({constructOnly:!0})],O.prototype,"graphics",void 0),e([x({constructOnly:!0})],O.prototype,"layerView",void 0),e([x({constructOnly:!0})],O.prototype,"context",void 0),e([x()],O.prototype,"extent",null),e([x()],O.prototype,"updating",null),e([x({readOnly:!0})],O.prototype,"_watchUpdatingTracking",void 0),e([x()],O.prototype,"updatingTotal",null),e([x()],O.prototype,"updatingRemaining",null),e([x()],O.prototype,"expectedFeatureDiff",null),e([x()],O.prototype,"memoryForUnusedFeatures",null),e([x()],O.prototype,"maximumNumberOfFeaturesExceeded",null),e([x({readOnly:!0})],O.prototype,"serviceDataExtent",void 0),e([x({readOnly:!0})],O.prototype,"serviceDataCount",void 0),e([x({readOnly:!0})],O.prototype,"vertexLimitExceeded",void 0),e([x()],O.prototype,"displayFeatureLimit",void 0),e([x({type:Number})],O.prototype,"maximumNumberOfFeatures",null),e([x({readOnly:!0})],O.prototype,"mode",null),e([x({readOnly:!0})],O.prototype,"maxTotalSnapshotVertices",null),e([x({readOnly:!0,dependsOn:["mode"]})],O.prototype,"tileDescriptors",null),e([x()],O.prototype,"_tileFetcher",void 0),e([x()],O.prototype,"_fetchDataInfoPromise",void 0),e([x({readOnly:!0})],O.prototype,"vertexLimitInfo",null),O=e([F("esri.layers.graphics.controllers.FeatureTileController3D")],O);const I=1e4,V=12e3,U=1e4,A=5e6;function N(e,t){if(!t)return!1;for(const i of t)if(!e.has(i))return!0;return!1}var L;!function(e){function t(){e.MAX_FEATURE_COUNT_FOR_EXTENT=I,e.QUERY_STATISTICS_TIMEOUT=V,e.QUERY_EXTENT_TIMEOUT=U}e.NO_SERVICE_DATA_COUNT=1/0,e.MAX_SNAPSHOT_MIN_SCALE_FACTOR=5,e.reset=t}(L||(L={})),L.reset();export{O as FeatureTileController3D,L as FeatureTileController3DConstants};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{result as i}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import has from"../../../core/has.js";import s from"../../../core/Error.js";import{clone as a}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{destroyMaybe as n,removeMaybe as o,abortMaybe as u}from"../../../core/maybe.js";import{EsriPromiseMixin as h}from"../../../core/Promise.js";import{createAbortError as c,isAbortError as d,eachAlways as m}from"../../../core/promiseUtils.js";import{initial as p,whenOnce as _,watch as f,syncAndInitial as y,sync as g}from"../../../core/reactiveUtils.js";import{property as x}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as F}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../../core/support/UpdatingHandles.js";import{isHostedAgolService as E}from"../../support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as C}from"../../support/layerUtils.js";import{projectGeometry as T}from"../../../portal/support/geometryServiceUtils.js";import b from"../../../rest/support/StatisticDefinition.js";import{FeatureTileFetcher3D as D}from"../../../views/3d/layers/support/FeatureTileFetcher3D.js";import{FeatureTileFetcher3DDebugger as S}from"../../../views/3d/layers/support/FeatureTileFetcher3DDebugger.js";import w from"../../../views/3d/support/debugFlags.js";let O=class extends(h(t)){set extent(e){if(null!=e&&!e.spatialReference.equals(this.layerView.view.spatialReference))return void l.getLogger(this).error("#extent=","extent needs to be in the same spatial reference as the view");const t=this._get("extent");if(t===e)return;if(null!=t&&e&&t.equals(e))return;const i=null!=e?e.clone():null;this._set("extent",i)}get updating(){return!!(null!=this._tileFetcher&&this._tileFetcher.updating||null!=this._fetchDataInfoPromise||"tiles"===this.mode&&this.layerView.view.featureTiles&&this.layerView.view.featureTiles.updating||this._updatingHandles&&this._updatingHandles.updating)}get updatingTotal(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.expectedFeatureDiff:0}get memoryForUnusedFeatures(){return null!=this._tileFetcher?this._tileFetcher.memoryForUnusedFeatures:0}get maximumNumberOfFeaturesExceeded(){return!(null==this._tileFetcher||!this._tileFetcher.maximumNumberOfFeaturesExceeded)}get maximumNumberOfFeatures(){return null!=this.displayFeatureLimit?this.displayFeatureLimit.maximumNumberOfFeatures:0}set maximumNumberOfFeatures(e){e!==this.maximumNumberOfFeatures&&this._overrideIfSome("maximumNumberOfFeatures",e)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden("maximumNumberOfFeatures")}get mode(){const e=this.layerView.layer;if("feature"===e.type&&null!=e.infoFor3D)return"snapshot";if(!1===this.layerView.view.qualitySettings?.graphics3D?.snapshotAvailable||this.serviceDataCount===H.NO_SERVICE_DATA_COUNT||this.vertexLimitExceeded)return"tiles";const t=this.layerView.view,i=t&&t.featureTiles,r=i&&i.tilingScheme;if(e&&e.minScale&&this.serviceDataExtent&&r){const t=this._approximateExtentSizeAtScale(e.minScale,r);if((this.serviceDataExtent.width/t+this.serviceDataExtent.height/t)/2>H.MAX_SNAPSHOT_MIN_SCALE_FACTOR)return"tiles"}return!this.maximumNumberOfFeatures||this.serviceDataCount<=this.maximumNumberOfFeatures?"snapshot":"tiles"}get maxTotalSnapshotVertices(){const e=this._get("maxTotalSnapshotVertices")||0,t="snapshot"===this.mode&&null!=this._tileFetcher&&this._tileFetcher.totalVertices||0;return Math.max(e,t)}_approximateExtentSizeAtScale(e,t){const i=this.layerView.view,r=Math.ceil((i.width/t.pixelSize+i.height/t.pixelSize)/2),s=t.levels[0];return r*((s.tileSize[0]/(s.scale/e)+s.tileSize[1]/(s.scale/e))/2)}get tileDescriptors(){return"snapshot"===this.mode?new r([{id:"dummy-tile-full-extent",lij:[0,0,0]}]):this.layerView.view.featureTiles?this.layerView.view.featureTiles.tiles:new r}get test(){return{fetchDataInfoPromise:this._fetchDataInfoPromise,tileFetcher:this._tileFetcher}}constructor(e){super(e),this.type="feature-tile-3d",this._updatingHandles=new v,this.serviceDataExtent=null,this.serviceDataCount=H.NO_SERVICE_DATA_COUNT,this.vertexLimitExceeded=!1,this.displayFeatureLimit=null,this._suspended=!1,this._tileFetcher=null,this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null,this._lifeCycleAbortController=new AbortController}initialize(){this._updatingHandles.add((()=>this.vertexLimitInfo),(()=>this._updatingHandles.addPromise(this._updateVertexLimitExceeded(null,this._lifeCycleAbortController.signal)))),this._updatingHandles.add((()=>this.mode),(()=>this._modeChanged()),p),this.addResolvingPromise(Promise.resolve().then((()=>this._verifyCapabilities())).then((()=>this._updatingHandles.addPromise(this._fetchServiceDataInfo()))).then((()=>this._initializeTileFetcher())))}_verifyCapabilities(){const e=this.layerView.layer;if("ogc-feature"!==e.type&&!C(e)?.operations.supportsQuery)throw new s("graphicscontroller:query-capability-required","Service requires query capabilities to be used as a feature layer",{layer:e})}destroy(){this._cancelFetchServiceDataInfo(),this._tileFetcher=n(this._tileFetcher),this._tilesHandle=o(this._tilesHandle),this._lifeCycleAbortController=u(this._lifeCycleAbortController),this._updatingHandles.destroy(),this._set("_updatingHandles",null)}suspend(){this._suspended||(this._suspended=!0,null!=this._tileFetcher&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,null!=this._tileFetcher&&this._tileFetcher.resume())}restart(){const e=()=>{null!=this._tileFetcher&&this._tileFetcher.restart()};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(e,e))}refetch(){const e=()=>{null!=this._tileFetcher&&this._tileFetcher.refetch()};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(e,e))}_initializeTileFetcher(){const e=this.layerView.view;if(!e)return;const t=_((()=>e.featureTiles?.tilingScheme),this._lifeCycleAbortController.signal);this._updatingHandles.addPromise(t),t.then((()=>{const{layerView:t,tileDescriptors:i}=this,r=t.layer,s=new D({context:this.context,filterExtent:this.extent,tileDescriptors:i,features:this.graphics});this._tileFetcher=s,this._suspended?this._tileFetcher.suspend():this._tileFetcher.resume();const a=this.layerView.view.resourceController;a&&this.addHandles(f((()=>a.memoryController?.memoryFactor),(e=>s.memoryFactor=e),y));const l="polygon"===this.context.geometryType?"polygonLodFactor":"polyline"===this.context.geometryType?"polylineLodFactor":null;l&&this.addHandles(f((()=>this.layerView.view?.qualitySettings?.graphics3D?.[l]),(e=>s.lodFactor=e||1),p));const n=e=>{s.maximumNumberOfFeatures=e,s.useTileCount=this.serviceDataCount>e},o=e=>s.useTileCount=e>this.maximumNumberOfFeatures;"ogc-feature"!==r.type&&this._updatingHandles.add((()=>r.createQueryVersion),(()=>this._dataFilterChanged())),this._updatingHandles.add((()=>t.availableFields),((e,t)=>this._availableFieldsChanged(t,e))),this._updatingHandles.add((()=>t.requiredFields),((e,t)=>this._requiredFieldsChanged(t,e))),this.addHandles([r.on("apply-edits",(e=>this._applyEdits(e))),f((()=>this.extent),(e=>s.filterExtent=e),g),f((()=>this.tileDescriptors),(e=>s.tileDescriptors=e),g),f((()=>this.maximumNumberOfFeatures),n,y),f((()=>this.serviceDataCount),o,y),f((()=>w.FEATURE_TILE_FETCH_SHOW_TILES),(t=>{t&&s&&!s.debugger?(s.debugger=new S(s,e.featureTiles.tilingScheme.toTileInfo(),e),s.debugger.update()):!t&&this._tileFetcher&&s.debugger&&(s.debugger.destroy(),s.debugger=null)}),y)]),this._supportsExceedsLimitQuery||this._updatingHandles.add((()=>this.maxTotalSnapshotVertices),(()=>this._updatingHandles.addPromise(this._updateVertexLimitExceeded(null,this._lifeCycleAbortController.signal))))})).catch((()=>{}))}_modeChanged(){switch(this.mode){case"tiles":this._tilesHandle||(this._tilesHandle=this.layerView.view.featureTiles.addClient());break;default:l.getLogger(this).warn("Unhandled feature layer mode "+this.mode);case"snapshot":null!=this._tilesHandle&&(this._tilesHandle.remove(),this._tilesHandle=null)}}_dataFilterChanged(){this._set("maxTotalSnapshotVertices",0),this.notifyChange("maxTotalSnapshotVertices"),this.refetch()}_applyEdits(e){null!=this._tileFetcher&&this._tileFetcher.applyEdits(e).then((e=>{if(e){if(!this._lifeCycleAbortController)throw c();e.exceededTransferLimit?this.layerView.layer.refresh():(e.deletedFeatures.length||e.updatedFeatures.length||e.addedFeatures.length)&&this._updatingHandles.addPromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}})).catch((e=>{if(!d(e))throw e}))}_availableFieldsChanged(e,t){null!=this._tileFetcher&&L(this._tileFetcher.availableFields,t)&&this.refetch()}_requiredFieldsChanged(e,t){null!=this._tileFetcher&&L(this._tileFetcher.availableFields,t)&&this.restart()}_createVertexLimitExceededQuery(e){const t=this.layerView.layer,i=t.createQuery();return i.returnGeometry=!1,i.outStatistics=[new b({statisticType:"exceedslimit",maxVertexCount:e,outStatisticFieldName:"exceedslimit",maxPointCount:1e8,maxRecordCount:1e8})],t.capabilities?.query.supportsCacheHint&&(i.cacheHint=!0),i}_createDataInfoQuery(){const e=this.layerView.layer,t=e.createQuery();return t.returnGeometry=!1,t.outSpatialReference=this.layerView.view.spatialReference,e.capabilities?.query.supportsCacheHint&&(t.cacheHint=!0),t}_fullExtentIsAccurate(){const e=this.layerView.layer;if(e.definitionExpression)return!1;switch(e.type){case"feature":case"oriented-imagery":return E(e.url);case"csv":case"geojson":case"ogc-feature":case"wfs":return!0;default:return}}async _updateServiceDataExtent(e){try{await this._tryUpdateServiceDataExtent(e)}catch(t){d(t)||this._set("serviceDataExtent",a(this.layerView.fullExtentInLocalViewSpatialReference))}}async _tryUpdateServiceDataExtent(e){const t=this.layerView,i=t.layer,r=i.capabilities?.query.supportsExtent??!1,s=a(t.fullExtentInLocalViewSpatialReference),l=i.fullExtent,n=this._fullExtentIsAccurate(),o=this.serviceDataCount;if(r&&o<=H.MAX_FEATURE_COUNT_FOR_EXTENT&&(!s||!n)&&"queryExtent"in i){const t=this._createDataInfoQuery(),r=await i.queryExtent(t,{timeout:H.QUERY_EXTENT_TIMEOUT,signal:e});this._set("serviceDataExtent",r.extent)}else if(s)this._set("serviceDataExtent",s);else if(null!=l){const r="portalItem"in i?i.portalItem:null,s=await T(l,t.view.spatialReference,r,e);this._set("serviceDataExtent",s)}else this._set("serviceDataExtent",null)}async _updateServiceDataCount(e){const t=this.layerView.layer;if(!("queryFeatureCount"in t)||!has("featurelayer-snapshot-enabled"))return void this._set("serviceDataCount",H.NO_SERVICE_DATA_COUNT);const r=await i(t.queryFeatureCount(this._createDataInfoQuery(),{timeout:H.QUERY_STATISTICS_TIMEOUT,signal:e}));if(!0===r.ok)this._set("serviceDataCount",r.value);else{if(d(r.error))throw r.error;this._set("serviceDataCount",H.NO_SERVICE_DATA_COUNT)}}get vertexLimitInfo(){if(null==this.displayFeatureLimit||null==this.displayFeatureLimit.averageSymbolComplexity)return null;const{averageSymbolComplexity:e,maximumTotalNumberOfPrimitives:t}=this.displayFeatureLimit,{primitivesPerCoordinate:i,primitivesPerFeature:r}=e,s=this._get("vertexLimitInfo");return null==s||s.maximumTotalNumberOfPrimitives!==t||s.primitivesPerCoordinate!==i||s.primitivesPerFeature!==r?{primitivesPerCoordinate:i,primitivesPerFeature:r,maximumTotalNumberOfPrimitives:t}:s}get _supportsExceedsLimitQuery(){const e=this.layerView.layer;return null!=e.capabilities&&e.capabilities.operations&&e.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case"point":case"multipoint":return 1;case"polygon":return 4;case"polyline":return 2;case"multipatch":case"mesh":return 3;default:return 0}}async _updateVertexLimitExceeded(e,t){const r=this.vertexLimitInfo;if(null==r)return void this._set("vertexLimitExceeded",!1);const s=r.primitivesPerFeature<=0,a=this._minimumNumberOfVerticesForGeometry>1;if(!s&&!a)return void this._set("vertexLimitExceeded",!1);const{primitivesPerFeature:l,primitivesPerCoordinate:n,maximumTotalNumberOfPrimitives:o}=r;let u;0!==l&&null!=e&&await e;const h=this.serviceDataCount,c=h!==H.NO_SERVICE_DATA_COUNT;if(u=c?Math.ceil((o-h*l)/(n||1)):Math.ceil(o/(n||1)),a&&(u=Math.min(u,N)),c&&this._minimumNumberOfVerticesForGeometry*h>u)return void this._set("vertexLimitExceeded",!0);if(!this._supportsExceedsLimitQuery||!has("featurelayer-snapshot-enabled"))return void this._set("vertexLimitExceeded",this.maxTotalSnapshotVertices>u);const m=await i(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(u),{timeout:H.QUERY_STATISTICS_TIMEOUT,signal:t}));if(!1===m.ok){if(d(m.error))throw m.error;return void this._set("vertexLimitExceeded",!1)}const p=m.value.features[0];p&&p.attributes?this._set("vertexLimitExceeded",!!p.attributes.exceedslimit):this._set("vertexLimitExceeded",!1)}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo();let e=new AbortController;const t=e.signal,i=this._updateServiceDataCount(t),r=m([i,this._updateVertexLimitExceeded(i,t)]),s=r.then((()=>this._updateServiceDataExtent(t))).catch((e=>{d(e)||l.getLogger(this).error("#fetchServiceDataInfo()",e)})).then((()=>{s===this._fetchDataInfoPromise&&(this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null),e=null}));return e&&(this._fetchDataInfoPromise=s),this._fetchDataInfoAbortController=e,r.then((()=>{}),(()=>{}))}_cancelFetchServiceDataInfo(){const e=this._fetchDataInfoAbortController;e&&(this._fetchDataInfoAbortController=null,this._fetchDataInfoPromise=null,e.abort())}get debug(){return{storedFeatures:null!=this._tileFetcher?this._tileFetcher.storedFeatures:0,totalFeatures:null!=this._tileFetcher?this._tileFetcher.totalFeatures:0,totalVertices:null!=this._tileFetcher?this._tileFetcher.totalVertices:0,missingTiles:null!=this._tileFetcher?this._tileFetcher.missingTiles:0}}};e([x({readOnly:!0})],O.prototype,"type",void 0),e([x({constructOnly:!0})],O.prototype,"graphics",void 0),e([x({constructOnly:!0})],O.prototype,"layerView",void 0),e([x({constructOnly:!0})],O.prototype,"context",void 0),e([x()],O.prototype,"extent",null),e([x()],O.prototype,"updating",null),e([x({readOnly:!0})],O.prototype,"_updatingHandles",void 0),e([x()],O.prototype,"updatingTotal",null),e([x()],O.prototype,"updatingRemaining",null),e([x()],O.prototype,"expectedFeatureDiff",null),e([x()],O.prototype,"memoryForUnusedFeatures",null),e([x()],O.prototype,"maximumNumberOfFeaturesExceeded",null),e([x({readOnly:!0})],O.prototype,"serviceDataExtent",void 0),e([x({readOnly:!0})],O.prototype,"serviceDataCount",void 0),e([x({readOnly:!0})],O.prototype,"vertexLimitExceeded",void 0),e([x()],O.prototype,"displayFeatureLimit",void 0),e([x({type:Number})],O.prototype,"maximumNumberOfFeatures",null),e([x({readOnly:!0})],O.prototype,"mode",null),e([x({readOnly:!0})],O.prototype,"maxTotalSnapshotVertices",null),e([x({readOnly:!0,dependsOn:["mode"]})],O.prototype,"tileDescriptors",null),e([x()],O.prototype,"_tileFetcher",void 0),e([x()],O.prototype,"_fetchDataInfoPromise",void 0),e([x({readOnly:!0})],O.prototype,"vertexLimitInfo",null),O=e([F("esri.layers.graphics.controllers.FeatureTileController3D")],O);const I=1e4,V=12e3,A=1e4,N=5e6;function L(e,t){if(!t)return!1;for(const i of t)if(!e.has(i))return!0;return!1}var H;!function(e){function t(){e.MAX_FEATURE_COUNT_FOR_EXTENT=I,e.QUERY_STATISTICS_TIMEOUT=V,e.QUERY_EXTENT_TIMEOUT=A}e.NO_SERVICE_DATA_COUNT=1/0,e.MAX_SNAPSHOT_MIN_SCALE_FACTOR=5,e.reset=t}(H||(H={})),H.reset();export{O as FeatureTileController3D,H as FeatureTileController3DConstants};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../config.js";import{id as r}from"../../kernel.js";import s from"../../request.js";import{result as i}from"../../core/asyncUtils.js";import o from"../../core/Error.js";import a from"../../core/Logger.js";import{
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../config.js";import{id as r}from"../../kernel.js";import s from"../../request.js";import{result as i}from"../../core/asyncUtils.js";import o from"../../core/Error.js";import a from"../../core/Logger.js";import{throwIfAborted as l,isAbortError as n,throwIfAbortError as p}from"../../core/promiseUtils.js";import{hasSameCanonicalPortal as u,normalize as c,hasSamePortal as d}from"../../core/urlUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{reader as h}from"../../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import{writer as g}from"../../core/accessorSupport/decorators/writer.js";import{getOwningPortalUrl as y}from"../support/layerUtils.js";import I from"../../portal/Portal.js";import v from"../../portal/PortalItem.js";import P from"../../portal/PortalUser.js";import{getUserPrivileges as U}from"../../portal/support/portalItemUtils.js";const w=w=>{let E=class extends w{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=null,this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,e,r){if(e.itemId)return new v({id:e.itemId,portal:r&&r.portal})}writePortalItem(t,e){t&&t.id&&(e.itemId=t.id)}async loadFromPortal(t,e){if(this.portalItem&&this.portalItem.id)try{const{load:r}=await import("../../portal/support/layersLoader.js");return l(e),await r({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap},e)}catch(r){throw n(r)||a.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${r}`),r}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch((t=>(p(t),!0))))}async _setUserPrivileges(t,r){if(!e.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(r);if(this.url)try{const{features:{edit:e,fullEdit:s},content:{updateItem:i}}=await this._fetchUserPrivileges(t,r);this._set("userHasEditingPrivileges",e),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",i)}catch(s){p(s)}}async _fetchUserPrivileges(t,e){let s=this.portalItem;if(!t||!s||!s.loaded||s.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=t===s.id;if(i&&s.portal.user)return U(s);let o,a;if(i)o=s.portal.url;else try{o=await y(this.url,e)}catch(d){p(d)}if(!o||!u(o,s.portal.url))return this._fetchFallbackUserPrivileges(e);try{const t=null!=e?e.signal:null;a=await(r?.getCredential(`${o}/sharing`,{prompt:!1,signal:t}))}catch(d){p(d)}const l=!0,n=!1,c=!1;if(!a)return{features:{edit:l,fullEdit:n},content:{updateItem:c}};try{if(i?await s.reload():(s=new v({id:t,portal:{url:o}}),await s.load(e)),s.portal.user)return U(s)}catch(d){p(d)}return{features:{edit:l,fullEdit:n},content:{updateItem:c}}}async _fetchFallbackUserPrivileges(t){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(t)}catch(r){p(r)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const e=this.url?r?.findCredential(this.url):null;if(!e)return!0;const s=j.credential===e?j.user:await this._fetchEditingUser(t);return j.credential=e,j.user=s,null==s||null==s.privileges||s.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const e=this.portalItem?.portal?.user;if(e)return e;const o=r.findServerInfo(this.url??"");if(!o?.owningSystemUrl)return null;const a=`${o.owningSystemUrl}/sharing/rest`,l=I.getDefault();if(l&&l.loaded&&c(l.restUrl)===c(a))return l.user;const n=`${a}/community/self`,p=null!=t?t.signal:null,u=await i(s(n,{authMode:"no-prompt",query:{f:"json"},signal:p}));return u.ok?P.fromJSON(u.value.data):null}read(t,e){e&&(e.layer=this),super.read(t,e)}write(t,e){const r=e&&e.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||I.getDefault());return r&&s&&!d(s.restUrl,r.restUrl)?(e.messages&&e.messages.push(new o("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(t,{...e,layer:this})}};return t([m({type:v})],E.prototype,"portalItem",null),t([h("web-document","portalItem",["itemId"])],E.prototype,"readPortalItem",null),t([g("web-document","portalItem",{itemId:{type:String}})],E.prototype,"writePortalItem",null),t([m({clonable:!1})],E.prototype,"resourceReferences",void 0),t([m({type:Boolean,readOnly:!0})],E.prototype,"userHasEditingPrivileges",void 0),t([m({type:Boolean,readOnly:!0})],E.prototype,"userHasFullEditingPrivileges",void 0),t([m({type:Boolean,readOnly:!0})],E.prototype,"userHasUpdateItemPrivileges",void 0),E=t([f("esri.layers.mixins.PortalLayer")],E),E},j={credential:null,user:null};export{w as PortalLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import l from"../../core/Error.js";import{waitTick as t,isAbortError as i}from"../../core/promiseUtils.js";class e{constructor(l,t=0,i=l.lods[l.lods.length-1].level){this.tileInfo=l,this.minLOD=t,this.maxLOD=i,l.lodAt(t)||(this.minLOD=l.lods[0].level),l.lodAt(i)||(this.maxLOD=l.lods[l.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(l,t,i){const e=this.tileInfo?.lodAt(l);return!e||l<this.minLOD||l>this.maxLOD?"unavailable":e.cols&&e.rows?i>=e.cols[0]&&i<=e.cols[1]&&t>=e.rows[0]&&t<=e.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(i,e,o,s){await t(s);const a=this.getAvailability(i,e,o);if("unavailable"===a)throw new l("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:o});return a}async fetchAvailabilityUpsample(l,e,o,s,a){await t(a),s.level=l,s.row=e,s.col=o;const n=this.tileInfo;return n.updateTileInfo(s),this.fetchAvailability(l,e,o,a).catch((l=>{if(i(l))throw l;if(n.upsampleTile(s))return this.fetchAvailabilityUpsample(s.level,s.row,s.col,s,a);throw l}))}}export{e as default};
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const b="20230623",f="2b4b1b3775b498b80d1e6f701cbaef6f2800f6fa";export{b as buildDate,f as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Color.js";import{getFontFamily as t}from"../../core/fontUtils.js";import{clone as i}from"../../core/lang.js";import r from"../../core/Logger.js";import{pt2px as o,px2pt as n}from"../../core/screenUtils.js";import{numericHash as a}from"../../core/string.js";import{createRendererExpression as s,ArcadeExpression as l}from"../../support/arcadeOnDemand.js";import{DEFAULT_PICTURE_FILL_HEIGHT as c,DEFAULT_HATCH_FILL_SEPARATION as m,DEFAULT_STROKE_WIDTH as f,DEFAULT_MARKER_SIZE as h,DEFAULT_TEXT_HEIGHT as p}from"./CIMSymbolDrawHelper.js";import{CIMSymbolHelper as u,OverrideHelper as y}from"./CIMSymbolHelper.js";import{Alignment as d,CapType as v,JoinType as _}from"./enums.js";import{quantizeIfNeeded as O}from"./quantizeTime.js";import{getExtent as S,getSDFMetrics as g}from"./SDFHelper.js";import{fromCIMColor as M,getTintColor as k,getValue as b,getFillColor as N,getStrokeColor as P,getStrokeWidth as z,isFeatureValueFn as L,fromCIMFontDecoration as C,fromCIMFontStyle as F,adjustTextCase as I,createLabelOverrideFunction as w,evaluateValueOrFunction as x,fromCIMHorizontalAlignment as A,fromCIMVerticalAlignment as R}from"./utils.js";import{CIMEffectHelper as X}from"./effects/CIMEffectHelper.js";import H from"../../views/2d/arcade/callExpressionWithFeature.js";import{RANDOM_INSIDE_POLYGON_TEXTURE_SIZE as J}from"../../views/2d/engine/webgl/definitions.js";import{getMaterialGroup as Y}from"../../views/2d/engine/webgl/grouping.js";const E=r.getLogger("esri.symbols.cim.cimAnalyzer");function T(e){switch(e){case"Butt":return v.BUTT;case"Square":return v.SQUARE;default:return v.ROUND}}function $(e){switch(e){case"Bevel":return _.BEVEL;case"Miter":return _.MITER;default:return _.ROUND}}function j(e){const t=e.markerPlacement;return t&&t.angleToLine?d.MAP:d.SCREEN}class G{constructor(e,t){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._resourceManager=e,this._info=t}async analyzeSymbolReference(e,t,i){if(this._cimLayers=i??[],!e)return this._cimLayers;if(e.primitiveOverrides){this._primitiveOverrides=e.primitiveOverrides,this._poMap={};const t=[],i=this._info;for(const e of this._primitiveOverrides){const r=e.valueExpressionInfo;if(r&&i){const o=r.expression,n=s(o,i.spatialReference,i.fields).then((t=>{null!=t&&this._setPoMap(e.primitiveName,e.propertyName,t)}));t.push(n)}else null!=e.value&&this._setPoMap(e.primitiveName,e.propertyName,e.value);t.length>0&&await Promise.all(t)}}const r=e.symbol,o=[];return u.fetchResources(r,this._resourceManager,o),o.length>0&&await Promise.all(o),this._analyzeSymbol(r,t),this._cimLayers}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t,1,0,0,0)}}_analyzeMultiLayerSymbol(e,t,i,r,o,n){const a=e?.symbolLayers;if(!a)return;const s=e.effects;let l=d.SCREEN;const c=u.getSize(e)??0;"CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(l=d.MAP);const m="CIMPolygonSymbol"===e.type;let f=a.length;for(;f--;){const h=a[f];if(!h||!1===h.enable)continue;let p;s&&s.length&&(p=[...s]);const u=h.effects;u&&u.length&&(s?p.push(...u):p=[...u]);const d=[];let v;y.findEffectOverrides(p,this._primitiveOverrides,d),v=d.length>0?this._createEffectsOverrideFunction(p,d):p;const _=[];switch(y.findApplicableOverrides(h,this._primitiveOverrides,_),h.type){case"CIMSolidFill":this._analyzeSolidFill(h,v);break;case"CIMPictureFill":this._analyzePictureFill(h,v);break;case"CIMHatchFill":this._analyzeHatchFill(h,v);break;case"CIMGradientFill":this._analyzeGradientFill(h,v);break;case"CIMSolidStroke":this._analyzeSolidStroke(h,v,m,c);break;case"CIMPictureStroke":this._analyzePictureStroke(h,v,m,c);break;case"CIMGradientStroke":this._analyzeGradientStroke(h,v,m,c);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{"CIMLineSymbol"===e.type&&(l=j(h));const a=[],s=h.primitiveName;s&&a.push(s),this._analyzeMarker(h,v,null,a,l,c,1,t,i,r,o,n);break}default:E.error("Cannot analyze CIM layer",h.type)}}}_analyzeSolidFill(e,t){const i=e.primitiveName,r=M(e.color),[o,n]=this._analyzePrimitiveOverrides(i,t,null,null),s=a(JSON.stringify(e)+n).toString();this._cimLayers.push({type:"fill",templateHash:s,materialHash:o?()=>s:s,cim:e,materialOverrides:null,colorLocked:!!e.colorLocked,color:this._createOverrideFunction(i,"Color",r,U),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0})}_analyzePictureFill(e,t){const i=e.primitiveName,r=k(e),[o,n]=this._analyzePrimitiveOverrides(i,t,null,null),s=a(JSON.stringify(e)+n).toString(),l=a(`${e.url}${JSON.stringify(e.colorSubstitutions)}`).toString(),m=b(e.height,c);let f=b(e.scaleX,1);if("width"in e&&"number"==typeof e.width){const t=e.width;let i=1;const r=this._resourceManager.getResource(e.url);null!=r&&(i=r.width/r.height),f/=i*(m/t)}this._cimLayers.push({type:"fill",templateHash:s,materialHash:o?()=>l:l,cim:e,materialOverrides:null,colorLocked:!!e.colorLocked,effects:t,color:this._createOverrideFunction(i,"TintColor",r,U),height:this._createOverrideFunction(i,"Height",m),scaleX:this._createOverrideFunction(i,"ScaleX",f),angle:this._createOverrideFunction(i,"Rotation",b(e.rotation)),offsetX:this._createOverrideFunction(i,"OffsetX",b(e.offsetX)),offsetY:this._createOverrideFunction(i,"OffsetY",b(e.offsetY)),url:e.url,applyRandomOffset:!1,sampleAlphaOnly:!1})}_analyzeHatchFill(e,t){const i=e.primitiveName,r=this._analyzeMaterialOverrides(i,["Rotation","OffsetX","OffsetY"]);let[o,n]=this._analyzePrimitiveOverrides(i,t,null,null);const s=a(JSON.stringify(e)+n).toString(),l=a(`${e.separation}${JSON.stringify(e.lineSymbol)}`).toString();let c={r:255,g:255,b:255,a:1},f=!1;const h=e.lineSymbol?.symbolLayers?.find((e=>"CIMSolidStroke"===e.type&&null!=this._poMap[e.primitiveName]?.Color));if(h){c=M(h.color),c=this._createOverrideFunction(h.primitiveName,"Color",c,U);const e="function"==typeof c;o=o||e,f=null!=h.color||e}this._cimLayers.push({type:"fill",templateHash:s,materialHash:o&&r?this._createMaterialHashFunction(l,r):l,cim:e,materialOverrides:r,colorLocked:!!e.colorLocked,effects:t,color:c,height:this._createOverrideFunction(i,"Separation",b(e.separation,m)),scaleX:1,angle:this._createOverrideFunction(i,"Rotation",b(e.rotation)),offsetX:this._createOverrideFunction(i,"OffsetX",b(e.offsetX)),offsetY:this._createOverrideFunction(i,"OffsetY",b(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!f})}_analyzeGradientFill(e,t){const i=e.primitiveName,[r,o]=this._analyzePrimitiveOverrides(i,t,null,null),n=a(JSON.stringify(e)+o).toString();this._cimLayers.push({type:"fill",templateHash:n,materialHash:r?()=>n:n,cim:e,materialOverrides:null,colorLocked:!!e.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1})}_analyzeSolidStroke(e,t,i,r){const o=e.primitiveName,n=M(e.color),s=b(e.width,f),l=T(e.capStyle),c=$(e.joinStyle),m=e.miterLimit,[h,p]=this._analyzePrimitiveOverrides(o,t,null,null),u=a(JSON.stringify(e)+p).toString();let y,d;if(t&&t instanceof Array&&t.length>0){const e=t[t.length-1];if("CIMGeometricEffectDashes"===e.type&&"NoConstraint"===e.lineDashEnding&&null===e.offsetAlongLine){const e=(t=[...t]).pop();y=e.dashTemplate,d=e.scaleDash}}this._cimLayers.push({type:"line",templateHash:u,materialHash:h?()=>u:u,cim:e,materialOverrides:null,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:this._createOverrideFunction(o,"Color",n,U),width:this._createOverrideFunction(o,"Width",s),cap:this._createOverrideFunction(o,"CapStyle",l),join:this._createOverrideFunction(o,"JoinStyle",c),miterLimit:m&&this._createOverrideFunction(o,"MiterLimit",m),referenceWidth:r,zOrder:D(e.name),dashTemplate:y,scaleDash:d,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,i,r){const o=a(`${e.url}${JSON.stringify(e.colorSubstitutions)}`).toString(),n=e.primitiveName,s=k(e),l=b(e.width,f),c=T(e.capStyle),m=$(e.joinStyle),h=e.miterLimit,[p,u]=this._analyzePrimitiveOverrides(n,t,null,null),y=a(JSON.stringify(e)+u).toString();this._cimLayers.push({type:"line",templateHash:y,materialHash:p?()=>o:o,cim:e,materialOverrides:null,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:this._createOverrideFunction(n,"TintColor",s,U),width:this._createOverrideFunction(n,"Width",l),cap:this._createOverrideFunction(n,"CapStyle",c),join:this._createOverrideFunction(n,"JoinStyle",m),miterLimit:h&&this._createOverrideFunction(n,"MiterLimit",h),referenceWidth:r,zOrder:D(e.name),dashTemplate:null,scaleDash:!1,url:e.url,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,i,r){const o=e.primitiveName,n=b(e.width,f),s=T(e.capStyle),l=$(e.joinStyle),c=e.miterLimit,[m,h]=this._analyzePrimitiveOverrides(o,t,null,null),p=a(JSON.stringify(e)+h).toString();this._cimLayers.push({type:"line",templateHash:p,materialHash:m?()=>p:p,cim:e,materialOverrides:null,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},width:this._createOverrideFunction(o,"Width",n),cap:this._createOverrideFunction(o,"CapStyle",s),join:this._createOverrideFunction(o,"JoinStyle",l),miterLimit:c&&this._createOverrideFunction(o,"MiterLimit",c),referenceWidth:r,zOrder:D(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,t,i,r,o,n,a,s,l,c,m,f,p=!1){if(this._analyzeMarkerInsidePolygon(e,t))return;const u=b(e.size,h),y=b(e.rotation),d=b(e.offsetX),v=b(e.offsetY);let _=this._createOverrideFunction(e.primitiveName,"Size",u),O=this._createOverrideFunction(e.primitiveName,"Rotation",y),S=this._createOverrideFunction(e.primitiveName,"OffsetX",d),g=this._createOverrideFunction(e.primitiveName,"OffsetY",v);_=this._transformSize(_,a),O=this._transformRotation(O,!!e.rotateClockwise,c);const M=this._transformOffsetX(S,g,c,a,m),k=this._transformOffsetY(S,g,c,a,f);switch(S=M,g=k,e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,i,r,o,n,_,O,S,g,e.colorLocked||p);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,i,r,o,n,a,s,_,O,S,g,e.colorLocked||p)}}_analyzeMarkerInsidePolygon(e,t){const{markerPlacement:i,type:r}=e;if(!i||"CIMMarkerPlacementInsidePolygon"!==i.type)return!1;if("CIMVectorMarker"===r||"CIMPictureMarker"===r){const o=e.primitiveName;if(o){const[e,i]=this._analyzePrimitiveOverrides([o],t,null,null);if(e)return!1}const n=i.primitiveName;if(n){const[e,i]=this._analyzePrimitiveOverrides([n],t,null,null);if(e)return!1}if("CIMVectorMarker"===r){const{markerGraphics:t}=e;if(t)for(const e of t){const{symbol:t}=e;if("CIMPolygonSymbol"===t?.type&&t.symbolLayers){const{symbolLayers:e}=t;for(const t of e)if("CIMSolidStroke"===t.type)return!1}}}else{const{animatedSymbolProperties:t}=e;if(t)return!1}}const o=i,s=Math.abs(o.stepX),l=Math.abs(o.stepY);if(0===s||0===l)return!0;const c=["Rotation","OffsetX","OffsetY"],m=this._primitiveOverrides.filter((t=>t.primitiveName!==e.primitiveName||!c.includes(t.propertyName))),f="url"in e&&"string"==typeof e.url?e.url:void 0,h=a(JSON.stringify(e)).toString();let p,u,y=null;if("Random"===i.gridType){const e=n(J),t=Math.max(Math.floor(e/s),1),i=Math.max(Math.floor(e/l),1);p=l*i,y=e=>e?e*i:0;u=t*s/p}else i.shiftOddRows?(p=2*l,y=e=>e?2*e:0,u=s/l*.5):(p=l,y=null,u=s/l);const d=k(e);return this._cimLayers.push({type:"fill",templateHash:h,materialHash:h,cim:e,materialOverrides:m,colorLocked:!!e.colorLocked,effects:t,color:d,height:this._createOverrideFunction(o.primitiveName,"StepY",p,y),scaleX:u,angle:o.gridAngle,offsetX:b(o.offsetX),offsetY:b(o.offsetY),url:f,applyRandomOffset:"Random"===i.gridType,sampleAlphaOnly:!f,hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,i,r,o,n,s,l,c,m,f){let h=b(e.scaleX,1);const p=k(e),u=a(`${e.url}${JSON.stringify(e.colorSubstitutions)}${JSON.stringify(e.animatedSymbolProperties)}`).toString();i||(i=this._createMarkerPlacementOverrideFunction(e.markerPlacement));const y=this._createAnimatedSymbolPropertiesOverrideFunction(e.animatedSymbolProperties),[d,v]=this._analyzePrimitiveOverrides(r,t,i,y),_=a(JSON.stringify(e)+v).toString(),O=e.anchorPoint??{x:0,y:0};if("width"in e&&"number"==typeof e.width){const t=e.width;let i=1;const r=this._resourceManager.getResource(e.url);null!=r&&(i=r.width/r.height);h/=i*(b(e.size)/t)}function S(e,t){return null!=y?x(y,e,t):null}const g=e.animatedSymbolProperties&&!0===e.animatedSymbolProperties.randomizeStartTime?(e,t,i,r)=>{const o=Y(r??0),n=S(e,t);return u+`-MATERIALGROUP(${o})`+`-ASP(${JSON.stringify(n)})`}:d?(e,t)=>{const i=S(e,t);return u+`-ASP(${JSON.stringify(i)})`}:u;this._cimLayers.push({type:"marker",templateHash:_,materialHash:g,cim:e,materialOverrides:null,colorLocked:!!e.colorLocked||!!f,effects:t,scaleSymbolsProportionally:!1,alignment:o,size:s,scaleX:this._createOverrideFunction(e.primitiveName,"ScaleX",h),rotation:l,offsetX:c,offsetY:m,color:this._createOverrideFunction(e.primitiveName,"TintColor",p,U),anchorPoint:{x:O.x,y:O.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:!1,referenceSize:n,sizeRatio:1,markerPlacement:i,url:e.url,animatedSymbolProperties:y})}_analyzeVectorMarker(e,t,i,r,o,n,a,s,l,c,m,f,h){const p=e.markerGraphics;if(!p)return;let u,y=0,d=1;e.scaleSymbolsProportionally&&(u=e.frame,u&&(y=u.ymax-u.ymin,d=this._transformSize(l,1/y))),d=this._transformSize(d,a),i||(i=this._createMarkerPlacementOverrideFunction(e.markerPlacement));for(const v of p)if(v){const a=v.symbol;if(!a)continue;const p=v.primitiveName;p&&r.push(p);let _=m,O=f;if(("CIMPointSymbol"===a.type||"CIMTextSymbol"===a.type)&&u){let t=0,i=0;const r=v.geometry;"x"in r&&"y"in r&&(t+=r.x-.5*(u.xmin+u.xmax),i+=r.y-.5*(u.ymin+u.ymax));const o=e.anchorPoint;o&&("Absolute"===e.anchorPointUnits?(t-=o.x,i-=o.y):u&&(t-=(u.xmax-u.xmin)*o.x,i-=(u.ymax-u.ymin)*o.y)),_=this._transformOffsetX(t,i,c,d,m),O=this._transformOffsetY(t,i,c,d,f)}switch(a.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":s?this._analyzeMultiLayerGraphicNonSDF(e,t,i,null,v,r,o,n,y,!!h||!!e.colorLocked):this._analyzeMultiLayerGraphic(e,t,i,null,v,r,o,n,y,d,l,c,_,O,!!h||!!e.colorLocked);break;case"CIMTextSymbol":this._analyzeTextGraphic(e,t,i,v,r,o,n,y,d,l,c,_,O,h)}p&&r.pop()}}_analyzeMultiLayerGraphic(e,t,i,r,o,n,s,l,c,m,f,h,p,u,y){const d=o.symbol,v=d.symbolLayers;if(!v)return;let _=v.length;if(B(v))return void this._analyzeCompositeMarkerGraphic(e,t,i,r,o,v,n,s,l,c,f,h,p,u,!!y||!!e.colorLocked);const O=this._resourceManager.geometryEngine,k=X.applyEffects(d.effects,o.geometry,O);if(k)for(;_--;){const d=v[_];if(!d||!1===d.enable)continue;const b=d.primitiveName;switch(b&&n.push(b),d.type){case"CIMSolidFill":case"CIMSolidStroke":{const m=X.applyEffects(d.effects,k,O),v=S(m);if(!v)continue;const _="Relative"!==e.anchorPointUnits,[C,F,I]=g(v,e.frame,e.size,e.anchorPoint,_),w="CIMSolidFill"===d.type,x={type:"sdf",geom:m,asFill:w},A=d.path,R=M(w?N(d):P(d)),H=w?{r:0,g:0,b:0,a:0}:M(P(d)),J=z(d)??0;if(!w&&!J)break;const Y=o.primitiveName;let E=null;!w||d.colorLocked||y||(E=this._createOverrideFunction(Y,"FillColor",R,U));let T=null;d.colorLocked||y||(T=this._createOverrideFunction(Y,"StrokeColor",H,U));const $=this._createOverrideFunction(Y,"StrokeWidth",J);let j=!1,G="";for(const e of this._primitiveOverrides)n.includes(e.primitiveName)&&(null!=e.value?G+=`-${e.primitiveName}-${e.propertyName}-${JSON.stringify(e.value)}`:e.valueExpressionInfo&&(j=!0));(null!=t&&"function"==typeof t||null!=i&&"function"==typeof i)&&(j=!0),(L(f)||L(h)||L(p)||L(u))&&(j=!0);const D=JSON.stringify({...e,markerGraphics:null}),W=a(JSON.stringify(x)+A).toString(),V=a(JSON.stringify(o)+JSON.stringify(d)+D+G).toString();this._cimLayers.push({type:"marker",templateHash:V,materialHash:j?()=>W:W,cim:x,materialOverrides:null,colorLocked:!!d.colorLocked||!!y,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:F,y:I},isAbsoluteAnchorPoint:_,size:f,rotation:h,offsetX:p,offsetY:u,scaleX:1,frameHeight:c,rotateClockwise:!1,referenceSize:l,sizeRatio:C,color:L(E)?E:this._createOverrideFunction(b,"Color",R,U),outlineColor:L(T)?T:this._createOverrideFunction(b,"Color",H,U),outlineWidth:L($)?$:this._createOverrideFunction(b,"Width",J),markerPlacement:i,animatedSymbolProperties:r,path:A});break}case"CIMVectorMarker":d.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,t,i,r,o,n,s,l,c,!!y||!!d.colorLocked):this._analyzeMarker(d,t,i,n,s,l,m,!1,f,h,p,u,!!y||!!e.colorLocked);break;default:this._analyzeMultiLayerGraphicNonSDF(e,t,i,r,o,n,s,l,c,!!y||!!e.colorLocked)}b&&n.pop()}}_analyzeTextGraphic(e,i,r,o,n,s,l,c,m,h,u,d,v,_){const O=[];y.findApplicableOverrides(o,this._primitiveOverrides,O);const S=o.geometry;if(!("x"in S)||!("y"in S))return;const g=o.symbol,k=C(g),L=F(g.fontStyleName),X=t(g.fontFamilyName);g.font={family:X,decoration:k,...L};let H=b(g.height,p),J=b(g.angle),Y=b(g.offsetX),E=b(g.offsetY);H=this._transformSize(H,m),J=this._transformRotation(J,!1,u);const T=this._transformOffsetX(Y,E,u,m,d),$=this._transformOffsetY(Y,E,u,m,v);Y=T,E=$;const j=M(N(g));let G=M(P(g)),D=z(g)??0;D||(G=M(N(g.haloSymbol)),D=b(g.haloSize)),D=this._transformSize(D,m);let U=null,W=null,V=0;if(g.callout&&"CIMBackgroundCallout"===g.callout.type){const e=g.callout;if(e.backgroundSymbol){const t=e.backgroundSymbol.symbolLayers;if(t)for(const e of t)"CIMSolidFill"===e.type?U=M(e.color):"CIMSolidStroke"===e.type&&(W=M(e.color),V=b(e.width,f))}}const[B,q]=this._analyzePrimitiveOverrides(n,i,r,null),K=JSON.stringify(e.effects)+Number(e.colorLocked||_).toString()+JSON.stringify(e.anchorPoint)+e.anchorPointUnits+JSON.stringify(e.markerPlacement)+e.size.toString(),Q=a(JSON.stringify(o)+K+q).toString();let Z=this._createOverrideFunction(o.primitiveName,"TextString",o.textString??"",I,g.textCase);if(null==Z)return;const{fontStyleName:ee}=g,te=X+(ee?"-"+ee.toLowerCase():"-regular"),ie=te;"string"==typeof Z&&Z.includes("[")&&g.fieldMap&&(Z=w(g.fieldMap,Z,g.textCase)),this._cimLayers.push({type:"text",templateHash:Q,materialHash:B||"function"==typeof Z||/\[(.*?)\]/.test(Z)?(e,t,i)=>ie+"-"+x(Z,e,t,i):ie+"-"+a(Z),cim:g,materialOverrides:null,colorLocked:!!e.colorLocked||!!_,effects:i,alignment:s,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,fontName:te,decoration:k,weight:L.weight,style:L.style,size:H,angle:J,offsetX:Y,offsetY:E,horizontalAlignment:A(g.horizontalAlignment),verticalAlignment:R(g.verticalAlignment),text:Z,color:j,outlineColor:G,outlineSize:D,backgroundColor:U,borderLineColor:W,borderLineWidth:V,referenceSize:l,sizeRatio:1,markerPlacement:r})}_analyzeMultiLayerGraphicNonSDF(e,t,i,r,n,s,l,c,m,f){const p=this._buildSimpleMarker(e,n),y=e.primitiveName,d=this._analyzeMaterialOverrides(y,["Rotation","OffsetX","OffsetY"]),[v,_]=this._analyzePrimitiveOverrides(s,null,null,null),[O,S,g]=u.getTextureAnchor(p,this._resourceManager),M=b(e.rotation),k=b(e.offsetX),N=b(e.offsetY),P=a(JSON.stringify(p)+_).toString(),z=d&&d.length>0||null!=t&&"function"==typeof t;this._cimLayers.push({type:"marker",templateHash:P,materialHash:z&&d?this._createMaterialHashFunction(P,d):P,cim:p,materialOverrides:d,colorLocked:!!e.colorLocked||!!f,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:l,anchorPoint:{x:O,y:S},isAbsoluteAnchorPoint:!1,size:b(e.size,h),rotation:this._createOverrideFunction(y,"Rotation",M),offsetX:this._createOverrideFunction(y,"OffsetX",k),offsetY:this._createOverrideFunction(y,"OffsetY",N),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:m,rotateClockwise:!!e.rotateClockwise,referenceSize:c,sizeRatio:g/o(e.size),markerPlacement:i,animatedSymbolProperties:r,avoidSDFRasterization:!0})}_buildSimpleMarker(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}_analyzeCompositeMarkerGraphic(e,t,i,r,o,n,s,l,c,m,h,p,u,y,d){const v=o.geometry,_=n[0],O=n[1],k=S(v);if(!k)return;const N="Relative"!==e.anchorPointUnits,[P,z,C]=g(k,e.frame,e.size,e.anchorPoint,N),F={type:"sdf",geom:v,asFill:!0},I=O.path,w=O.primitiveName,x=_.primitiveName,A=M(O.color),R=M(_.color),X=b(_.width,f),H=o.primitiveName;let J=null;O.colorLocked||d||(J=this._createOverrideFunction(H,"FillColor",A,U));let Y=null;_.colorLocked||d||(Y=this._createOverrideFunction(H,"StrokeColor",R,U));const E=this._createOverrideFunction(H,"StrokeWidth",X);let T=!1,$="";for(const a of this._primitiveOverrides)(a.primitiveName===w||a.primitiveName===x||s.includes(a.primitiveName))&&(null!=a.value?$+=`-${a.primitiveName}-${a.propertyName}-${JSON.stringify(a.value)}`:a.valueExpressionInfo&&(T=!0));null!=i&&"function"==typeof i&&(T=!0),(L(h)||L(p)||L(u)||L(y))&&(T=!0);const j=JSON.stringify({...e,markerGraphics:null}),G=a(JSON.stringify(F)+I).toString(),D=a(JSON.stringify(o)+JSON.stringify(O)+JSON.stringify(_)+j+$).toString();this._cimLayers.push({type:"marker",templateHash:D,materialHash:T?()=>G:G,cim:F,materialOverrides:null,colorLocked:!!d,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:l,anchorPoint:{x:z,y:C},isAbsoluteAnchorPoint:N,size:h,rotation:p,offsetX:u,offsetY:y,scaleX:1,frameHeight:m,rotateClockwise:!1,referenceSize:c,sizeRatio:P,color:L(J)?J:this._createOverrideFunction(w,"Color",A,U),outlineColor:L(Y)?Y:this._createOverrideFunction(x,"Color",R,U),outlineWidth:L(E)?E:this._createOverrideFunction(x,"Width",X),markerPlacement:i,path:I,animatedSymbolProperties:r})}_createMaterialHashFunction(e,t){const i=this._info?.geometryType;if(i){const e=this._poMap;for(const r of t){if(r.valueExpressionInfo){const t=e[r.primitiveName]&&e[r.primitiveName][r.propertyName];t instanceof l&&(r.fn=(e,r,o)=>H(t,e,{$view:o},i,r))}}}return(i,r,o)=>{for(const e of t)e.fn&&(e.value=e.fn(i,r,o));return a(e+y.buildOverrideKey(t)).toString()}}_setPoMap(e,t,i){let r;this._poMap[e]?r=this._poMap[e]:(r={},this._poMap[e]=r),r[t]=i}_createOverrideFunction(e,t,i,r,o){if(null==e)return i;const n=this._poMap[e];if(null==n)return i;const a=n[t];if("string"==typeof a||"number"==typeof a||a instanceof Array)return r?r.call(null,a,o):a;const s=this._info?.geometryType;return null!=a&&a instanceof l&&null!=s?(e,t,n)=>{let l=H(a,e,{$view:n},s,t);return null!==l&&r&&(l=r.call(null,l,o)),null!==l?l:i}:i}_createEffectsOverrideFunction(e,t){const r=this._poMap,o=this._info?.geometryType;for(const i of t){if(i.valueExpressionInfo&&o){const e=r[i.primitiveName]&&r[i.primitiveName][i.propertyName];e instanceof l&&(i.fn=(t,i,r)=>H(e,t,{$view:r},o,i))}}return(r,o,n)=>{for(const e of t)e.fn&&(e.value=e.fn(r,o,n));const a=[];for(let s of e){const e=s?.primitiveName;if(e){let r=!1;for(const o of t)if(o.primitiveName===e){const e=W(o.propertyName);null!=o.value&&o.value!==s[e]&&(r||(s=i(s),r=!0),s[e]=o.value)}}a.push(s)}return a}}_createMarkerPlacementOverrideFunction(e){const t=[];if(y.findApplicableOverrides(e,this._primitiveOverrides,t),null==e||0===t.length)return e;const r=this._poMap,o=this._info?.geometryType;for(const i of t){if(i.valueExpressionInfo&&o){const e=r[i.primitiveName]&&r[i.primitiveName][i.propertyName];e instanceof l&&(i.fn=(t,i,r)=>H(e,t,{$view:r},o,i))}}return(r,o,n)=>{for(const e of t)e.fn&&(e.value=e.fn(r,o,n));const a=i(e),s=e.primitiveName;for(const e of t)if(e.primitiveName===s){const t=W(e.propertyName);null!=e.value&&e.value!==a[t]&&(a[t]=e.value)}return a}}_createAnimatedSymbolPropertiesOverrideFunction(e){const t=[];if(y.findApplicableOverrides(e,this._primitiveOverrides,t),null==e||0===t.length)return e;const r=this._info?.geometryType;if(r){const e=this._poMap;for(const i of t){if(i.valueExpressionInfo){const t=e[i.primitiveName]&&e[i.primitiveName][i.propertyName];t instanceof l&&(i.fn=(e,i,o)=>H(t,e,{$view:o},r,i))}}}return(r,o,n)=>{for(const e of t)e.fn&&(e.value=e.fn(r,o,n));const a=i(e),s=e.primitiveName;for(const e of t)if(e.primitiveName===s){const t=W(e.propertyName);if(null!=e.value){const i=O(e.value,e.propertyName);i!==a[t]&&(a[t]=i)}}return a}}_analyzePrimitiveOverrides(e,t,i,r){let o=!1,n="";"string"==typeof e&&(e=[e]);for(const a of this._primitiveOverrides)e?.includes(a.primitiveName)&&(null!=a.value?n+=`-${a.primitiveName}-${a.propertyName}-${JSON.stringify(a.value)}`:a.valueExpressionInfo&&(o=!0));return null!=t&&"function"==typeof t&&(o=!0),null!=i&&"function"==typeof i&&(o=!0),null!=r&&"function"==typeof r&&(o=!0),[o,n]}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter((i=>i.primitiveName!==e||!t.includes(i.propertyName)))}_transformSize(e,t){return L(e)||L(t)?(i,r,o)=>(L(e)?e(i,r,o):e)*(L(t)?t(i,r,o):t):e*t}_transformRotation(e,t,i){return L(e)||L(i)?(r,o,n)=>{const a=L(e)?e(r,o,n):e,s=L(i)?i(r,o,n):i;return t?s-a:s+a}:t?i-e:i+e}_transformOffsetX(e,t,i,r,o){if(!(L(e)||L(t)||L(i)||L(r)||L(o))){const n=i*Math.PI/180;if(n){const i=Math.cos(n),a=Math.sin(n);return(i*e-a*t)*r+o}return e*r+o}return(n,a,s)=>{let l=L(i)?i(n,a,s):i;const c=L(r)?r(n,a,s):r,m=L(e)?e(n,a,s):e,f=L(o)?o(n,a,s):o;if(l){l*=Math.PI/180;return(Math.cos(l)*m-Math.sin(l)*(L(t)?t(n,a,s):t))*c+f}return m*c+f}}_transformOffsetY(e,t,i,r,o){if(!(L(e)||L(t)||L(i)||L(r)||L(o))){const n=i*Math.PI/180;if(n){const i=Math.cos(n);return(Math.sin(n)*e+i*t)*r+o}return t*r+o}return(n,a,s)=>{let l=L(i)?i(n,a,s):i;const c=L(r)?r(n,a,s):r,m=L(t)?t(n,a,s):t,f=L(o)?o(n,a,s):o;if(l){l*=Math.PI/180;const t=Math.cos(l);return(Math.sin(l)*(L(e)?e(n,a,s):e)+t*m)*c+f}return m*c+f}}}function D(e){if(e&&0===e.indexOf("Level_")){const t=parseInt(e.substr(6),10);if(!isNaN(t))return t}return 0}function U(t){if(!t||0===t.length)return null;const i=new e(t).toRgba();return{r:i[0],g:i[1],b:i[2],a:i[3]}}function W(e){return e?e.charAt(0).toLowerCase()+e.substr(1):e}function V(e,t){if(!t||0===t.length)return e;const r=i(e);return y.applyOverrides(r,t),r}const B=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&!e[0].effects&&!e[1].effects;export{G as CIMAnalyzer,V as analyzeCIMResource};
|
|
5
|
+
import e from"../../Color.js";import{getFontFamily as t}from"../../core/fontUtils.js";import{clone as i}from"../../core/lang.js";import r from"../../core/Logger.js";import{pt2px as o,px2pt as n}from"../../core/screenUtils.js";import{numericHash as a}from"../../core/string.js";import{createRendererExpression as s,ArcadeExpression as l}from"../../support/arcadeOnDemand.js";import{DEFAULT_PICTURE_FILL_HEIGHT as c,DEFAULT_HATCH_FILL_SEPARATION as m,DEFAULT_STROKE_WIDTH as f,DEFAULT_MARKER_SIZE as h,DEFAULT_TEXT_HEIGHT as u}from"./CIMSymbolDrawHelper.js";import{CIMSymbolHelper as p,OverrideHelper as y}from"./CIMSymbolHelper.js";import{Alignment as d,CapType as v,JoinType as _}from"./enums.js";import{quantizeIfNeeded as O}from"./quantizeTime.js";import{getExtent as S,getSDFMetrics as g}from"./SDFHelper.js";import{fromCIMColor as M,getTintColor as k,getValue as b,getFillColor as N,getStrokeColor as P,getStrokeWidth as z,isFeatureValueFn as L,fromCIMFontDecoration as C,fromCIMFontStyle as F,adjustTextCase as I,createLabelOverrideFunction as w,evaluateValueOrFunction as x,fromCIMHorizontalAlignment as A,fromCIMVerticalAlignment as R}from"./utils.js";import{CIMEffectHelper as X}from"./effects/CIMEffectHelper.js";import H from"../../views/2d/arcade/callExpressionWithFeature.js";import{RANDOM_INSIDE_POLYGON_TEXTURE_SIZE as J}from"../../views/2d/engine/webgl/definitions.js";import{getMaterialGroup as Y}from"../../views/2d/engine/webgl/grouping.js";const E=r.getLogger("esri.symbols.cim.cimAnalyzer");function T(e){switch(e){case"Butt":return v.BUTT;case"Square":return v.SQUARE;default:return v.ROUND}}function $(e){switch(e){case"Bevel":return _.BEVEL;case"Miter":return _.MITER;default:return _.ROUND}}function j(e){const t=e.markerPlacement;return t&&t.angleToLine?d.MAP:d.SCREEN}class G{constructor(e,t){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._resourceManager=e,this._info=t}async analyzeSymbolReference(e,t,i){if(this._cimLayers=i??[],!e)return this._cimLayers;if(e.primitiveOverrides){this._primitiveOverrides=e.primitiveOverrides,this._poMap={};const t=[],i=this._info;for(const e of this._primitiveOverrides){const r=e.valueExpressionInfo;if(r&&i){const o=r.expression,n=s(o,i.spatialReference,i.fields).then((t=>{null!=t&&this._setPoMap(e.primitiveName,e.propertyName,t)}));t.push(n)}else null!=e.value&&this._setPoMap(e.primitiveName,e.propertyName,e.value);t.length>0&&await Promise.all(t)}}const r=e.symbol,o=[];return p.fetchResources(r,this._resourceManager,o),o.length>0&&await Promise.all(o),this._analyzeSymbol(r,t),this._cimLayers}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t,1,0,0,0)}}_analyzeMultiLayerSymbol(e,t,i,r,o,n){const a=e?.symbolLayers;if(!a)return;const s=e.effects;let l=d.SCREEN;const c=p.getSize(e)??0;"CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(l=d.MAP);const m="CIMPolygonSymbol"===e.type;let f=a.length;for(;f--;){const h=a[f];if(!h||!1===h.enable)continue;let u;s&&s.length&&(u=[...s]);const p=h.effects;p&&p.length&&(s?u.push(...p):u=[...p]);const d=[];let v;y.findEffectOverrides(u,this._primitiveOverrides,d),v=d.length>0?this._createEffectsOverrideFunction(u,d):u;const _=[];switch(y.findApplicableOverrides(h,this._primitiveOverrides,_),h.type){case"CIMSolidFill":this._analyzeSolidFill(h,v);break;case"CIMPictureFill":this._analyzePictureFill(h,v);break;case"CIMHatchFill":this._analyzeHatchFill(h,v);break;case"CIMGradientFill":this._analyzeGradientFill(h,v);break;case"CIMSolidStroke":this._analyzeSolidStroke(h,v,m,c);break;case"CIMPictureStroke":this._analyzePictureStroke(h,v,m,c);break;case"CIMGradientStroke":this._analyzeGradientStroke(h,v,m,c);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{"CIMLineSymbol"===e.type&&(l=j(h));const a=[],s=h.primitiveName;s&&a.push(s),this._analyzeMarker(h,v,null,a,l,c,1,t,i,r,o,n);break}default:E.error("Cannot analyze CIM layer",h.type)}}}_analyzeSolidFill(e,t){const i=e.primitiveName,r=M(e.color),[o,n]=this._analyzePrimitiveOverrides(i,t,null,null),s=a(JSON.stringify(e)+n).toString();this._cimLayers.push({type:"fill",templateHash:s,materialHash:o?()=>s:s,cim:e,materialOverrides:null,colorLocked:!!e.colorLocked,color:this._createOverrideFunction(i,"Color",r,U),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0})}_analyzePictureFill(e,t){const i=e.primitiveName,r=k(e),[o,n]=this._analyzePrimitiveOverrides(i,t,null,null),s=a(JSON.stringify(e)+n).toString(),l=a(`${e.url}${JSON.stringify(e.colorSubstitutions)}`).toString(),m=b(e.height,c);let f=b(e.scaleX,1);if("width"in e&&"number"==typeof e.width){const t=e.width;let i=1;const r=this._resourceManager.getResource(e.url);null!=r&&(i=r.width/r.height),f/=i*(m/t)}this._cimLayers.push({type:"fill",templateHash:s,materialHash:o?()=>l:l,cim:e,materialOverrides:null,colorLocked:!!e.colorLocked,effects:t,color:this._createOverrideFunction(i,"TintColor",r,U),height:this._createOverrideFunction(i,"Height",m),scaleX:this._createOverrideFunction(i,"ScaleX",f),angle:this._createOverrideFunction(i,"Rotation",b(e.rotation)),offsetX:this._createOverrideFunction(i,"OffsetX",b(e.offsetX)),offsetY:this._createOverrideFunction(i,"OffsetY",b(e.offsetY)),url:e.url,applyRandomOffset:!1,sampleAlphaOnly:!1})}_analyzeHatchFill(e,t){const i=e.primitiveName,r=this._analyzeMaterialOverrides(i,["Rotation","OffsetX","OffsetY"]);let[o,n]=this._analyzePrimitiveOverrides(i,t,null,null);const s=a(JSON.stringify(e)+n).toString(),l=a(`${e.separation}${JSON.stringify(e.lineSymbol)}`).toString();let c={r:255,g:255,b:255,a:1},f=!1;const h=e.lineSymbol?.symbolLayers?.find((e=>"CIMSolidStroke"===e.type&&null!=this._poMap[e.primitiveName]?.Color));if(h){c=M(h.color),c=this._createOverrideFunction(h.primitiveName,"Color",c,U);const e="function"==typeof c;o=o||e,f=null!=h.color||e}this._cimLayers.push({type:"fill",templateHash:s,materialHash:o&&r?this._createMaterialHashFunction(l,r):l,cim:e,materialOverrides:r,colorLocked:!!e.colorLocked,effects:t,color:c,height:this._createOverrideFunction(i,"Separation",b(e.separation,m)),scaleX:1,angle:this._createOverrideFunction(i,"Rotation",b(e.rotation)),offsetX:this._createOverrideFunction(i,"OffsetX",b(e.offsetX)),offsetY:this._createOverrideFunction(i,"OffsetY",b(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!f})}_analyzeGradientFill(e,t){const i=e.primitiveName,[r,o]=this._analyzePrimitiveOverrides(i,t,null,null),n=a(JSON.stringify(e)+o).toString();this._cimLayers.push({type:"fill",templateHash:n,materialHash:r?()=>n:n,cim:e,materialOverrides:null,colorLocked:!!e.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1})}_analyzeSolidStroke(e,t,i,r){const o=e.primitiveName,n=M(e.color),s=b(e.width,f),l=T(e.capStyle),c=$(e.joinStyle),m=e.miterLimit,[h,u]=this._analyzePrimitiveOverrides(o,t,null,null),p=a(JSON.stringify(e)+u).toString();let y,d;if(t&&t instanceof Array&&t.length>0){const e=t[t.length-1];if("CIMGeometricEffectDashes"===e.type&&"NoConstraint"===e.lineDashEnding&&null===e.offsetAlongLine){const e=(t=[...t]).pop();y=e.dashTemplate,d=e.scaleDash}}this._cimLayers.push({type:"line",templateHash:p,materialHash:h?()=>p:p,cim:e,materialOverrides:null,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:this._createOverrideFunction(o,"Color",n,U),width:this._createOverrideFunction(o,"Width",s),cap:this._createOverrideFunction(o,"CapStyle",l),join:this._createOverrideFunction(o,"JoinStyle",c),miterLimit:m&&this._createOverrideFunction(o,"MiterLimit",m),referenceWidth:r,zOrder:D(e.name),dashTemplate:y,scaleDash:d,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,i,r){const o=a(`${e.url}${JSON.stringify(e.colorSubstitutions)}`).toString(),n=e.primitiveName,s=k(e),l=b(e.width,f),c=T(e.capStyle),m=$(e.joinStyle),h=e.miterLimit,[u,p]=this._analyzePrimitiveOverrides(n,t,null,null),y=a(JSON.stringify(e)+p).toString();this._cimLayers.push({type:"line",templateHash:y,materialHash:u?()=>o:o,cim:e,materialOverrides:null,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:this._createOverrideFunction(n,"TintColor",s,U),width:this._createOverrideFunction(n,"Width",l),cap:this._createOverrideFunction(n,"CapStyle",c),join:this._createOverrideFunction(n,"JoinStyle",m),miterLimit:h&&this._createOverrideFunction(n,"MiterLimit",h),referenceWidth:r,zOrder:D(e.name),dashTemplate:null,scaleDash:!1,url:e.url,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,i,r){const o=e.primitiveName,n=b(e.width,f),s=T(e.capStyle),l=$(e.joinStyle),c=e.miterLimit,[m,h]=this._analyzePrimitiveOverrides(o,t,null,null),u=a(JSON.stringify(e)+h).toString();this._cimLayers.push({type:"line",templateHash:u,materialHash:m?()=>u:u,cim:e,materialOverrides:null,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},width:this._createOverrideFunction(o,"Width",n),cap:this._createOverrideFunction(o,"CapStyle",s),join:this._createOverrideFunction(o,"JoinStyle",l),miterLimit:c&&this._createOverrideFunction(o,"MiterLimit",c),referenceWidth:r,zOrder:D(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,t,i,r,o,n,a,s,l,c,m,f,u=!1){if(this._analyzeMarkerInsidePolygon(e,t))return;const p=b(e.size,h),y=b(e.rotation),d=b(e.offsetX),v=b(e.offsetY);let _=this._createOverrideFunction(e.primitiveName,"Size",p),O=this._createOverrideFunction(e.primitiveName,"Rotation",y),S=this._createOverrideFunction(e.primitiveName,"OffsetX",d),g=this._createOverrideFunction(e.primitiveName,"OffsetY",v);_=this._transformSize(_,a),O=this._transformRotation(O,!!e.rotateClockwise,c);const M=this._transformOffsetX(S,g,c,a,m),k=this._transformOffsetY(S,g,c,a,f);switch(S=M,g=k,e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,i,r,o,n,_,O,S,g,e.colorLocked||u);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,i,r,o,n,a,s,_,O,S,g,e.colorLocked||u)}}_analyzeMarkerInsidePolygon(e,t){const{markerPlacement:i,type:r}=e;if(!i||"CIMMarkerPlacementInsidePolygon"!==i.type)return!1;if("CIMVectorMarker"===r||"CIMPictureMarker"===r){const o=e.primitiveName;if(o){const[e,i]=this._analyzePrimitiveOverrides([o],t,null,null);if(e)return!1}const n=i.primitiveName;if(n){const[e,i]=this._analyzePrimitiveOverrides([n],t,null,null);if(e)return!1}if("CIMVectorMarker"===r){const{markerGraphics:t}=e;if(t)for(const e of t){const{symbol:t}=e;if("CIMPolygonSymbol"===t?.type&&t.symbolLayers){const{symbolLayers:e}=t;for(const t of e)if("CIMSolidStroke"===t.type)return!1}}}else{const{animatedSymbolProperties:t}=e;if(t)return!1}}const o=i,s=Math.abs(o.stepX),l=Math.abs(o.stepY);if(0===s||0===l)return!0;const c=["Rotation","OffsetX","OffsetY"],m=this._primitiveOverrides.filter((t=>t.primitiveName!==e.primitiveName||!c.includes(t.propertyName))),f="url"in e&&"string"==typeof e.url?e.url:void 0,h=a(JSON.stringify(e)).toString();let u,p,y=null;if("Random"===i.gridType){const e=n(J),t=Math.max(Math.floor(e/s),1),i=Math.max(Math.floor(e/l),1);u=l*i,y=e=>e?e*i:0;p=t*s/u}else i.shiftOddRows?(u=2*l,y=e=>e?2*e:0,p=s/l*.5):(u=l,y=null,p=s/l);const d=k(e);return this._cimLayers.push({type:"fill",templateHash:h,materialHash:h,cim:e,materialOverrides:m,colorLocked:!!e.colorLocked,effects:t,color:d,height:this._createOverrideFunction(o.primitiveName,"StepY",u,y),scaleX:p,angle:o.gridAngle,offsetX:b(o.offsetX),offsetY:b(o.offsetY),url:f,applyRandomOffset:"Random"===i.gridType,sampleAlphaOnly:!f,hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,i,r,o,n,s,l,c,m,f){let h=b(e.scaleX,1);const u=k(e),p=a(`${e.url}${JSON.stringify(e.colorSubstitutions)}${JSON.stringify(e.animatedSymbolProperties)}`).toString();i||(i=this._createMarkerPlacementOverrideFunction(e.markerPlacement));const y=this._createAnimatedSymbolPropertiesOverrideFunction(e.animatedSymbolProperties),[d,v]=this._analyzePrimitiveOverrides(r,t,i,y),_=a(JSON.stringify(e)+v).toString(),O=e.anchorPoint??{x:0,y:0};if("width"in e&&"number"==typeof e.width){const t=e.width;let i=1;const r=this._resourceManager.getResource(e.url);null!=r&&(i=r.width/r.height);h/=i*(b(e.size)/t)}function S(e,t){return null!=y?x(y,e,t):null}const g=e.animatedSymbolProperties&&!0===e.animatedSymbolProperties.randomizeStartTime?(e,t,i,r)=>{const o=Y(r??0),n=S(e,t);return p+`-MATERIALGROUP(${o})`+`-ASP(${JSON.stringify(n)})`}:d?(e,t)=>{const i=S(e,t);return p+`-ASP(${JSON.stringify(i)})`}:p;this._cimLayers.push({type:"marker",templateHash:_,materialHash:g,cim:e,materialOverrides:null,colorLocked:!!e.colorLocked||!!f,effects:t,scaleSymbolsProportionally:!1,alignment:o,size:s,scaleX:this._createOverrideFunction(e.primitiveName,"ScaleX",h),rotation:l,offsetX:c,offsetY:m,color:this._createOverrideFunction(e.primitiveName,"TintColor",u,U),anchorPoint:{x:O.x,y:O.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:!1,referenceSize:n,sizeRatio:1,markerPlacement:i,url:e.url,animatedSymbolProperties:y})}_analyzeVectorMarker(e,t,i,r,o,n,a,s,l,c,m,f,h){const u=e.markerGraphics;if(!u)return;const p=e.frame;let y=0,d=1;e.scaleSymbolsProportionally&&p&&(y=p.ymax-p.ymin,d=this._transformSize(l,1/y)),d=this._transformSize(d,a),i||(i=this._createMarkerPlacementOverrideFunction(e.markerPlacement));for(const v of u)if(v){const a=v.symbol;if(!a)continue;const u=v.primitiveName;u&&r.push(u);let _=m,O=f;if(("CIMPointSymbol"===a.type||"CIMTextSymbol"===a.type)&&p){let t=0,i=0;const r=v.geometry;"x"in r&&"y"in r&&(t+=r.x-.5*(p.xmin+p.xmax),i+=r.y-.5*(p.ymin+p.ymax));const o=e.anchorPoint;o&&("Absolute"===e.anchorPointUnits?(t-=o.x,i-=o.y):p&&(t-=(p.xmax-p.xmin)*o.x,i-=(p.ymax-p.ymin)*o.y)),_=this._transformOffsetX(t,i,c,d,m),O=this._transformOffsetY(t,i,c,d,f)}switch(a.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":s?this._analyzeMultiLayerGraphicNonSDF(e,t,i,null,v,r,o,n,y,!!h||!!e.colorLocked):this._analyzeMultiLayerGraphic(e,t,i,null,v,r,o,n,y,d,l,c,_,O,!!h||!!e.colorLocked);break;case"CIMTextSymbol":this._analyzeTextGraphic(e,t,i,v,r,o,n,y,d,l,c,_,O,!!h||!!e.colorLocked)}u&&r.pop()}}_analyzeMultiLayerGraphic(e,t,i,r,o,n,s,l,c,m,f,h,u,p,y){const d=o.symbol,v=d.symbolLayers;if(!v)return;let _=v.length;if(B(v))return void this._analyzeCompositeMarkerGraphic(e,t,i,r,o,v,n,s,l,c,f,h,u,p,!!y||!!e.colorLocked);const O=this._resourceManager.geometryEngine,k=X.applyEffects(d.effects,o.geometry,O);if(k)for(;_--;){const d=v[_];if(!d||!1===d.enable)continue;const b=d.primitiveName;switch(b&&n.push(b),d.type){case"CIMSolidFill":case"CIMSolidStroke":{const m=X.applyEffects(d.effects,k,O),v=S(m);if(!v)continue;const _="Relative"!==e.anchorPointUnits,[C,F,I]=g(v,e.frame,e.size,e.anchorPoint,_),w="CIMSolidFill"===d.type,x={type:"sdf",geom:m,asFill:w},A=d.path,R=M(w?N(d):P(d)),H=w?{r:0,g:0,b:0,a:0}:M(P(d)),J=z(d)??0;if(!w&&!J)break;const Y=o.primitiveName;let E=null;w&&!d.colorLocked&&(E=this._createOverrideFunction(Y,"FillColor",R,U));let T=null;w||d.colorLocked||(T=this._createOverrideFunction(Y,"StrokeColor",H,U));const $=this._createOverrideFunction(Y,"StrokeWidth",J);let j=!1,G="";for(const e of this._primitiveOverrides)n.includes(e.primitiveName)&&(null!=e.value?G+=`-${e.primitiveName}-${e.propertyName}-${JSON.stringify(e.value)}`:e.valueExpressionInfo&&(j=!0));(null!=t&&"function"==typeof t||null!=i&&"function"==typeof i)&&(j=!0),(L(f)||L(h)||L(u)||L(p))&&(j=!0);const D=JSON.stringify({...e,markerGraphics:null}),W=a(JSON.stringify(x)+A).toString(),V=a(JSON.stringify(o)+JSON.stringify(d)+D+G).toString();this._cimLayers.push({type:"marker",templateHash:V,materialHash:j?()=>W:W,cim:x,materialOverrides:null,colorLocked:!!d.colorLocked||!!y,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:F,y:I},isAbsoluteAnchorPoint:_,size:f,rotation:h,offsetX:u,offsetY:p,scaleX:1,frameHeight:c,rotateClockwise:!1,referenceSize:l,sizeRatio:C,color:L(E)?E:this._createOverrideFunction(b,"Color",R,U),outlineColor:L(T)?T:this._createOverrideFunction(b,"Color",H,U),outlineWidth:L($)?$:this._createOverrideFunction(b,"Width",J),markerPlacement:i,animatedSymbolProperties:r,path:A});break}case"CIMVectorMarker":d.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,t,i,r,o,n,s,l,c,!!y||!!d.colorLocked):this._analyzeMarker(d,t,i,n,s,l,m,!1,f,h,u,p,!!y||!!e.colorLocked);break;default:this._analyzeMultiLayerGraphicNonSDF(e,t,i,r,o,n,s,l,c,!!y||!!e.colorLocked)}b&&n.pop()}}_analyzeTextGraphic(e,i,r,o,n,s,l,c,m,h,p,d,v,_){const O=[];y.findApplicableOverrides(o,this._primitiveOverrides,O);const S=o.geometry;if(!("x"in S)||!("y"in S))return;const g=o.symbol,k=C(g),X=F(g.fontStyleName),H=t(g.fontFamilyName);g.font={family:H,decoration:k,...X};let J=b(g.height,u),Y=b(g.angle),E=b(g.offsetX),T=b(g.offsetY);J=this._transformSize(J,m),Y=this._transformRotation(Y,!1,p);const $=this._transformOffsetX(E,T,p,m,d),j=this._transformOffsetY(E,T,p,m,v);E=$,T=j;const G=M(N(g));let D=M(P(g)),W=z(g)??0;W||(D=M(N(g.haloSymbol)),W=b(g.haloSize)),W=this._transformSize(W,m);let V=!1;if(g.symbol?.symbolLayers)for(const t of g.symbol.symbolLayers){null!=N(t)&&(V=!!t.colorLocked)}const B=o.primitiveName;let q=null;V||(q=this._createOverrideFunction(B,"Color",G,U));let K=null,Q=null,Z=0;if(g.callout&&"CIMBackgroundCallout"===g.callout.type){const e=g.callout;if(e.backgroundSymbol){const t=e.backgroundSymbol.symbolLayers;if(t)for(const e of t)"CIMSolidFill"===e.type?K=M(e.color):"CIMSolidStroke"===e.type&&(Q=M(e.color),Z=b(e.width,f))}}const[ee,te]=this._analyzePrimitiveOverrides(n,i,r,null),ie=JSON.stringify(e.effects)+Number(e.colorLocked||_).toString()+JSON.stringify(e.anchorPoint)+e.anchorPointUnits+JSON.stringify(e.markerPlacement)+e.size.toString(),re=a(JSON.stringify(o)+ie+te).toString();let oe=this._createOverrideFunction(o.primitiveName,"TextString",o.textString??"",I,g.textCase);if(null==oe)return;const{fontStyleName:ne}=g,ae=H+(ne?"-"+ne.toLowerCase():"-regular"),se=ae;"string"==typeof oe&&oe.includes("[")&&g.fieldMap&&(oe=w(g.fieldMap,oe,g.textCase)),this._cimLayers.push({type:"text",templateHash:re,materialHash:ee||"function"==typeof oe||/\[(.*?)\]/.test(oe)?(e,t,i)=>se+"-"+x(oe,e,t,i):se+"-"+a(oe),cim:g,materialOverrides:null,colorLocked:!!_||!!V,effects:i,alignment:s,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,fontName:ae,decoration:k,weight:X.weight,style:X.style,size:J,angle:Y,offsetX:E,offsetY:T,horizontalAlignment:A(g.horizontalAlignment),verticalAlignment:R(g.verticalAlignment),text:oe,color:L(q)?q:G,outlineColor:D,outlineSize:W,backgroundColor:K,borderLineColor:Q,borderLineWidth:Z,referenceSize:l,sizeRatio:1,markerPlacement:r})}_analyzeMultiLayerGraphicNonSDF(e,t,i,r,n,s,l,c,m,f){const u=this._buildSimpleMarker(e,n),y=e.primitiveName,d=this._analyzeMaterialOverrides(y,["Rotation","OffsetX","OffsetY"]),[v,_]=this._analyzePrimitiveOverrides(s,null,null,null),[O,S,g]=p.getTextureAnchor(u,this._resourceManager),M=b(e.rotation),k=b(e.offsetX),N=b(e.offsetY),P=a(JSON.stringify(u)+_).toString(),z=d&&d.length>0||null!=t&&"function"==typeof t;this._cimLayers.push({type:"marker",templateHash:P,materialHash:z&&d?this._createMaterialHashFunction(P,d):P,cim:u,materialOverrides:d,colorLocked:!!e.colorLocked||!!f,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:l,anchorPoint:{x:O,y:S},isAbsoluteAnchorPoint:!1,size:b(e.size,h),rotation:this._createOverrideFunction(y,"Rotation",M),offsetX:this._createOverrideFunction(y,"OffsetX",k),offsetY:this._createOverrideFunction(y,"OffsetY",N),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:m,rotateClockwise:!!e.rotateClockwise,referenceSize:c,sizeRatio:g/o(e.size),markerPlacement:i,animatedSymbolProperties:r,avoidSDFRasterization:!0})}_buildSimpleMarker(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}_analyzeCompositeMarkerGraphic(e,t,i,r,o,n,s,l,c,m,h,u,p,y,d){const v=o.geometry,_=n[0],O=n[1],k=S(v);if(!k)return;const N="Relative"!==e.anchorPointUnits,[P,z,C]=g(k,e.frame,e.size,e.anchorPoint,N),F={type:"sdf",geom:v,asFill:!0},I=O.path,w=O.primitiveName,x=_.primitiveName,A=M(O.color),R=M(_.color),X=b(_.width,f),H=o.primitiveName;let J=null;O.colorLocked||d||(J=this._createOverrideFunction(H,"FillColor",A,U));let Y=null;_.colorLocked||d||(Y=this._createOverrideFunction(H,"StrokeColor",R,U));const E=this._createOverrideFunction(H,"StrokeWidth",X);let T=!1,$="";for(const a of this._primitiveOverrides)(a.primitiveName===w||a.primitiveName===x||s.includes(a.primitiveName))&&(null!=a.value?$+=`-${a.primitiveName}-${a.propertyName}-${JSON.stringify(a.value)}`:a.valueExpressionInfo&&(T=!0));null!=i&&"function"==typeof i&&(T=!0),(L(h)||L(u)||L(p)||L(y))&&(T=!0);const j=JSON.stringify({...e,markerGraphics:null}),G=a(JSON.stringify(F)+I).toString(),D=a(JSON.stringify(o)+JSON.stringify(O)+JSON.stringify(_)+j+$).toString();this._cimLayers.push({type:"marker",templateHash:D,materialHash:T?()=>G:G,cim:F,materialOverrides:null,colorLocked:!!d,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:l,anchorPoint:{x:z,y:C},isAbsoluteAnchorPoint:N,size:h,rotation:u,offsetX:p,offsetY:y,scaleX:1,frameHeight:m,rotateClockwise:!1,referenceSize:c,sizeRatio:P,color:L(J)?J:this._createOverrideFunction(w,"Color",A,U),outlineColor:L(Y)?Y:this._createOverrideFunction(x,"Color",R,U),outlineWidth:L(E)?E:this._createOverrideFunction(x,"Width",X),markerPlacement:i,path:I,animatedSymbolProperties:r})}_createMaterialHashFunction(e,t){const i=this._info?.geometryType;if(i){const e=this._poMap;for(const r of t){if(r.valueExpressionInfo){const t=e[r.primitiveName]&&e[r.primitiveName][r.propertyName];t instanceof l&&(r.fn=(e,r,o)=>H(t,e,{$view:o},i,r))}}}return(i,r,o)=>{for(const e of t)e.fn&&(e.value=e.fn(i,r,o));return a(e+y.buildOverrideKey(t)).toString()}}_setPoMap(e,t,i){let r;this._poMap[e]?r=this._poMap[e]:(r={},this._poMap[e]=r),r[t]=i}_createOverrideFunction(e,t,i,r,o){if(null==e)return i;const n=this._poMap[e];if(null==n)return i;const a=n[t];if("string"==typeof a||"number"==typeof a||a instanceof Array)return r?r.call(null,a,o):a;const s=this._info?.geometryType;return null!=a&&a instanceof l&&null!=s?(e,t,n)=>{let l=H(a,e,{$view:n},s,t);return null!==l&&r&&(l=r.call(null,l,o)),null!==l?l:i}:i}_createEffectsOverrideFunction(e,t){const r=this._poMap,o=this._info?.geometryType;for(const i of t){if(i.valueExpressionInfo&&o){const e=r[i.primitiveName]&&r[i.primitiveName][i.propertyName];e instanceof l&&(i.fn=(t,i,r)=>H(e,t,{$view:r},o,i))}}return(r,o,n)=>{for(const e of t)e.fn&&(e.value=e.fn(r,o,n));const a=[];for(let s of e){const e=s?.primitiveName;if(e){let r=!1;for(const o of t)if(o.primitiveName===e){const e=W(o.propertyName);null!=o.value&&o.value!==s[e]&&(r||(s=i(s),r=!0),s[e]=o.value)}}a.push(s)}return a}}_createMarkerPlacementOverrideFunction(e){const t=[];if(y.findApplicableOverrides(e,this._primitiveOverrides,t),null==e||0===t.length)return e;const r=this._poMap,o=this._info?.geometryType;for(const i of t){if(i.valueExpressionInfo&&o){const e=r[i.primitiveName]&&r[i.primitiveName][i.propertyName];e instanceof l&&(i.fn=(t,i,r)=>H(e,t,{$view:r},o,i))}}return(r,o,n)=>{for(const e of t)e.fn&&(e.value=e.fn(r,o,n));const a=i(e),s=e.primitiveName;for(const e of t)if(e.primitiveName===s){const t=W(e.propertyName);null!=e.value&&e.value!==a[t]&&(a[t]=e.value)}return a}}_createAnimatedSymbolPropertiesOverrideFunction(e){const t=[];if(y.findApplicableOverrides(e,this._primitiveOverrides,t),null==e||0===t.length)return e;const r=this._info?.geometryType;if(r){const e=this._poMap;for(const i of t){if(i.valueExpressionInfo){const t=e[i.primitiveName]&&e[i.primitiveName][i.propertyName];t instanceof l&&(i.fn=(e,i,o)=>H(t,e,{$view:o},r,i))}}}return(r,o,n)=>{for(const e of t)e.fn&&(e.value=e.fn(r,o,n));const a=i(e),s=e.primitiveName;for(const e of t)if(e.primitiveName===s){const t=W(e.propertyName);if(null!=e.value){const i=O(e.value,e.propertyName);i!==a[t]&&(a[t]=i)}}return a}}_analyzePrimitiveOverrides(e,t,i,r){let o=!1,n="";"string"==typeof e&&(e=[e]);for(const a of this._primitiveOverrides)e?.includes(a.primitiveName)&&(null!=a.value?n+=`-${a.primitiveName}-${a.propertyName}-${JSON.stringify(a.value)}`:a.valueExpressionInfo&&(o=!0));return null!=t&&"function"==typeof t&&(o=!0),null!=i&&"function"==typeof i&&(o=!0),null!=r&&"function"==typeof r&&(o=!0),[o,n]}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter((i=>i.primitiveName!==e||!t.includes(i.propertyName)))}_transformSize(e,t){return L(e)||L(t)?(i,r,o)=>(L(e)?e(i,r,o):e)*(L(t)?t(i,r,o):t):e*t}_transformRotation(e,t,i){return L(e)||L(i)?(r,o,n)=>{const a=L(e)?e(r,o,n):e,s=L(i)?i(r,o,n):i;return t?s-a:s+a}:t?i-e:i+e}_transformOffsetX(e,t,i,r,o){if(!(L(e)||L(t)||L(i)||L(r)||L(o))){const n=i*Math.PI/180;if(n){const i=Math.cos(n),a=Math.sin(n);return(i*e-a*t)*r+o}return e*r+o}return(n,a,s)=>{let l=L(i)?i(n,a,s):i;const c=L(r)?r(n,a,s):r,m=L(e)?e(n,a,s):e,f=L(o)?o(n,a,s):o;if(l){l*=Math.PI/180;return(Math.cos(l)*m-Math.sin(l)*(L(t)?t(n,a,s):t))*c+f}return m*c+f}}_transformOffsetY(e,t,i,r,o){if(!(L(e)||L(t)||L(i)||L(r)||L(o))){const n=i*Math.PI/180;if(n){const i=Math.cos(n);return(Math.sin(n)*e+i*t)*r+o}return t*r+o}return(n,a,s)=>{let l=L(i)?i(n,a,s):i;const c=L(r)?r(n,a,s):r,m=L(t)?t(n,a,s):t,f=L(o)?o(n,a,s):o;if(l){l*=Math.PI/180;const t=Math.cos(l);return(Math.sin(l)*(L(e)?e(n,a,s):e)+t*m)*c+f}return m*c+f}}}function D(e){if(e&&0===e.indexOf("Level_")){const t=parseInt(e.substr(6),10);if(!isNaN(t))return t}return 0}function U(t){if(!t||0===t.length)return null;const i=new e(t).toRgba();return{r:i[0],g:i[1],b:i[2],a:i[3]}}function W(e){return e?e.charAt(0).toLowerCase()+e.substr(1):e}function V(e,t){if(!t||0===t.length)return e;const r=i(e);return y.applyOverrides(r,t),r}const B=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&!e[0].effects&&!e[1].effects;export{G as CIMAnalyzer,V as analyzeCIMResource};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{isSome as r}from"../../../../../core/arrayUtils.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as s,after as i,throwIfAborted as a,throwIfNotAbortError as o,isAbortError as n}from"../../../../../core/promiseUtils.js";import{when as u,watch as g,whenOnce as l}from"../../../../../core/reactiveUtils.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as c}from"../../../../../core/support/WatchUpdatingTracking.js";import{convertToGeometry as p}from"../../../../../layers/graphics/featureConversionUtils.js";import{QueryEngine as y}from"../../../../../layers/graphics/data/QueryEngine.js";import f from"../../../../../layers/support/FieldsIndex.js";import{FeatureStore2D as m}from"../FeatureStore2D.js";import{createSource as S}from"../sources/createSource.js";import _ from"../support/AttributeStore.js";import{BinStore as b}from"../support/BinStore.js";import{ClusterStore as v}from"../support/ClusterStore.js";import{ComputedAttributeStorage as I}from"../support/ComputedAttributeStorage.js";import{FeatureSetReaderJSON as Q}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as C}from"../support/UpdateToken.js";import{QueueProcessor as F}from"../../../../support/QueueProcessor.js";const E=5e3,w="tileRenderer.featuresView.attributeView.initialize",T="tileRenderer.featuresView.attributeView.requestUpdate",j="tileRenderer.featuresView.requestRender";function k(e){return"worker:port-closed"===e.name}function A(e){if(!n(e)&&!k(e))throw e}function U(e){return"feature"===e.type&&"snapshot"===e.mode}let x=class extends t{constructor(){super(...arguments),this._storage=new I,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this._updatingHandles=new c,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initStores(),this._initSource(),this._updateQueue=new F({concurrency:"stream"===this._source.type?1:4,process:(e,t)=>this._onTileMessage(e,{signal:t})}),this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this)),u((()=>!this.updating),(()=>this.onIdle()))])}_initSource(){const e=this.tileStore.tileScheme,t=()=>this._updateQueue&&this._updateQueue.length<50,r=(e,t)=>(this._invalidated=!0,this._patchTile(e,t));this._source=S(this.service,this.spatialReference,e,r,t,this.featureStore),this._proxyEvents()}_setStreamClientProperty(e,t){this.remoteClient.invoke("setProperty",{propertyName:e,value:t}).catch(A)}_proxyEvents(){if("stream"===this._source.type){const e=this._source.events,t=this._source;this.addHandles([g((()=>t.connectionStatus),(e=>this._setStreamClientProperty("pipelineConnectionStatus",e)),{initial:!0}),g((()=>t.errorString),(e=>this._setStreamClientProperty("pipelineErrorString",e)),{initial:!0}),e.on("data-received",(e=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}}).catch(A))),e.on("message-received",(e=>this.remoteClient.invoke("emitEvent",{name:"message-received",event:e}).catch(A))),e.on("updateRate",(e=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...e}}).catch(A)))])}}_initAttributeStore(e){this.attributeStore||(this.attributeStore=new _({type:"remote",initialize:(e,t)=>s(this.remoteClient.invoke(w,e,{signal:t}).catch(A)),update:(e,t)=>s(this.remoteClient.invoke(T,e,{signal:t}).catch(A)),render:e=>s(this.remoteClient.invoke(j,void 0,{signal:e}).catch(A))},e))}_initStores(){const e="snapshot"===this.service.type?"snapshot":"on-demand",t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new m(t,this._storage,e)}_initQueryEngine(e){const t=this;this.featureQueryEngine?.destroy(),this.featureQueryEngine=new y({definitionExpression:e.schema.source.definitionExpression??void 0,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds(e){if(null==t.aggregateStore)return[];return t.aggregateStore.getFeatureDisplayIdsForAggregate(e).map((e=>t.getObjectId(e)))}},timeInfo:this.service.timeInfo})}_initAggregateQueryEngine(e,t){if(this.aggregateQueryEngine?.destroy(),null==e)return;const r=t.targets.aggregate.params.fields.slice();this.aggregateQueryEngine=new y({definitionExpression:void 0,fields:r,geometryType:e.geometryInfo.geometryType,objectIdField:e.objectIdField,hasM:e.geometryInfo.hasM,hasZ:e.geometryInfo.hasZ,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!1,featureStore:e,aggregateAdapter:{getFeatureObjectIds:e=>[]}})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.featureQueryEngine?.destroy(),this.aggregateQueryEngine?.destroy(),this.attributeStore?.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating),this._updatingHandles.destroy()}get fieldsIndex(){return new f(this.service.fields)}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){const e=this._source.updatingHandles.updating,t=!this.attributeStore||this.attributeStore.updatingHandles.updating,r=e||t||this._updatingHandles.updating;if(has("esri-2d-log-updating")){let s=`Updating FeatureController2D: ${r}\n`;s+=` -> updatingSource ${e}\n`;for(const e of this._source.subscriptions)s+=` ${e.tile.id} ${e.isDone}\n`;s+=` -> updatingAttributeStore ${t}\n`,s+=` -> updatingHandles ${this._updatingHandles.updating} (queue: ${this._updateQueue.length})\n`,console.log(s)}return r}updateCustomParameters(e){"stream"===this._source.type&&this._source.updateCustomParameters(e)}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){"stream"===this._source.type&&this._source.pauseStream()}resumeStream(){"stream"===this._source.type&&this._source.resumeStream()}sendMessageToSocket(e){"stream"===this._source.type&&this._source.sendMessageToSocket(e)}sendMessageToClient(e){"stream"===this._source.type&&this._source.sendMessageToClient(e)}_initAggregateStore(e){const t=e.schema.targets?.aggregate?.type??null;if((this.config?.schema.targets?.aggregate?.type??null)!==t&&(null!=this.aggregateStore&&(this.removeHandles("valueRangesChanged"),this.aggregateStore.destroy(),this.aggregateStore=null),t)){switch(t){case"cluster":{const e={geometryInfo:{geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new v(e,this.spatialReference,this._storage,this.service),this.addHandles(this.aggregateStore.events.on("valueRangesChanged",(e=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:e.valueRanges}}).catch(A)})),"valueRangesChanged");break}case"bin":{const e={geometryInfo:{geometryType:"esriGeometryPolygon",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new b(e,this.spatialReference,this._storage,this.service);break}}this.aggregateStore.onTileUpdate({added:this.tileStore.tiles,removed:[]})}}async update(e,t){this._updateVersion++,has("esri-2d-update-debug")&&console.debug(`FeatureController2D::update: Token version ${this._updateVersion}`),this._initQueryEngine(t),this._initAttributeStore(t),this.pause(),await Promise.all([this._source.update(e,t.schema.source),this.featureStore.updateSchema(e,t.schema.targets.feature),this.attributeStore.update(e,t),this.attributeStore.updateFilters(e,t,this)]),this._initAggregateStore(t),null!=this.aggregateStore&&await this.aggregateStore.updateSchema(e,t.schema.targets.aggregate),this._initAggregateQueryEngine(this.aggregateStore,t.schema),has("esri-2d-update-debug")&&e.describe(),this._set("config",t)}async applyUpdate(e){e.version=this._updateVersion,has("esri-2d-update-debug")&&console.debug(`FeatureController2D::applyUpdate: Token version ${e.version}`),e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),has("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Waiting for source update to finish"),this.notifyChange("updating"),await l((()=>!this.updating)),has("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Source update finsihed"),null!=this.aggregateStore&&(await i(10),has("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Waiting for aggregate idle call"),await l((()=>!this.updating)),has("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Aggregate idle called")),has("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Update finished")}async onEdits({edits:e}){has("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const t=e.removed.map((e=>e.objectId&&-1!==e.objectId?e.objectId:this._lookupObjectIdByGlobalId(e.globalId))),r=e.addOrModified.map((({objectId:e})=>e));this.featureStore.invalidate(),await this._source.edit(r,t),this.clearTiles(),this.notifyChange("updating"),null!=this.aggregateStore&&this.aggregateStore.clear(),await this._source.resend(),await l((()=>!this.updating))}catch(t){}}async refresh(e){if(!e.dataChanged){const e=C.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion,e),this._cleanupNeeded=!0,this.notifyChange("updating"),await l((()=>!this.updating))}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e,!1)}onTileUpdate(e){null!=this.aggregateStore&&this.aggregateStore.onTileUpdate(e);for(const t of e.added)this._source.subscribe(t,this._updateVersion),this._level=t.level;for(const t of e.removed)this._source.unsubscribe(t),this._cleanupNeeded=!0,this._tileToResolver.has(t.id)&&(this._tileToResolver.get(t.id).resolve(),this._tileToResolver.delete(t.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,null==this.aggregateStore&&"heatmap"!==this.processor.type||await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:e,params:t}){return this.featureQueryEngine.executeQueryForSummaryStatistics(e,t)}async queryAggregateSummaryStatistics({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForSummaryStatistics(this._normalizeAggregateQuery(e),t)}async queryUniqueValues({query:e,params:t}){return this.featureQueryEngine.executeQueryForUniqueValues(e,t)}async queryAggregateUniqueValues({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForUniqueValues(this._normalizeAggregateQuery(e),t)}async queryClassBreaks({query:e,params:t}){return this.featureQueryEngine.executeQueryForClassBreaks(e,t)}async queryAggregateClassBreaks({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForClassBreaks(this._normalizeAggregateQuery(e),t)}async queryHistogram({query:e,params:t}){return this.featureQueryEngine.executeQueryForHistogram(e,t)}async queryAggregateHistogram({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForHistogram(this._normalizeAggregateQuery(e),t)}queryExtent(e){return this.featureQueryEngine.executeQueryForExtent(e)}queryAggregates(e){return this.aggregateQueryEngine.executeQuery(this._normalizeAggregateQuery(e))}queryAggregateCount(e){return this.aggregateQueryEngine.executeQueryForCount(this._normalizeAggregateQuery(e))}queryAggregateIds(e){return this.aggregateQueryEngine.executeQueryForIds(this._normalizeAggregateQuery(e))}queryFeatures(e){return this.featureQueryEngine.executeQuery(e)}async queryVisibleFeatures(e){const t=await this.featureQueryEngine.executeQuery(e),r=t.objectIdFieldName;return t.features=t.features.filter((e=>{const t=e.attributes[r],s=this.getDisplayId(t);return null!=s&&this.attributeStore.isVisible(s)})),t}queryFeatureCount(e){return this.featureQueryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.featureQueryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.featureQueryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(null!=this.aggregateStore){const t=this.aggregateStore.getDisplayId(e);if(null==t){const t=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(t)}return t}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const t=[],r=[];for(const s of e){const e=null!=this.aggregateStore?this.getAggregate(s):null;if(null!=e)if(null!=e.attributes.referenceId){const r=this.getFeature(e.attributes.referenceId);null!=r&&t.push(r)}else r.push(e);else{const e=this.getFeature(s);null!=e&&t.push(e)}}return{features:t,aggregates:r}}getFeature(e){const t=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if(null==t)return null;const r=t.readHydratedGeometry(),s=p(r,t.geometryType,t.hasZ,t.hasM);return{attributes:t.readAttributes(),geometry:s}}getAggregate(e){return null==this.aggregateStore?null:this.aggregateStore.getAggregate(e)}getAggregates(){return null==this.aggregateStore?[]:this.aggregateStore.getAggregates()}async setHighlight(e){const t=e.map((e=>this.getDisplayId(e))).filter(r);return this.attributeStore.setHighlight(e,t)}_normalizeAggregateQuery(e){const t=e.objectIds??[];for(const r of e.aggregateIds??[])t.push(r);return e.objectIds=t,e.aggregateIds=[],e}_lookupObjectIdByGlobalId(e){const t=this.service.globalIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let r=null;if(this.featureStore.forEach((s=>{e===s.readAttribute(t)&&(r=s.getObjectId())})),null==r)throw new Error(`Expected to find a feature with globalId ${e}`);return r}async _repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter((e=>e.level===this._level));e.map((async e=>this._patchTile({type:"append",id:e.key.id,clear:!0,addOrUpdate:null,end:!1})));const t=e.map((async e=>this._patchTile({type:"append",id:e.key.id,addOrUpdate:Q.fromOptimizedFeatures([],this.service),remove:[],end:!0,isRepush:!0,status:C.empty()})));await Promise.all(t)}_maybeForceCleanup(){performance.now()-this._lastCleanup>E&&this._markAndSweep()}_patchTile(e,t){const r=this._updateQueue.push(e,t).catch((e=>{}));return this._updatingHandles.addPromise(r)}async _onTileMessage(e,t){if(a(t),has("esri-2d-update-debug")){const t=e.addOrUpdate?.hasFeatures;console.debug(e.id,`FeatureController:onTileMessage: [clear:${e.clear}, end:${e.end}, features: ${t}]`)}const r=this.tileStore.get(e.id);if(!r)return;if(e.clear)return this.processor.onTileClear(r,e.end);const s=e.status;this._cleanupNeeded=!0;const i=[];for(const a of e.remove??[]){const e=this.featureStore.lookupDisplayId(a);e&&i.push(e)}e.remove=i;try{if(null==e.addOrUpdate)return void this.processor.onTileMessage(r,{...e,addOrUpdate:null},null!=this.aggregateStore,t).catch(o);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&s.targets.feature||(s.targets.feature=!0,this.featureStore.onTileData(r,e)),!s.storage.data||!s.storage.filters){s.storage.data=!0,s.storage.filters=!0,this.attributeStore.onTileData(r,e);"stream"===this._source.type||this._didEdit?(await this.attributeStore.sendUpdates(),a(t)):this.attributeStore.sendUpdates()}if(null!=this.aggregateStore&&!s.targets.aggregate){s.targets.aggregate=!0;const t=U(this._source)&&this._source.loading,i=!U(this._source)||t||e.end;if(this.aggregateStore.onTileData(r,e,this._storage,this.attributeStore,i),!i)return;s.mesh||(this.attributeStore.onTileData(r,e),await this.attributeStore.sendUpdates())}if(!s.mesh){s.mesh=!0;const i=null!=this.aggregateStore&&"cluster"===this.aggregateStore.type;await this.processor.onTileMessage(r,e,i,t),a(t)}this._maybeForceCleanup()}catch(n){o(n)}}_mark(e,t,r){const s=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(t.add(s),r.set(e))}_markAndSweep(){this._lastCleanup=performance.now();if(!(!("feature"===this._source.type&&"snapshot"===this._source.mode)&&("stream"===this._source.type||this._cleanupNeeded)))return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),t=new Set;e.clear();for(const r of this.tileStore.tiles)for(const s of this._source.readers(r.id)){const r=s.getCursor();for(;r.next();){let s=r.getDisplayId();if(!s){const e=r.getObjectId();s=this.featureStore.lookupDisplayId(e)}this._mark(s,t,e)}}"symbol"===this.processor.type&&this.processor.forEachBufferId((r=>{this._mark(r,t,e)})),this._updateQueue.forEach((r=>{for(const s of r.remove??[]){const r=this.featureStore.lookupDisplayId(s);this._mark(r,t,e)}})),null!=this.aggregateStore&&(this.aggregateStore.sweepFeatures(e,this.featureStore),"sweepAggregates"in this.aggregateStore&&this.aggregateStore.sweepAggregates(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(t)}};e([d({constructOnly:!0})],x.prototype,"tileStore",void 0),e([d()],x.prototype,"config",void 0),e([d({readOnly:!0})],x.prototype,"fieldsIndex",null),e([d()],x.prototype,"processor",void 0),e([d({constructOnly:!0})],x.prototype,"remoteClient",void 0),e([d({constructOnly:!0})],x.prototype,"service",void 0),e([d()],x.prototype,"spatialReference",null),e([d()],x.prototype,"updating",null),x=e([h("esri.views.2d.layers.features.controllers.FeatureController2D")],x);const R=x;export{R as default};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{isSome as r}from"../../../../../core/arrayUtils.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as s,after as i,throwIfAborted as a,throwIfNotAbortError as o,isAbortError as n}from"../../../../../core/promiseUtils.js";import{when as u,watch as g,whenOnce as l}from"../../../../../core/reactiveUtils.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import{convertToGeometry as p}from"../../../../../layers/graphics/featureConversionUtils.js";import{QueryEngine as y}from"../../../../../layers/graphics/data/QueryEngine.js";import f from"../../../../../layers/support/FieldsIndex.js";import{FeatureStore2D as m}from"../FeatureStore2D.js";import{createSource as S}from"../sources/createSource.js";import _ from"../support/AttributeStore.js";import{BinStore as b}from"../support/BinStore.js";import{ClusterStore as v}from"../support/ClusterStore.js";import{ComputedAttributeStorage as I}from"../support/ComputedAttributeStorage.js";import{FeatureSetReaderJSON as Q}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as C}from"../support/UpdateToken.js";import{QueueProcessor as F}from"../../../../support/QueueProcessor.js";const E=5e3,w="tileRenderer.featuresView.attributeView.initialize",T="tileRenderer.featuresView.attributeView.requestUpdate",j="tileRenderer.featuresView.requestRender";function A(e){return"worker:port-closed"===e.name}function k(e){if(!n(e)&&!A(e))throw e}function U(e){return"feature"===e.type&&"snapshot"===e.mode}let x=class extends t{constructor(){super(...arguments),this._storage=new I,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this._updatingHandles=new c,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initStores(),this._initSource(),this._updateQueue=new F({concurrency:"stream"===this._source.type?1:4,process:(e,t)=>this._onTileMessage(e,{signal:t})}),this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this)),u((()=>!this.updating),(()=>this.onIdle()))])}_initSource(){const e=this.tileStore.tileScheme,t=()=>this._updateQueue&&this._updateQueue.length<50,r=(e,t)=>(this._invalidated=!0,this._patchTile(e,t));this._source=S(this.service,this.spatialReference,e,r,t,this.featureStore),this._proxyEvents()}_setStreamClientProperty(e,t){this.remoteClient.invoke("setProperty",{propertyName:e,value:t}).catch(k)}_proxyEvents(){if("stream"===this._source.type){const e=this._source.events,t=this._source;this.addHandles([g((()=>t.connectionStatus),(e=>this._setStreamClientProperty("pipelineConnectionStatus",e)),{initial:!0}),g((()=>t.errorString),(e=>this._setStreamClientProperty("pipelineErrorString",e)),{initial:!0}),e.on("data-received",(e=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}}).catch(k))),e.on("message-received",(e=>this.remoteClient.invoke("emitEvent",{name:"message-received",event:e}).catch(k))),e.on("updateRate",(e=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...e}}).catch(k)))])}}_initAttributeStore(e){this.attributeStore||(this.attributeStore=new _({type:"remote",initialize:(e,t)=>s(this.remoteClient.invoke(w,e,{signal:t}).catch(k)),update:(e,t)=>s(this.remoteClient.invoke(T,e,{signal:t}).catch(k)),render:e=>s(this.remoteClient.invoke(j,void 0,{signal:e}).catch(k))},e))}_initStores(){const e="snapshot"===this.service.type?"snapshot":"on-demand",t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new m(t,this._storage,e)}_initQueryEngine(e){const t=this;this.featureQueryEngine?.destroy(),this.featureQueryEngine=new y({definitionExpression:e.schema.source.definitionExpression??void 0,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds(e){if(null==t.aggregateStore)return[];return t.aggregateStore.getFeatureDisplayIdsForAggregate(e).map((e=>t.getObjectId(e)))}},timeInfo:this.service.timeInfo})}_initAggregateQueryEngine(e,t){if(this.aggregateQueryEngine?.destroy(),null==e)return;const r=t.targets.aggregate.params.fields.slice();this.aggregateQueryEngine=new y({definitionExpression:void 0,fields:r,geometryType:e.geometryInfo.geometryType,objectIdField:e.objectIdField,hasM:e.geometryInfo.hasM,hasZ:e.geometryInfo.hasZ,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!1,featureStore:e,aggregateAdapter:{getFeatureObjectIds:e=>[]}})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.featureQueryEngine?.destroy(),this.aggregateQueryEngine?.destroy(),this.attributeStore?.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating),this._updatingHandles.destroy()}get fieldsIndex(){return new f(this.service.fields)}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){const e=this._source.updatingHandles.updating,t=!this.attributeStore||this.attributeStore.updatingHandles.updating,r=e||t||this._updatingHandles.updating;if(has("esri-2d-log-updating")){let s=`Updating FeatureController2D: ${r}\n`;s+=` -> updatingSource ${e}\n`;for(const e of this._source.subscriptions)s+=` ${e.tile.id} ${e.isDone}\n`;s+=` -> updatingAttributeStore ${t}\n`,s+=` -> updatingHandles ${this._updatingHandles.updating} (queue: ${this._updateQueue.length})\n`,console.log(s)}return r}updateCustomParameters(e){"stream"===this._source.type&&this._source.updateCustomParameters(e)}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){"stream"===this._source.type&&this._source.pauseStream()}resumeStream(){"stream"===this._source.type&&this._source.resumeStream()}sendMessageToSocket(e){"stream"===this._source.type&&this._source.sendMessageToSocket(e)}sendMessageToClient(e){"stream"===this._source.type&&this._source.sendMessageToClient(e)}_initAggregateStore(e){const t=e.schema.targets?.aggregate?.type??null;if((this.config?.schema.targets?.aggregate?.type??null)!==t&&(null!=this.aggregateStore&&(this.removeHandles("valueRangesChanged"),this.aggregateStore.destroy(),this.aggregateStore=null),t)){switch(t){case"cluster":{const e={geometryInfo:{geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new v(e,this.spatialReference,this._storage,this.service),this.addHandles(this.aggregateStore.events.on("valueRangesChanged",(e=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:e.valueRanges}}).catch(k)})),"valueRangesChanged");break}case"bin":{const e={geometryInfo:{geometryType:"esriGeometryPolygon",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new b(e,this.spatialReference,this._storage,this.service);break}}this.aggregateStore.onTileUpdate({added:this.tileStore.tiles,removed:[]})}}async update(e,t){this._updateVersion++,has("esri-2d-update-debug")&&console.debug(`FeatureController2D::update: Token version ${this._updateVersion}`),this._initQueryEngine(t),this._initAttributeStore(t),this.pause(),await Promise.all([this._source.update(e,t.schema.source),this.featureStore.updateSchema(e,t.schema.targets.feature),this.attributeStore.update(e,t),this.attributeStore.updateFilters(e,t,this)]),this._initAggregateStore(t),null!=this.aggregateStore&&await this.aggregateStore.updateSchema(e,t.schema.targets.aggregate),this._initAggregateQueryEngine(this.aggregateStore,t.schema),has("esri-2d-update-debug")&&e.describe(),this._set("config",t)}async applyUpdate(e){e.version=this._updateVersion,has("esri-2d-update-debug")&&console.debug(`FeatureController2D::applyUpdate: Token version ${e.version}`),e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),has("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Waiting for source update to finish"),this.notifyChange("updating"),await l((()=>!this.updating)),has("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Source update finsihed"),null!=this.aggregateStore&&(await i(10),has("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Waiting for aggregate idle call"),await l((()=>!this.updating)),has("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Aggregate idle called")),has("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Update finished")}async onEdits({edits:e}){has("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const t=e.removed.map((e=>e.objectId&&-1!==e.objectId?e.objectId:this._lookupObjectIdByGlobalId(e.globalId))),r=e.addOrModified.map((({objectId:e})=>e));this.featureStore.invalidate(),await this._source.edit(r,t),this.clearTiles(),this.notifyChange("updating"),null!=this.aggregateStore&&this.aggregateStore.clear(),await this._source.resend(),await l((()=>!this.updating))}catch(t){}}async refresh(e){if(!e.dataChanged){const e=C.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion,e),this._cleanupNeeded=!0,this.notifyChange("updating"),await l((()=>!this.updating))}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e,!1)}onTileUpdate(e){null!=this.aggregateStore&&this.aggregateStore.onTileUpdate(e);for(const t of e.added)this._source.subscribe(t,this._updateVersion),this._level=t.level;for(const t of e.removed)this._source.unsubscribe(t),this._cleanupNeeded=!0,this._tileToResolver.has(t.id)&&(this._tileToResolver.get(t.id).resolve(),this._tileToResolver.delete(t.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,null==this.aggregateStore&&"heatmap"!==this.processor.type||await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:e,params:t}){return this.featureQueryEngine.executeQueryForSummaryStatistics(e,t)}async queryAggregateSummaryStatistics({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForSummaryStatistics(this._normalizeAggregateQuery(e),t)}async queryUniqueValues({query:e,params:t}){return this.featureQueryEngine.executeQueryForUniqueValues(e,t)}async queryAggregateUniqueValues({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForUniqueValues(this._normalizeAggregateQuery(e),t)}async queryClassBreaks({query:e,params:t}){return this.featureQueryEngine.executeQueryForClassBreaks(e,t)}async queryAggregateClassBreaks({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForClassBreaks(this._normalizeAggregateQuery(e),t)}async queryHistogram({query:e,params:t}){return this.featureQueryEngine.executeQueryForHistogram(e,t)}async queryAggregateHistogram({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForHistogram(this._normalizeAggregateQuery(e),t)}queryExtent(e){return this.featureQueryEngine.executeQueryForExtent(e)}queryAggregates(e){return this.aggregateQueryEngine.executeQuery(this._normalizeAggregateQuery(e))}queryAggregateCount(e){return this.aggregateQueryEngine.executeQueryForCount(this._normalizeAggregateQuery(e))}queryAggregateIds(e){return this.aggregateQueryEngine.executeQueryForIds(this._normalizeAggregateQuery(e))}queryFeatures(e){return this.featureQueryEngine.executeQuery(e)}async queryVisibleFeatures(e){const t=await this.featureQueryEngine.executeQuery(e),r=t.objectIdFieldName;return t.features=t.features.filter((e=>{const t=e.attributes[r],s=this.getDisplayId(t);return null!=s&&this.attributeStore.isVisible(s)})),t}queryFeatureCount(e){return this.featureQueryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.featureQueryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.featureQueryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(null!=this.aggregateStore){const t=this.aggregateStore.getDisplayId(e);if(null==t){const t=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(t)}return t}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const t=[],r=[];for(const s of e){const e=null!=this.aggregateStore?this.getAggregate(s):null;if(null!=e)if(null!=e.attributes.referenceId){const r=this.getFeature(e.attributes.referenceId);null!=r&&t.push(r)}else r.push(e);else{const e=this.getFeature(s);null!=e&&t.push(e)}}return{features:t,aggregates:r}}getFeature(e){const t=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if(null==t)return null;const r=t.readHydratedGeometry(),s=p(r,t.geometryType,t.hasZ,t.hasM);return{attributes:t.readAttributes(),geometry:s}}getAggregate(e){return null==this.aggregateStore?null:this.aggregateStore.getAggregate(e)}getAggregates(){return null==this.aggregateStore?[]:this.aggregateStore.getAggregates()}async setHighlight(e){const t=e.map((e=>this.getDisplayId(e))).filter(r);return this.attributeStore.setHighlight(e,t)}_normalizeAggregateQuery(e){const t=e.objectIds??[];for(const r of e.aggregateIds??[])t.push(r);return e.objectIds=t,e.aggregateIds=[],e}_lookupObjectIdByGlobalId(e){const t=this.service.globalIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let r=null;if(this.featureStore.forEach((s=>{e===s.readAttribute(t)&&(r=s.getObjectId())})),null==r)throw new Error(`Expected to find a feature with globalId ${e}`);return r}async _repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter((e=>e.level===this._level));e.map((async e=>this._patchTile({type:"append",id:e.key.id,clear:!0,addOrUpdate:null,end:!1})));const t=e.map((async e=>this._patchTile({type:"append",id:e.key.id,addOrUpdate:Q.fromOptimizedFeatures([],this.service),remove:[],end:!0,isRepush:!0,status:C.empty()})));await Promise.all(t)}_maybeForceCleanup(){performance.now()-this._lastCleanup>E&&this._markAndSweep()}_patchTile(e,t){const r=this._updateQueue.push(e,t).catch((e=>{}));return this._updatingHandles.addPromise(r)}async _onTileMessage(e,t){if(a(t),has("esri-2d-update-debug")){const t=e.addOrUpdate?.hasFeatures;console.debug(e.id,`FeatureController:onTileMessage: [clear:${e.clear}, end:${e.end}, features: ${t}]`)}const r=this.tileStore.get(e.id);if(!r)return;if(e.clear)return this.processor.onTileClear(r,e.end);const s=e.status;this._cleanupNeeded=!0;const i=[];for(const a of e.remove??[]){const e=this.featureStore.lookupDisplayId(a);e&&i.push(e)}e.remove=i;try{if(null==e.addOrUpdate)return void this.processor.onTileMessage(r,{...e,addOrUpdate:null},null!=this.aggregateStore,t).catch(o);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&s.targets.feature||(s.targets.feature=!0,this.featureStore.onTileData(r,e)),!s.storage.data||!s.storage.filters){s.storage.data=!0,s.storage.filters=!0,this.attributeStore.onTileData(r,e);"stream"===this._source.type||this._didEdit?(await this.attributeStore.sendUpdates(),a(t)):this.attributeStore.sendUpdates()}if(null!=this.aggregateStore&&!s.targets.aggregate){s.targets.aggregate=!0;const t=U(this._source)&&this._source.loading,i=!U(this._source)||t||e.end;if(this.aggregateStore.onTileData(r,e,this._storage,this.attributeStore,i),!i)return;s.mesh||(this.attributeStore.onTileData(r,e),await this.attributeStore.sendUpdates())}if(!s.mesh){s.mesh=!0;const i=null!=this.aggregateStore&&"cluster"===this.aggregateStore.type;await this.processor.onTileMessage(r,e,i,t),a(t)}this._maybeForceCleanup()}catch(n){o(n)}}_mark(e,t,r){const s=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(t.add(s),r.set(e))}_markAndSweep(){this._lastCleanup=performance.now();if(!(!("feature"===this._source.type&&"snapshot"===this._source.mode)&&("stream"===this._source.type||this._cleanupNeeded)))return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),t=new Set;e.clear();for(const r of this.tileStore.tiles)for(const s of this._source.readers(r.id)){const r=s.getCursor();for(;r.next();){let s=r.getDisplayId();if(!s){const e=r.getObjectId();s=this.featureStore.lookupDisplayId(e)}this._mark(s,t,e)}}"symbol"===this.processor.type&&this.processor.forEachBufferId((r=>{this._mark(r,t,e)})),this._updateQueue.forEach((r=>{for(const s of r.remove??[]){const r=this.featureStore.lookupDisplayId(s);this._mark(r,t,e)}})),null!=this.aggregateStore&&(this.aggregateStore.sweepFeatures(e,this.featureStore),"sweepAggregates"in this.aggregateStore&&this.aggregateStore.sweepAggregates(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(t)}};e([d({constructOnly:!0})],x.prototype,"tileStore",void 0),e([d()],x.prototype,"config",void 0),e([d({readOnly:!0})],x.prototype,"fieldsIndex",null),e([d()],x.prototype,"processor",void 0),e([d({constructOnly:!0})],x.prototype,"remoteClient",void 0),e([d({constructOnly:!0})],x.prototype,"service",void 0),e([d()],x.prototype,"spatialReference",null),e([d()],x.prototype,"updating",null),x=e([h("esri.views.2d.layers.features.controllers.FeatureController2D")],x);const R=x;export{R as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../TimeExtent.js";import s from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import{createResolver as t,ignoreAbortErrors as i,eachAlwaysValues as r,eachAlways as o}from"../../../../../core/promiseUtils.js";import{diff as n,hasDiff as u,hasDiffAny as c}from"../../../../../core/accessorSupport/diffUtils.js";import{
|
|
5
|
+
import e from"../../../../../TimeExtent.js";import s from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import{createResolver as t,ignoreAbortErrors as i,eachAlwaysValues as r,eachAlways as o}from"../../../../../core/promiseUtils.js";import{diff as n,hasDiff as u,hasDiffAny as c}from"../../../../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as a}from"../../../../../core/support/UpdatingHandles.js";import d from"../../../../../rest/support/Query.js";import{DataTileSubscription as h}from"./DataTileSubscription.js";import{UpdateToken as l}from"../support/UpdateToken.js";function p(e,s){const t=new Set;return e&&e.forEach((e=>t.add(e))),s&&s.forEach((e=>t.add(e))),t.has("*")?["*"]:Array.from(t)}class m{constructor(e){this.updatingHandles=new a,this.events=new s,this._resolver=t(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage}destroy(){for(const e of this._subscriptions.values())e.abort();this.updatingHandles.destroy()}get subscriptions(){return this._subscriptions.values()}async _onMessage(e){const s=this._subscriptions.get(e.id);if(!s)return;const t={...e,remove:e.remove??[],status:e.status??l.empty()};return i(this._onTileUpdateMessage(t,s.options))}update(s,t){const i=t.fields.length;t.outFields=p(this._schema?.outFields,t.outFields),t.outFields=t.outFields.length>=.75*i?["*"]:t.outFields,t.outFields.sort();const r=n(this._schema,t);if(!r)return;has("esri-2d-update-debug")&&console.debug("Applying Update - Source:",r);const o="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",a={returnCentroid:"esriGeometryPolygon"===this._serviceInfo.geometryType,returnGeometry:!0,timeReferenceUnknownClient:"stream"!==this._serviceInfo.type&&this._serviceInfo.timeReferenceUnknownClient,outFields:t.outFields,outSpatialReference:this._outSR,orderByFields:[o],where:t.definitionExpression||"1=1",gdbVersion:t.gdbVersion,historicMoment:t.historicMoment,timeExtent:t.timeExtent?e.fromJSON(t.timeExtent):null},d=this._schema&&u(r,"outFields");this._schema&&c(r,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(s.why.mesh.push("Layer filter and/or custom parameters changed"),s.why.source.push("Layer filter and/or custom parameters changed"),s.mesh=!0,s.source=!0,s.queryFilter=!0),d&&(s.why.source.push("Layer required fields changed"),s.source=!0),n(a,this._queryInfo)&&(this._queryInfo=a),this._schema=t,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(e.version),void(this._didEdit=!1);this._subscriptions.forEach((s=>s.applyUpdate(e))),await this.resend()}refresh(e,s){for(const t of this._tiles())this.unsubscribe(t),this.subscribe(t,e)}subscribe(e,s){const t=new h(e,s);this._subscriptions.set(e.id,t),this.updatingHandles.addPromise(t.done)}unsubscribe(e){const s=this.getSubscription(e.id);null!=s&&s.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const s=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new d({...this._queryInfo,historicMoment:s,...e})}getSubscription(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e,s){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const s of e)yield s.tile}async edit(e,s){const t=Array.from(this._subscriptions.values()),i=t.map((({tile:e})=>e));for(const r of t)r.removeIds(s);if(e.length){const t=i.map((s=>{const t=this.createTileQuery(s);return t.objectIds=e,{tile:s,query:t}})).map((async({tile:e,query:s})=>({tile:e,result:await this.query(s,{query:{tile:has("esri-tiles-debug")?e.id.replaceAll("/","."):void 0}}),query:s}))),n=(await r(t)).map((async({tile:t,result:i})=>{if(!i.hasFeatures&&!s.length&&!e.length)return;const r=this._subscriptions.get(t.key.id);r&&r.edit(i,e)}));await o(n)}this._didEdit=!0}}export{m as DataTileSource};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{createResolver as s,isAbortError as r}from"../../../../../core/promiseUtils.js";import{diff as a}from"../../../../../core/accessorSupport/diffUtils.js";import{WatchUpdatingTracking as n}from"../../../../../core/support/WatchUpdatingTracking.js";import o from"../../../../../layers/support/FieldsIndex.js";import{MAX_FILTERS as l,HIGHLIGHT_FLAG as h,ATTRIBUTE_DATA_VV as u,NAN_MAGIC_NUMBER as d,ATTRIBUTE_DATA_ANIMATION as p,ATTRIBUTE_DATA_GPGPU as c}from"../../../engine/webgl/definitions.js";import{DISPLAY_ID_TYPE_AGGREGATE as g,DISPLAY_ID_TYPE_FEATURE as _,getDisplayIdTexel as f,getDisplayIdType as m,getDisplayIdFilterMask as y}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as b}from"../../../engine/webgl/Utils.js";import{createDebugLogger as x,DEBUG_ATTR_UPDATES as S}from"../../../engine/webgl/util/debug.js";import{getVisualVariableSizeValueRepresentationRatio as T}from"../tileRenderers/support/visualVariablesUtils.js";import{PixelType as z}from"../../../../webgl/enums.js";const U=e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),A=x(S,U),w={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};function E(t,e){return i=>e(t(i))}class k{constructor(t,e,i,s){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:r,layout:a,textureOnly:n}=s;this.textureOnly=n||!1,this.pixelType=r,this._ctype=e,this.layout=a,this._resetRange(),this._shared=t,this.size=i,n||(this.data=this._initData(r,i,t,e))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=this.data;for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){this.data[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){this.data[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=f(t);return this.data[i*this.texelSize+e]}setData(t,e,i){const s=f(t),r=1<<e;0!=(this.layout&r)?null!=this.data&&(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):U.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===z.UNSIGNED_BYTE&&this._shared&&w.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===z.UNSIGNED_BYTE&&this._shared&&w.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t,this._shared,this._ctype),i=this.data;e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!(this._shared||"local"===this._ctype),r=this.pixelType,a=this.layout,n=this.data;return{start:t,end:e,data:s&&n.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e,i,s){const r=i&&"local"!==s?SharedArrayBuffer:ArrayBuffer,a=b(t),n=new a(new r(e*e*4*a.BYTES_PER_ELEMENT));for(let o=0;o<n.length;o+=4)n[o+1]=255;return n}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class D{constructor(t,e){this._client=t,this.config=e,this.updatingHandles=new n,this._blocks=new Array,this._filters=new Array(l),this._attributeComputeInfo=null,this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._nextUpdate=null,this._currUpdate=null,this._idsToHighlight=new Set;const i=e.supportsTextureFloat?z.FLOAT:z.UNSIGNED_BYTE;A(`Creating AttributeStore ${w.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:z.UNSIGNED_BYTE,layout:1},{pixelType:z.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:z.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:i,layout:15},{pixelType:i,layout:15},{pixelType:i,layout:15},{pixelType:i,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort(),this.updatingHandles.destroy()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}isUpdating(){const t=this.updatingHandles.updating||!!this._nextUpdate;return has("esri-2d-log-updating")&&console.log(`Updating AttributeStore: ${t}\n -> updatingHandles ${this.updatingHandles.updating} (currUpdate: ${!!this._currUpdate})\n -> nextUpdate: ${!!this._nextUpdate}\n`),t}update(t,e){this.config=e;const i=e.schema.processors[0].storage,s=a(this._schema,i);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),s&&(has("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",s),t.storage.data=!0,this._schema=i,this._attributeComputeInfo=null,null!=i)){switch(i.target){case"feature":this._targetType=_;break;case"aggregate":this._targetType=g}if("subtype"===i.type){this._attributeComputeInfo={isSubtype:!0,subtypeField:i.subtypeField,map:new Map};for(const t in i.mapping){const e=i.mapping[t];if(null!=e&&null!=e.vvMapping)for(const i of e.vvMapping)this._bindAttribute(i,parseInt(t,10))}}else{if(this._attributeComputeInfo={isSubtype:!1,map:new Map},null!=i.vvMapping)for(const t of i.vvMapping)this._bindAttribute(t);if(null!=i.attributeMapping)for(const t of i.attributeMapping)this._bindAttribute(t)}}}onTileData(t,e){if(null==e.addOrUpdate)return;const i=e.addOrUpdate.getCursor();for(;i.next();){const t=i.getDisplayId();this.setAttributeData(t,i)}}async setHighlight(t,e){const i=1,s=this._getBlock(0),r=e.map((t=>f(t)));s.lock(),s.unsetComponentAllTexels(0,i),s.setComponent(0,i,r),s.unlock(),this._idsToHighlight.clear();for(const a of t)this._idsToHighlight.add(a);await this.sendUpdates()}async updateFilters(t,e,i){has("esri-2d-update-debug")&&console.debug("AttributeStore::updateFilters");const{service:s,spatialReference:r}=i,{filters:a}=e,n=a.map(((t,e)=>this._updateFilter(t,e,s,r))),o=(await Promise.all(n)).some((t=>t));has("esri-2d-update-debug")&&console.debug("AttributeStore::updateFilters - finsihed"),o&&(t.storage.filters=!0,has("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,i,s){const r=f(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlag(t){return this._idsToHighlight.has(t)?h:0}unsetAttributeData(t){const e=f(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const s=f(t);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(e)),this._targetType!==m(t))return;const r=this._attributeComputeInfo,a=this.config.supportsTextureFloat?1:2,n=4;let o=null;r&&(o=r.isSubtype?r.map.get(e.readAttribute(r.subtypeField)):r.map,o&&o.size&&o.forEach(((t,r)=>{const o=r*a%n,l=Math.floor(r*a/n),h=this._getBlock(l+u),p=t(e);if(this.config.supportsTextureFloat)h.setData(s,o,p);else if(p===d)h.setData(s,o,255),h.setData(s,o+1,255);else{const t=i(Math.round(p),-32767,32766)+32768,e=255&t,r=(65280&t)>>8;h.setData(s,o,e),h.setData(s,o+1,r)}})))}sendUpdates(){if(has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=s(),this.updatingHandles.addPromise(this._nextUpdate.promise),this._nextUpdate.promise;const e={blocks:this._blocks.map((t=>null!=t?t.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const t=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>t.resolve()))}else has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued")};has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const i=this.updatingHandles.addPromise(this._client.update(e,this._signal).then(t).catch(t));return this._client.render(this._signal),i})).catch((e=>{if(r(e))return this._createResourcesPromise=null,this._createResources();U.error(new t("mapview-attribute-store","Encountered an error during client update",e))})),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t,e){function i(){const{normalizationField:e}=t;return e?i=>{const s=i.readAttribute(e);if(!s)return null;return i.readAttribute(t.field)/s}:e=>e.readAttribute(t.field)}function s(){return t.normalizationField&&U.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),e=>e.getComputedNumericAtIndex(t.fieldIndex)}let r;if(null!=t.fieldIndex)r=s();else{if(!t.field)return;r=i()}const{valueRepresentation:a}=t;if(a){r=E(r,(t=>T(t,a)))}const n=t=>null===t||isNaN(t)||t===1/0||t===-1/0?d:t,o=this._attributeComputeInfo;if(o.isSubtype){const i=o.map.get(e)??new Map;i.set(t.binding,E(r,n)),o.map.set(e,i)}else o.map.set(t.binding,E(r,n))}_createResources(){if(null!=this._createResourcesPromise)return this._createResourcesPromise;this._getBlock(p),this._getBlock(c),A("Initializing AttributeStore");const e={shared:w.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:this._blocks.map((t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null))},i=this._client.initialize(e,this._signal).catch((e=>{r(e)?this._createResourcesPromise=null:U.error(new t("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=i,i.then((()=>null==this._createResourcesPromise?this._createResources():void 0)),i}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;A(`Initializing AttributeBlock at index ${t}`);const i=w.sharedArrayBuffer,s=this._client.type,r=new k(i,s,this._size,this._blockDescriptors[t]);return this._blocks[t]=r,this._createResourcesPromise=null,r}_expand(){if(this._size<this.config.maxTextureSize){const t=this._size<<=1;A("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._createResourcesPromise=null,this._size=t,0}return U.error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,i,s){const r=this._filters[e],a=null!=r&&r.hash;if(!r&&!t)return!1;if(a===JSON.stringify(t))return!1;if(null==t){if(!r)return!1;const t=1<<e+1,i=this._getBlock(0);return this._filters[e]=null,i.setComponentAllTexels(0,t),this.sendUpdates(),!0}const n=await this._getFilter(e,i);return await n.update(t,s),!0}async _getFilter(t,e){const i=this._filters[t];if(null!=i)return i;const{default:s}=await import("./FeatureFilter.js"),r=new s({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new o(e.fields)});return this._filters[t]=r,r}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const i=y(t.getDisplayId());for(let r=0;r<this._filters.length;r++){const s=!!(i&1<<r),a=this._filters[r];e|=(!s||null==a||a.check(t)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlag(e)}return e<<1|s}}export{D as default};
|
|
5
|
+
import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{createResolver as s,isAbortError as r}from"../../../../../core/promiseUtils.js";import{diff as a}from"../../../../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as n}from"../../../../../core/support/UpdatingHandles.js";import o from"../../../../../layers/support/FieldsIndex.js";import{MAX_FILTERS as l,HIGHLIGHT_FLAG as h,ATTRIBUTE_DATA_VV as u,NAN_MAGIC_NUMBER as d,ATTRIBUTE_DATA_ANIMATION as p,ATTRIBUTE_DATA_GPGPU as c}from"../../../engine/webgl/definitions.js";import{DISPLAY_ID_TYPE_AGGREGATE as g,DISPLAY_ID_TYPE_FEATURE as _,getDisplayIdTexel as f,getDisplayIdType as m,getDisplayIdFilterMask as y}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as b}from"../../../engine/webgl/Utils.js";import{createDebugLogger as x,DEBUG_ATTR_UPDATES as S}from"../../../engine/webgl/util/debug.js";import{getVisualVariableSizeValueRepresentationRatio as T}from"../tileRenderers/support/visualVariablesUtils.js";import{PixelType as z}from"../../../../webgl/enums.js";const U=e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),A=x(S,U),w={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};function E(t,e){return i=>e(t(i))}class D{constructor(t,e,i,s){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:r,layout:a,textureOnly:n}=s;this.textureOnly=n||!1,this.pixelType=r,this._ctype=e,this.layout=a,this._resetRange(),this._shared=t,this.size=i,n||(this.data=this._initData(r,i,t,e))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=this.data;for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){this.data[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){this.data[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=f(t);return this.data[i*this.texelSize+e]}setData(t,e,i){const s=f(t),r=1<<e;0!=(this.layout&r)?null!=this.data&&(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):U.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===z.UNSIGNED_BYTE&&this._shared&&w.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===z.UNSIGNED_BYTE&&this._shared&&w.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t,this._shared,this._ctype),i=this.data;e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!(this._shared||"local"===this._ctype),r=this.pixelType,a=this.layout,n=this.data;return{start:t,end:e,data:s&&n.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e,i,s){const r=i&&"local"!==s?SharedArrayBuffer:ArrayBuffer,a=b(t),n=new a(new r(e*e*4*a.BYTES_PER_ELEMENT));for(let o=0;o<n.length;o+=4)n[o+1]=255;return n}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class k{constructor(t,e){this._client=t,this.config=e,this.updatingHandles=new n,this._blocks=new Array,this._filters=new Array(l),this._attributeComputeInfo=null,this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._nextUpdate=null,this._currUpdate=null,this._idsToHighlight=new Set;const i=e.supportsTextureFloat?z.FLOAT:z.UNSIGNED_BYTE;A(`Creating AttributeStore ${w.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:z.UNSIGNED_BYTE,layout:1},{pixelType:z.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:z.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:i,layout:15},{pixelType:i,layout:15},{pixelType:i,layout:15},{pixelType:i,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort(),this.updatingHandles.destroy()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}isUpdating(){const t=this.updatingHandles.updating||!!this._nextUpdate;return has("esri-2d-log-updating")&&console.log(`Updating AttributeStore: ${t}\n -> updatingHandles ${this.updatingHandles.updating} (currUpdate: ${!!this._currUpdate})\n -> nextUpdate: ${!!this._nextUpdate}\n`),t}update(t,e){this.config=e;const i=e.schema.processors[0].storage,s=a(this._schema,i);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),s&&(has("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",s),t.storage.data=!0,this._schema=i,this._attributeComputeInfo=null,null!=i)){switch(i.target){case"feature":this._targetType=_;break;case"aggregate":this._targetType=g}if("subtype"===i.type){this._attributeComputeInfo={isSubtype:!0,subtypeField:i.subtypeField,map:new Map};for(const t in i.mapping){const e=i.mapping[t];if(null!=e&&null!=e.vvMapping)for(const i of e.vvMapping)this._bindAttribute(i,parseInt(t,10))}}else{if(this._attributeComputeInfo={isSubtype:!1,map:new Map},null!=i.vvMapping)for(const t of i.vvMapping)this._bindAttribute(t);if(null!=i.attributeMapping)for(const t of i.attributeMapping)this._bindAttribute(t)}}}onTileData(t,e){if(null==e.addOrUpdate)return;const i=e.addOrUpdate.getCursor();for(;i.next();){const t=i.getDisplayId();this.setAttributeData(t,i)}}async setHighlight(t,e){const i=1,s=this._getBlock(0),r=e.map((t=>f(t)));s.lock(),s.unsetComponentAllTexels(0,i),s.setComponent(0,i,r),s.unlock(),this._idsToHighlight.clear();for(const a of t)this._idsToHighlight.add(a);await this.sendUpdates()}async updateFilters(t,e,i){has("esri-2d-update-debug")&&console.debug("AttributeStore::updateFilters");const{service:s,spatialReference:r}=i,{filters:a}=e,n=a.map(((t,e)=>this._updateFilter(t,e,s,r))),o=(await Promise.all(n)).some((t=>t));has("esri-2d-update-debug")&&console.debug("AttributeStore::updateFilters - finsihed"),o&&(t.storage.filters=!0,has("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,i,s){const r=f(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlag(t){return this._idsToHighlight.has(t)?h:0}unsetAttributeData(t){const e=f(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const s=f(t);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(e)),this._targetType!==m(t))return;const r=this._attributeComputeInfo,a=this.config.supportsTextureFloat?1:2,n=4;let o=null;r&&(o=r.isSubtype?r.map.get(e.readAttribute(r.subtypeField)):r.map,o&&o.size&&o.forEach(((t,r)=>{const o=r*a%n,l=Math.floor(r*a/n),h=this._getBlock(l+u),p=t(e);if(this.config.supportsTextureFloat)h.setData(s,o,p);else if(p===d)h.setData(s,o,255),h.setData(s,o+1,255);else{const t=i(Math.round(p),-32767,32766)+32768,e=255&t,r=(65280&t)>>8;h.setData(s,o,e),h.setData(s,o+1,r)}})))}sendUpdates(){if(has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=s(),this.updatingHandles.addPromise(this._nextUpdate.promise),this._nextUpdate.promise;const e={blocks:this._blocks.map((t=>null!=t?t.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const t=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>t.resolve()))}else has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued")};has("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const i=this.updatingHandles.addPromise(this._client.update(e,this._signal).then(t).catch(t));return this._client.render(this._signal),i})).catch((e=>{if(r(e))return this._createResourcesPromise=null,this._createResources();U.error(new t("mapview-attribute-store","Encountered an error during client update",e))})),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t,e){function i(){const{normalizationField:e}=t;return e?i=>{const s=i.readAttribute(e);if(!s)return null;return i.readAttribute(t.field)/s}:e=>e.readAttribute(t.field)}function s(){return t.normalizationField&&U.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),e=>e.getComputedNumericAtIndex(t.fieldIndex)}let r;if(null!=t.fieldIndex)r=s();else{if(!t.field)return;r=i()}const{valueRepresentation:a}=t;if(a){r=E(r,(t=>T(t,a)))}const n=t=>null===t||isNaN(t)||t===1/0||t===-1/0?d:t,o=this._attributeComputeInfo;if(o.isSubtype){const i=o.map.get(e)??new Map;i.set(t.binding,E(r,n)),o.map.set(e,i)}else o.map.set(t.binding,E(r,n))}_createResources(){if(null!=this._createResourcesPromise)return this._createResourcesPromise;this._getBlock(p),this._getBlock(c),A("Initializing AttributeStore");const e={shared:w.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:this._blocks.map((t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null))},i=this._client.initialize(e,this._signal).catch((e=>{r(e)?this._createResourcesPromise=null:U.error(new t("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=i,i.then((()=>null==this._createResourcesPromise?this._createResources():void 0)),i}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;A(`Initializing AttributeBlock at index ${t}`);const i=w.sharedArrayBuffer,s=this._client.type,r=new D(i,s,this._size,this._blockDescriptors[t]);return this._blocks[t]=r,this._createResourcesPromise=null,r}_expand(){if(this._size<this.config.maxTextureSize){const t=this._size<<=1;A("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._createResourcesPromise=null,this._size=t,0}return U.error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,i,s){const r=this._filters[e],a=null!=r&&r.hash;if(!r&&!t)return!1;if(a===JSON.stringify(t))return!1;if(null==t){if(!r)return!1;const t=1<<e+1,i=this._getBlock(0);return this._filters[e]=null,i.setComponentAllTexels(0,t),this.sendUpdates(),!0}const n=await this._getFilter(e,i);return await n.update(t,s),!0}async _getFilter(t,e){const i=this._filters[t];if(null!=i)return i;const{default:s}=await import("./FeatureFilter.js"),r=new s({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new o(e.fields)});return this._filters[t]=r,r}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const i=y(t.getDisplayId());for(let r=0;r<this._filters.length;r++){const s=!!(i&1<<r),a=this._filters[r];e|=(!s||null==a||a.check(t)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlag(e)}return e<<1|s}}export{k as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{debounce as s,isAbortError as r,eachAlways as a}from"../../../../core/promiseUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as n}from"../../../../core/support/WatchUpdatingTracking.js";import h from"../../../../geometry/Point.js";import c from"../../../../layers/support/PixelBlock.js";import u from"../../../../layers/support/TileInfo.js";import{update as p,unregister as d,register as y,getRasterId as g}from"../../../../layers/support/rasterDatasets/RawBlockCache.js";import{getWorldWidth as m,computeProjectedScales as _}from"../../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{isShadedReliefRendererSupported as f}from"../../../../renderers/support/rasterRendererChecks.js";import"../../tiling/PagedTileQueue.js";import b from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import w from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{TILE_SIZE as P}from"../../engine/webgl/definitions.js";import{getWebGLCapabilities as R}from"../../../webgl/capabilities.js";import C from"../../../../geometry/Extent.js";const S=[0,0];let T=class extends t{constructor(){super(...arguments),this._updatingHandles=new n,this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=[],this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.redrawOrRefetch=s((async(e={})=>{if(!this.previousLOD||this.layerView.suspended)return;const t=this._rasterFunctionState;e.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters());const i=this._rasterFunctionState,{type:s}=this;return e.refetch||"raster"!==s&&!!e.reprocess||"cpu"===i||"cpu"===t?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(e.signal))}))}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s=t.toJSON?t:C.fromJSON(t);p(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==r.level&&(this.previousLOD=r,null==this._symbolizerParams||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&this._redrawImage(this._abortController.signal).then((()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._fetchQueue?.updating||this._globalUpdateRequested||!(!this._updatingHandles||!this._updatingHandles.updating)}attach(){R("2d").supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new b(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new w({tileInfoView:this._tileInfoView,concurrency:e,process:(e,t)=>this._fetchTile1(e,t)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,d(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",(()=>{e.destroy(),this.layerView.requestUpdate()})),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&null!=this._emptyTilePixelBlock)return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,s]=e,r=new c({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:e,raster:t}=this.layer,i="rasterFunction"in t?t.rasterFunction.rawInputBandIds:null;return e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map((e=>i[Math.min(e,i.length-1)])):e||i}updateRasterFunctionParameters(){}_fetchTile1(e,t){const i=null!=t?t.signal:null,s=this.canUseWebGLForProcessing(),{layerView:r}=this,{tileInfo:a}=r,o=!a.isWrappable&&null!=m(r.view.spatialReference),l=s&&this.layer.raster.hasUniqueSourceStorageInfo,n={allowPartialFill:!0,datumTransformation:r.datumTransformation,interpolation:s?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:l,skipRasterFunction:"raster"===this.type&&null!=this.container.rasterFunctionChain,signal:i,srcResolution:this._srcResolutions[e.level],timeExtent:r.timeExtent,tileInfo:a,disableWrapAround:o};return this.fetchTile(e,n)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,t=e.view.spatialReference;if(this._canUseLayerLODs()){const{origin:i,lods:s}=this.layer.tileInfo,r=s.map((({scale:e})=>e)),a=u.create({spatialReference:t,size:P,scales:r,origin:i});return e.set("tileInfo",a),void(this._srcResolutions=s.map((({resolution:e})=>({x:e,y:e}))))}const i=f(this.layer.rasterInfo),{scales:s,srcResolutions:r,isCustomTilingScheme:a}=_(this.layer.rasterInfo,t,{tileSize:P,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:i}),o=u.create({spatialReference:t,size:P,scales:s}),l=new h({x:e.fullExtent.xmin,y:e.fullExtent.ymax,spatialReference:t});(0===o.origin.x||o.origin.x>l.x)&&(o.origin=l),this._isCustomTilingScheme=a,e.set("tileInfo",o),this._srcResolutions=r??[]}_canUseLayerLODs(){const{layer:e,layerView:t}=this;if("Map"!==e.raster.tileType)return!1;const{lods:i}=e.tileInfo,s=t.view.constraints?.effectiveLODs;return s?.length===i.length&&s.every((({scale:e},t)=>Math.abs(e-i[t].scale)<.001))}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){this._updatingHandles.addPromise(this._enqueueTileFetch1(e,t))}async _enqueueTileFetch1(e,t){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key),a=this._getBandIds();let o=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length){o=!1;try{await this._redrawImage(this._abortController?.signal)}catch(s){r(s)&&i.getLogger(this).error(s)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&"rasterVF"!==this.type||this.layerView.hasTilingEffects||null!=this._symbolizerParams||this._updateSymbolizerParams();const l=this._tileInfoView.getTileCoords(S,e.key),n=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:t,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:o,bandIds:a,coords:l,resolution:n}),e.once("attach",(()=>this.layerView.requestUpdate())),this.container.addChild(e)}catch(s){r(s)||i.getLogger(this).error(s)}this.layerView.requestUpdate()}}async _redrawImage(e){if(0===this.container.children.length)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map((async e=>this.updateTileSymbolizerParameters(e,{local:this._symbolizerParams,global:this._globalSymbolizerParams})));await a(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const{resolution:s}=this.previousLOD,r=this._getBandIds(),a=this.layer.symbolizer.generateWebGLParameters({pixelBlock:i.pixelBlock.extractBands(r),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:s,y:s},bandIds:r});!this.canUseWebGLForProcessing()&&a&&"stretch"===a.type&&this.layer.renderer&&"raster-stretch"===this.layer.renderer.type&&(a.factor=a.factor.map((e=>255*e)),a.outMin=Math.round(255*a.outMin),a.outMax=Math.round(255*a.outMax)),this._globalSymbolizerParams=a}_updateSymbolizerParams(){const{resolution:e}=this.previousLOD,t=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:t})}_updateBlockCacheRegistry(e=!1){const{layer:t,layerView:i}=this,{url:s,raster:r}=t,{multidimensionalDefinition:a}=t.normalizeRasterFetchOptions({multidimensionalDefinition:t.multidimensionalDefinition,timeExtent:i.timeExtent}),o=r.rasterInfo.multidimensionalInfo?r.getSliceIndex(a):null,l=g(s,o);if(l!==this._blockCacheRegistryUrl){if(null!=this._blockCacheRegistryUrl&&d(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=y(l,r.rasterInfo),e){const{view:e}=i,t=this._tileInfoView.getClosestInfoForScale(e.scale),s=this._srcResolutions[t.level];p(l,this._blockCacheRegistryId,e.extent,e.resolution,s,r.ioConfig.sampling)}this._blockCacheRegistryUrl=l}}async doRefresh(){if(!this.attached)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh((t=>e.push(this._enqueueTileFetch(t)))),await a(e)}};e([o()],T.prototype,"_fetchQueue",void 0),e([o()],T.prototype,"_globalUpdateRequested",void 0),e([o()],T.prototype,"attached",void 0),e([o()],T.prototype,"container",void 0),e([o()],T.prototype,"layer",void 0),e([o()],T.prototype,"layerView",void 0),e([o()],T.prototype,"type",void 0),e([o()],T.prototype,"useWebGLForProcessing",null),e([o()],T.prototype,"useProgressiveUpdate",null),e([o()],T.prototype,"timeExtent",void 0),e([o()],T.prototype,"updating",null),T=e([l("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],T);export{T as BaseImageryTileSubView2D};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{debounce as s,isAbortError as r,eachAlways as a}from"../../../../core/promiseUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as n}from"../../../../core/support/UpdatingHandles.js";import h from"../../../../geometry/Point.js";import c from"../../../../layers/support/PixelBlock.js";import u from"../../../../layers/support/TileInfo.js";import{update as p,unregister as d,register as y,getRasterId as g}from"../../../../layers/support/rasterDatasets/RawBlockCache.js";import{getWorldWidth as m,computeProjectedScales as _}from"../../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{isShadedReliefRendererSupported as f}from"../../../../renderers/support/rasterRendererChecks.js";import"../../tiling/PagedTileQueue.js";import b from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import w from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{TILE_SIZE as P}from"../../engine/webgl/definitions.js";import{getWebGLCapabilities as C}from"../../../webgl/capabilities.js";import R from"../../../../geometry/Extent.js";const S=[0,0];let T=class extends t{constructor(){super(...arguments),this._updatingHandles=new n,this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=[],this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._maxIndexedColormapSize=0,this._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.redrawOrRefetch=s((async(e={})=>{if(!this.previousLOD||this.layerView.suspended)return;const t=this._rasterFunctionState;e.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters());const i=this._rasterFunctionState,{type:s}=this;return e.refetch||"raster"!==s&&!!e.reprocess||"cpu"===i||"cpu"===t?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(e.signal))}))}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s=t.toJSON?t:R.fromJSON(t);p(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==r.level&&(this.previousLOD=r,null==this._symbolizerParams||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&this._redrawImage(this._abortController.signal).then((()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._fetchQueue?.updating||this._globalUpdateRequested||!(!this._updatingHandles||!this._updatingHandles.updating)}attach(){const e=C("2d");this._maxIndexedColormapSize=4*(e.maxTextureSize||4096),e.supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new b(this.layerView.tileInfo,this.layerView.fullExtent);const t=this._computeFetchConcurrency();this._fetchQueue=new w({tileInfoView:this._tileInfoView,concurrency:t,process:(e,t)=>this._fetchTile1(e,t)});const i=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:i,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,d(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",(()=>{e.destroy(),this.layerView.requestUpdate()})),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&null!=this._emptyTilePixelBlock)return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,s]=e,r=new c({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:e,raster:t}=this.layer,i="rasterFunction"in t?t.rasterFunction.rawInputBandIds:null;return e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map((e=>i[Math.min(e,i.length-1)])):e||i}updateRasterFunctionParameters(){}_fetchTile1(e,t){const i=null!=t?t.signal:null,s=this.canUseWebGLForProcessing(),{layerView:r}=this,{tileInfo:a}=r,o=!a.isWrappable&&null!=m(r.view.spatialReference),l=s&&this.layer.raster.hasUniqueSourceStorageInfo,n={allowPartialFill:!0,datumTransformation:r.datumTransformation,interpolation:s?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:l,skipRasterFunction:"raster"===this.type&&null!=this.container.rasterFunctionChain,signal:i,srcResolution:this._srcResolutions[e.level],timeExtent:r.timeExtent,tileInfo:a,disableWrapAround:o};return this.fetchTile(e,n)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,t=e.view.spatialReference;if(this._canUseLayerLODs()){const{origin:i,lods:s}=this.layer.tileInfo,r=s.map((({scale:e})=>e)),a=u.create({spatialReference:t,size:P,scales:r,origin:i});return e.set("tileInfo",a),void(this._srcResolutions=s.map((({resolution:e})=>({x:e,y:e}))))}const i=f(this.layer.rasterInfo),{scales:s,srcResolutions:r,isCustomTilingScheme:a}=_(this.layer.rasterInfo,t,{tileSize:P,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:i}),o=u.create({spatialReference:t,size:P,scales:s}),l=new h({x:e.fullExtent.xmin,y:e.fullExtent.ymax,spatialReference:t});(0===o.origin.x||o.origin.x>l.x)&&(o.origin=l),this._isCustomTilingScheme=a,e.set("tileInfo",o),this._srcResolutions=r??[]}_canUseLayerLODs(){const{layer:e,layerView:t}=this;if("Map"!==e.raster.tileType)return!1;const{lods:i}=e.tileInfo,s=t.view.constraints?.effectiveLODs;return s?.length===i.length&&s.every((({scale:e},t)=>Math.abs(e-i[t].scale)<.001))}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){this._updatingHandles.addPromise(this._enqueueTileFetch1(e,t))}async _enqueueTileFetch1(e,t){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key),a=this._getBandIds();let o=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length){o=!1;try{await this._redrawImage(this._abortController?.signal)}catch(s){r(s)&&i.getLogger(this).error(s)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&"rasterVF"!==this.type||this.layerView.hasTilingEffects||null!=this._symbolizerParams||this._updateSymbolizerParams();const l=this._tileInfoView.getTileCoords(S,e.key),n=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:t,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:o,bandIds:a,coords:l,resolution:n}),e.once("attach",(()=>this.layerView.requestUpdate())),this.container.addChild(e)}catch(s){r(s)||i.getLogger(this).error(s)}this.layerView.requestUpdate()}}async _redrawImage(e){if(0===this.container.children.length)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map((async e=>this.updateTileSymbolizerParameters(e,{local:this._symbolizerParams,global:this._globalSymbolizerParams})));await a(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const{resolution:s}=this.previousLOD,r=this._getBandIds(),a=this.layer.symbolizer.generateWebGLParameters({pixelBlock:i.pixelBlock.extractBands(r),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:s,y:s},bandIds:r});!this.canUseWebGLForProcessing()&&a&&"stretch"===a.type&&this.layer.renderer&&"raster-stretch"===this.layer.renderer.type&&(a.factor=a.factor.map((e=>255*e)),a.outMin=Math.round(255*a.outMin),a.outMax=Math.round(255*a.outMax)),this._globalSymbolizerParams=a}_updateSymbolizerParams(){const{resolution:e}=this.previousLOD,t=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:t})}_updateBlockCacheRegistry(e=!1){const{layer:t,layerView:i}=this,{url:s,raster:r}=t,{multidimensionalDefinition:a}=t.normalizeRasterFetchOptions({multidimensionalDefinition:t.multidimensionalDefinition,timeExtent:i.timeExtent}),o=r.rasterInfo.multidimensionalInfo?r.getSliceIndex(a):null,l=g(s,o);if(l!==this._blockCacheRegistryUrl){if(null!=this._blockCacheRegistryUrl&&d(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=y(l,r.rasterInfo),e){const{view:e}=i,t=this._tileInfoView.getClosestInfoForScale(e.scale),s=this._srcResolutions[t.level];p(l,this._blockCacheRegistryId,e.extent,e.resolution,s,r.ioConfig.sampling)}this._blockCacheRegistryUrl=l}}async doRefresh(){if(!this.attached)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh((t=>e.push(this._enqueueTileFetch(t)))),await a(e)}};e([o()],T.prototype,"_fetchQueue",void 0),e([o()],T.prototype,"_globalUpdateRequested",void 0),e([o()],T.prototype,"attached",void 0),e([o()],T.prototype,"container",void 0),e([o()],T.prototype,"layer",void 0),e([o()],T.prototype,"layerView",void 0),e([o()],T.prototype,"type",void 0),e([o()],T.prototype,"useWebGLForProcessing",null),e([o()],T.prototype,"useProgressiveUpdate",null),e([o()],T.prototype,"timeExtent",void 0),e([o()],T.prototype,"updating",null),T=e([l("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],T);export{T as BaseImageryTileSubView2D};
|