@arcgis/core 5.0.0-next.4 → 5.0.0-next.6
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/Map.js +1 -1
- package/analysis/ElevationProfileAnalysis.js +1 -1
- package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
- package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +4 -0
- package/applications/KnowledgeStudio/generalSdkInternalAccess.js +5 -0
- package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +1 -0
- package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
- package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +2 -0
- package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
- package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
- package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/020c8913d8e35d63080b.js +1 -0
- package/assets/esri/core/workers/chunks/02e69f0c63d97661da60.js +1 -0
- package/assets/esri/core/workers/chunks/06ba43843e9c4988049b.js +1 -0
- package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +1 -0
- package/assets/esri/core/workers/chunks/{388482cea4b9fdeaf06e.js → 0f30a9514571c7be9978.js} +1 -1
- package/assets/esri/core/workers/chunks/{929ece362604dc301229.js → 17acde0245ecd956306c.js} +1 -1
- package/assets/esri/core/workers/chunks/{14ace5dc4b8984212a57.js → 17d5f8dba6ebb1184506.js} +1 -1
- package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
- package/assets/esri/core/workers/chunks/{8cea114168d849c38b1b.js → 20278683bddc8c2d8136.js} +1 -1
- package/assets/esri/core/workers/chunks/{00aa85ae6419aad183ea.js → 22d6b8102e75bdef204c.js} +1 -1
- package/assets/esri/core/workers/chunks/279366e6b743f9680603.js +1 -0
- package/assets/esri/core/workers/chunks/285762ff92d5388b6024.js +1 -0
- package/assets/esri/core/workers/chunks/{4f01be74dd26e639330f.js → 2f24017e72d41c259faa.js} +1 -1
- package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
- package/assets/esri/core/workers/chunks/{3d65b8a2fbe1df050a25.js → 377a66034e7c1bad5599.js} +1 -1
- package/assets/esri/core/workers/chunks/37f2ef14399546e697e6.js +1 -0
- package/assets/esri/core/workers/chunks/{0f9bb3187306f89e3d63.js → 398f356b11fd33bd3831.js} +1 -1
- package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 3ac7562ea90f91a9f30c.js} +1 -1
- package/assets/esri/core/workers/chunks/3f3d492f1093b7832aab.js +1 -0
- package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +1 -0
- package/assets/esri/core/workers/chunks/464d42bebb365287808d.js +1 -0
- package/assets/esri/core/workers/chunks/4c5a7249a311070d8f43.js +1 -0
- package/assets/esri/core/workers/chunks/{d570c75a425aa29672c8.js → 4d599008e1ea42321b37.js} +1 -1
- package/assets/esri/core/workers/chunks/{c0feec6e2f0e45900ae0.js → 53bd8996e8812f1ad7b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a723d739ac44b45432c.js → 557960763695abee4a83.js} +1 -1
- package/assets/esri/core/workers/chunks/5bd36dbf46c25bd961c8.js +1 -0
- package/assets/esri/core/workers/chunks/{b7a17927e14f502006b4.js → 5ea0c62016d56990787b.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ea6985da4eb0107bb9d.js → 5fc7b61f467f1d60a284.js} +1 -1
- package/assets/esri/core/workers/chunks/{a87521ebe632bf783ef4.js → 62a49cfd9a2508950e9f.js} +1 -1
- package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{ec13053af1999701464a.js → 6826fe54562dcdc054d7.js} +1 -1
- package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +1 -0
- package/assets/esri/core/workers/chunks/{8215015f11221a354273.js → 6d049182bec34a22abcd.js} +1 -1
- package/assets/esri/core/workers/chunks/{309c5f69ea06f3081d83.js → 73487b9d85e726e9c012.js} +1 -1
- package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +1 -0
- package/assets/esri/core/workers/chunks/{3d22fe2f2c40abbc246e.js → 7461124454bfb4fb6474.js} +1 -1
- package/assets/esri/core/workers/chunks/{147ad5fdd02f46b6da24.js → 7544316a75dbd981aea6.js} +1 -1
- package/assets/esri/core/workers/chunks/75bf27271a31e26e1b21.js +1 -0
- package/assets/esri/core/workers/chunks/{630efe10c871425b6a95.js → 76ae1702fecc7ad7017c.js} +1 -1
- package/assets/esri/core/workers/chunks/{de1f75c907152df7e788.js → 794748fd1edc29a621cd.js} +1 -1
- package/assets/esri/core/workers/chunks/79dbfa2b9b332ca0002f.js +1 -0
- package/assets/esri/core/workers/chunks/7a23ab84e1144f081c92.js +1 -0
- package/assets/esri/core/workers/chunks/7aaaebbabee27690283c.js +1 -0
- package/assets/esri/core/workers/chunks/7c4a63aeead2505d6f02.js +1 -0
- package/assets/esri/core/workers/chunks/{2a5f331c0f18d8574b4e.js → 811d4c46c75cf6a63e78.js} +1 -1
- package/assets/esri/core/workers/chunks/8372f142c4d7a65c7954.js +1 -0
- package/assets/esri/core/workers/chunks/{d84373a6ec94dcfec8c2.js → 88074189fa10c335370b.js} +1 -1
- package/assets/esri/core/workers/chunks/{dc31865edea480f0ebba.js → 8833c3d168951be4bf20.js} +1 -1
- package/assets/esri/core/workers/chunks/883ffaa69b3e6eb158bf.js +1 -0
- package/assets/esri/core/workers/chunks/{85622fe99f4d08afe875.js → 8a314b3790313e6dc5db.js} +1 -1
- package/assets/esri/core/workers/chunks/{b0b2670596d6d8c32b5e.js → 8c056eac35d05d9524b7.js} +1 -1
- package/assets/esri/core/workers/chunks/{0086a09441627842d34a.js → 8f3503b2fb6cd38757b9.js} +1 -1
- package/assets/esri/core/workers/chunks/{1a713dcc9971e1935401.js → 8f56f298e7c1a283f407.js} +1 -1
- package/assets/esri/core/workers/chunks/{dabc5a38a472c9719df9.js → 8ffd4710d168c2fcfd96.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2add7338258ca7c24dd.js → 90250e9239c173aace88.js} +1 -1
- package/assets/esri/core/workers/chunks/90b2b43b8b54c9a1ec35.js +1 -0
- package/assets/esri/core/workers/chunks/90f8b4bda28af43ea019.js +1 -0
- package/assets/esri/core/workers/chunks/{89027f6800e17fab8973.js → 9486032af3e934d85582.js} +1 -1
- package/assets/esri/core/workers/chunks/95c594a87b732f5c4979.js +1 -0
- package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +1 -0
- package/assets/esri/core/workers/chunks/99859dce1925b406ccd0.js +1 -0
- package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +1 -0
- package/assets/esri/core/workers/chunks/9e8dceef4c961f56940d.js +1 -0
- package/assets/esri/core/workers/chunks/9fac5a12e878cd745354.js +1 -0
- package/assets/esri/core/workers/chunks/a06bac9b8f9e18874de8.js +316 -0
- package/assets/esri/core/workers/chunks/a091623bbfb3d771c8d8.js +1 -0
- package/assets/esri/core/workers/chunks/{01642fe19e81bfa33eb5.js → a395373e3173e6458a56.js} +1 -1
- package/assets/esri/core/workers/chunks/a3991ae8caa713d4ddcd.js +1 -0
- package/assets/esri/core/workers/chunks/{135e270b4f03c4270870.js → a4db5c9a90107e097df8.js} +1 -1
- package/assets/esri/core/workers/chunks/a712cdff78fc826acd8c.js +1 -0
- package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/aa54b6f2aba6952af149.js +1 -0
- package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/ac26e3e77df4302f47a2.js +1 -0
- package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
- package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → b017bac40dc8328013e3.js} +2 -2
- package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → b017bac40dc8328013e3.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{bc3bcf88b252760e2574.js → b3028b1ff75eafd0c358.js} +1 -1
- package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
- package/assets/esri/core/workers/chunks/b96eb0ea506379182d62.js +2 -0
- package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → b96eb0ea506379182d62.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{b5863afafd3a7d2d5c05.js → bb5484b5eeacc9ad2ceb.js} +3 -3
- package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
- package/assets/esri/core/workers/chunks/bb7976e2f883b544add6.js +1 -0
- package/assets/esri/core/workers/chunks/{5875a51b97ee9bd438a0.js → bc241c7735e4efba734a.js} +1 -1
- package/assets/esri/core/workers/chunks/{56916e56c20465428dd4.js → be3b874f86f627f4fa98.js} +1 -1
- package/assets/esri/core/workers/chunks/{0eaa4dccba0d844b9da3.js → c3ddcf9148dd2640c402.js} +1 -1
- package/assets/esri/core/workers/chunks/c476643002387f60ea42.js +1 -0
- package/assets/esri/core/workers/chunks/c4e4da69969499a89a2c.js +1 -0
- package/assets/esri/core/workers/chunks/c8733cd621105afab2ac.js +1 -0
- package/assets/esri/core/workers/chunks/ccc0da0e01f023c8aa1f.js +1 -0
- package/assets/esri/core/workers/chunks/cd1930f08e1fc8b30b14.js +1 -0
- package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/d048e4926e78458afa3e.js +1 -0
- package/assets/esri/core/workers/chunks/d1fe816b6990918c13c7.js +1 -0
- package/assets/esri/core/workers/chunks/d305a21666b1ed5bf33d.js +1 -0
- package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
- package/assets/esri/core/workers/chunks/d40f57f9fc47f9a9f97c.js +1 -0
- package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/d97fadbc69e055d183a0.js +1 -0
- package/assets/esri/core/workers/chunks/dedc4583b5f32a278124.js +1 -0
- package/assets/esri/core/workers/chunks/e31192ae920e3e19b6aa.js +1 -0
- package/assets/esri/core/workers/chunks/{e5bcc44f3dc6fc90835a.js → e5a06ce0ef6a9a90e100.js} +1 -1
- package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +1 -0
- package/assets/esri/core/workers/chunks/f0e0a63962784acb4ba1.js +1 -0
- package/assets/esri/core/workers/chunks/{039ec0fbe3b4b398b8c6.js → f26dc1d83beed63b6045.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa5c87889c2f0bef896b.js → f35aaa04cca676c2d3f8.js} +1 -1
- package/assets/esri/core/workers/chunks/f4d0ae6be1b3984228d0.js +1 -0
- package/assets/esri/core/workers/chunks/{7c5c272612198db83851.js → f5e47eea8720ba84665b.js} +1 -1
- package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{fa4411e0a5ac3fcba365.js → f65c0102af17390a50ac.js} +1 -1
- package/assets/esri/core/workers/chunks/f6c11c8ac687de3ef1ab.js +1 -0
- package/assets/esri/core/workers/chunks/f6c8beb60f6d29945a2e.js +1 -0
- package/assets/esri/core/workers/chunks/f746e3f7ebff2bbdf333.js +1 -0
- package/assets/esri/core/workers/chunks/f9324e88c359c03f35aa.js +1 -0
- package/assets/esri/core/workers/chunks/{cfa3164e7fa1884dc2b9.js → facb3886714222772ab2.js} +1 -1
- package/assets/esri/core/workers/chunks/fd2efd1d1cf9d95a87e6.js +1 -0
- package/assets/esri/core/workers/chunks/{fe3f95fda29e4844b153.js → fe77ae6cf232a7a3298e.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ce4a0fe4fae63c43a81.js → ff35a077ac6776469805.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
- package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/ComponentShader.glsl.js +72 -39
- package/chunks/OITBlend.glsl.js +3 -3
- package/chunks/bundle.js +1 -1
- package/config.js +1 -1
- package/core/Identifiable.js +1 -1
- package/core/MultiOriginJSONSupport.js +1 -1
- package/core/NumericIdentifiable.js +5 -0
- package/core/QueueProcessor.js +1 -1
- package/core/WriteableMultiOriginJSONMixin.js +5 -0
- package/core/has.js +1 -1
- package/core/performance.js +5 -0
- package/core/sanitizerUtils.js +1 -1
- package/core/scheduling.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/core/workers/WorkerHandle.js +1 -1
- package/core/workers/utils.js +1 -1
- package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
- package/geohash/GeohashCell.js +1 -1
- package/geohash/geohashUtils.js +1 -1
- package/geometry/GeometryCursor.js +1 -1
- package/geometry/geometryCursorCollectUtils.js +1 -1
- package/geometry/libtess.js +1 -1
- package/geometry/support/jsonUtils.js +1 -1
- package/geometry/support/normalizeUtilsSync.js +1 -1
- package/geometry/support/triangulationUtils.js +1 -1
- package/interfaces.d.ts +444 -349
- package/intl/date.js +1 -1
- package/intl.d.ts +2 -0
- package/intl.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/graphics/OptimizedFeature.js +1 -1
- package/layers/graphics/OptimizedGeometry.js +1 -1
- package/layers/graphics/centroid.js +1 -1
- package/layers/graphics/contains.js +1 -1
- package/layers/graphics/data/AttributesBuilder.js +1 -1
- package/layers/graphics/data/FeatureStore.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/geometryUtils.js +1 -1
- package/layers/graphics/data/spatialQuerySupport.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/MediaElementBase.js +1 -1
- package/layers/support/PixelBlock.js +1 -1
- package/layers/support/RasterInfo.js +1 -1
- package/layers/support/RasterJobHandler.js +1 -1
- package/layers/support/RasterSensorInfo.js +1 -1
- package/layers/support/RasterStorageInfo.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/arcgisLayerUrl.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterDatasets/pixelReader.js +1 -1
- package/layers/support/rasterFieldUtils.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/package.json +5 -5
- package/request.js +1 -1
- package/rest/print.js +1 -1
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/query/operations/queryZScale.js +1 -1
- package/rest/versionManagement/getVersionInfos.js +1 -1
- package/smartMapping/statistics/histogram.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/utils.js +1 -1
- package/support/basemapDefinitions.js +1 -1
- package/support/elevationInfoUtils.js +1 -1
- package/support/requestImageUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/GoToManager.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
- package/views/2d/constraints/GeometryConstraint.js +1 -1
- package/views/2d/constraints/RotationConstraint.js +1 -1
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/Mesh2D.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/aggregation/GridCell.js +1 -1
- package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/schema/SourceSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/glTF/DefaultLoadingContext.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureSet/PBFPointFeatureSetView.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/StreamDataLoader.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/flow/FlowWorker.js +1 -1
- package/views/3d/support/flow/StreamlineResources3D.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
- package/views/3d/support/flow/constants.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileOverlayData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderModules/BooleanDrawUniform.js +5 -0
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConstructionContext.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +4 -4
- package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/reshapeUtils.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/Attachments/AttachmentsViewModel.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions/css.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.d.ts +4 -0
- package/widgets/Editor/MergeFeaturesWorkflow.js +5 -0
- package/widgets/Editor/MergeFeaturesWorkflowData.d.ts +4 -0
- package/widgets/Editor/MergeFeaturesWorkflowData.js +5 -0
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/components/UploadDetails.js +1 -1
- package/widgets/Editor/support/EditorItem.js +1 -1
- package/widgets/Editor/support/mergeFeaturesUtils.js +5 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Search/LayerSearchSource.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/jsxWidgetSupport.js +1 -1
- package/assets/esri/core/workers/chunks/0429c1a3690f20647c9f.js +0 -1
- package/assets/esri/core/workers/chunks/065f2bbcaeef1f13fd48.js +0 -1
- package/assets/esri/core/workers/chunks/0731e588afd1f561ec3b.js +0 -1
- package/assets/esri/core/workers/chunks/188272af9a6470ccfe31.js +0 -1
- package/assets/esri/core/workers/chunks/18da83afbc324fef9fd8.js +0 -316
- package/assets/esri/core/workers/chunks/1a9f544f20f643161a36.js +0 -1
- package/assets/esri/core/workers/chunks/1cfcadaa98ac528fea37.js +0 -1
- package/assets/esri/core/workers/chunks/1db0bf570a04687b3130.js +0 -1
- package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
- package/assets/esri/core/workers/chunks/2a900a632a1231deb713.js +0 -1
- package/assets/esri/core/workers/chunks/31c6e951b99315e8e68a.js +0 -1
- package/assets/esri/core/workers/chunks/35491fbdd287470d40a4.js +0 -1
- package/assets/esri/core/workers/chunks/36247c6f6fc2891df2cf.js +0 -1
- package/assets/esri/core/workers/chunks/3d53307efbc3f07d7bf2.js +0 -1
- package/assets/esri/core/workers/chunks/40b81d1c2d53cf598b8e.js +0 -1
- package/assets/esri/core/workers/chunks/42a72e1d963e4636323b.js +0 -1
- package/assets/esri/core/workers/chunks/456161a323be7d640c61.js +0 -1
- package/assets/esri/core/workers/chunks/500d09d2191127371081.js +0 -1
- package/assets/esri/core/workers/chunks/50864c1924030e62497d.js +0 -1
- package/assets/esri/core/workers/chunks/5707713c2f27588b9194.js +0 -1
- package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
- package/assets/esri/core/workers/chunks/5718cf135e105e1e026b.js +0 -1
- package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +0 -1
- package/assets/esri/core/workers/chunks/5d1d909354c90cb8eb60.js +0 -1
- package/assets/esri/core/workers/chunks/5ea03f53d4d64d9e7cae.js +0 -1
- package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +0 -1
- package/assets/esri/core/workers/chunks/64629ddcf008349eaf41.js +0 -1
- package/assets/esri/core/workers/chunks/64ee8d2acae2d6fce608.js +0 -1
- package/assets/esri/core/workers/chunks/6fcacfcb3d83515c37c9.js +0 -1
- package/assets/esri/core/workers/chunks/72ecf49d03bb24bf0998.js +0 -1
- package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
- package/assets/esri/core/workers/chunks/77a11d7d53325d108ed8.js +0 -1
- package/assets/esri/core/workers/chunks/7a05b1f6163112bc9db2.js +0 -1
- package/assets/esri/core/workers/chunks/7d9882ddfa6495f72baa.js +0 -1
- package/assets/esri/core/workers/chunks/7fffad8ff6878fa1fd56.js +0 -1
- package/assets/esri/core/workers/chunks/81bbe5251ed13c0d91cc.js +0 -1
- package/assets/esri/core/workers/chunks/8b16aa50d879b92a5375.js +0 -1
- package/assets/esri/core/workers/chunks/8bc64fc7c4b9eb8fca4d.js +0 -1
- package/assets/esri/core/workers/chunks/8bfa19c24be0e3f3fd74.js +0 -1
- package/assets/esri/core/workers/chunks/8eefa133c36a004c054c.js +0 -1
- package/assets/esri/core/workers/chunks/9834bc11586a2d8d6f35.js +0 -1
- package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +0 -1
- package/assets/esri/core/workers/chunks/a5f25104938ab33e7a85.js +0 -1
- package/assets/esri/core/workers/chunks/a7bd294996e6c8b8354a.js +0 -1
- package/assets/esri/core/workers/chunks/abf4f018c692c18c3320.js +0 -1
- package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +0 -1
- package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +0 -1
- package/assets/esri/core/workers/chunks/b62807c6fcfb70a87cd4.js +0 -1
- package/assets/esri/core/workers/chunks/b8339c1d60847a9eed3e.js +0 -1
- package/assets/esri/core/workers/chunks/bc6619307f312f9241bf.js +0 -1
- package/assets/esri/core/workers/chunks/bfc1e8aec7aace3ff30e.js +0 -1
- package/assets/esri/core/workers/chunks/c362fbbafec91c44eeb2.js +0 -1
- package/assets/esri/core/workers/chunks/c368a8e8d2f1535af446.js +0 -1
- package/assets/esri/core/workers/chunks/c941d15190fc08523d0d.js +0 -1
- package/assets/esri/core/workers/chunks/cc70a4a915b0b2ccb2a0.js +0 -1
- package/assets/esri/core/workers/chunks/d121045cddbe55c2ecb2.js +0 -1
- package/assets/esri/core/workers/chunks/d2120a623b1bd91b9ed9.js +0 -1
- package/assets/esri/core/workers/chunks/d78c2833cdc4730a88a3.js +0 -1
- package/assets/esri/core/workers/chunks/df438b62702007267798.js +0 -1
- package/assets/esri/core/workers/chunks/f4eb090bcc3eca64306a.js +0 -1
- package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +0 -1
- package/assets/esri/core/workers/chunks/f839b86bee15deaf84e4.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import i from"../../../TrackGraphic.js";import{isSome as s}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import c from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as g,throwIfNotAbortError as f,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as _}from"../../../core/unitUtils.js";import{property as b}from"../../../core/accessorSupport/decorators/property.js";import{subclass as S}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import{isCurvedGeometry as j}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as U}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import x from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as I}from"../../../layers/graphics/featureConversionUtils.js";import k from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as E}from"../../../layers/support/featureLayerUtils.js";import{packFields as C}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as O}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as R}from"../../../layers/support/timeSupport.js";import V from"../../../rest/support/AggregateFeatureSet.js";import q from"../../../rest/support/AttributeBinsFeatureSet.js";import Q from"../../../rest/support/AttributeBinsQuery.js";import L from"../../../rest/support/FeatureSet.js";import T from"../../../rest/support/Query.js";import{LayerView2DMixin as M}from"./LayerView2D.js";import{FeatureContainer as P}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as H}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as D}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as G}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as N}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as J}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as $}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as B}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as z}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as Z}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as K}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as X}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Y}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as ee}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as te}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as re}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ie}from"./support/util.js";import{FeatureTileSubscriptionManager as se}from"../tiling/FeatureTileSubscriptionManager.js";import ae from"../../layers/FeatureLayerView.js";import oe from"../../layers/LayerView.js";import{RefreshableLayerView as ne}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ue}from"../../support/highlightOptionsUtils.js";function le(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ce=4294967294;function he(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}function pe(e){if(!e.geometry)return e;if(!j(e.geometry))return e;const t=.001/_(e.geometry.spatialReference),r=100;return{geometry:U(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}let de=class extends(ae(ne(M(oe)))){constructor(){super(...arguments),this._commandsQueue=new te({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new x,this._lastUpdate=0}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),g(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===O(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await H(t)}async _attachProxy(){const e={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};try{await this._workerProxy.pipeline.onAttach(e),this._workerAttached.resolve()}catch(t){this._workerAttached.reject(d()),f(t)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:i,labelingInfo:s})=>({labelingInfo:s,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:i,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new J(this.layer):new G(this.layer);case"geojson":case"csv":case"wfs":return new J(this.layer);case"parquet":return new Z(this.layer);case"subtype-group":return new X(this.layer);case"ogc-feature":return new B(this.layer);case"stream":return new K(this.layer);case"oriented-imagery":return new z(this.layer);case"knowledge-graph-sublayer":return new $(this.layer);case"catalog-footprint":return new D(this.layer);default:o(this.layer)}return null}get timeExtent(){return R(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let i;e instanceof r?i=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?i=[e]:a.isCollection(e)&&e.length>0?i=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=i?.filter(s);if(!o?.length)return u();const n=ue(t);return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,s){const a=await this.featureContainer.hitTest(s);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),c=this.featureContainer.getSortKeys(a),h=({displayId:e},{displayId:t})=>c.has(e)&&c.has(t)?c.get(e)-c.get(t):e-t;return n.sort(h).reverse(),u.sort(h).reverse(),[...u.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createTrackGraphicHit(e,i.fromJSON(t))),...n.map(t=>this._createFeatureGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return re(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r);return re(a,{})}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r);return re(s,{})}async queryUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r);return re(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r);return re(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r);return re(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r);return re(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r);return re(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r);return re(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=L.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=await re(r,{features:[]}),s=L.fromJSON(i);return s.features.forEach(e=>this._setOriginForFeature(e)),s}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=await re(r,{features:[]}),s=V.fromJSON(i);return s.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),s}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return re(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return re(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return re(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return re(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return re(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return re(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),i=await re(r,{count:0,extent:null});return{count:i.count,extent:F.fromJSON(i.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),i=await re(r,{features:[]});return q.fromJSON(i)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),i=new Set(this.subscriptionManager.coverage?.target.keys());for(const s of this.featureContainer.tiles||[])s.isCoverage=i.has(s.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),g(this._updatingHandles.addPromise(this._workerAttached.promise)),g(this._attachProxy()),this.featureContainer=new P(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new se({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),g(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([he([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.view.labelManager.removeContainer(this.featureContainer),this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=h(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),g(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,i=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||r)||i||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return s}_createClientOptions(){const e=this;return{openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const i of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(i));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const s=r.visualVariableUniforms,a=ie(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Y({...o.data,hasTextStringTemplates:!0},{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=T.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=Q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=T.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ce+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ce+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?c.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const i="globalIdField"in this.layer&&this.layer.globalIdField,s=i&&this.availableFields.includes(i);if(r.length&&!s)return c.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,i=ie(this.layer.geometryType),s=N(this.layer),a=[];for(const o of e.added){const e=I(pe(o),i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=I(pe(o),i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,i="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(i&&this._canEditByFeature(i)){const{adds:e,deletes:t,updates:s}=i.editedFeatures,a=this.layer.objectIdField,o=s.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[s,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...s,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),E(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const i=this.featureEffect,s={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:await this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(s,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.strategy,o.source.strategy)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=i);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const c=await this.getWorker();await c.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=i,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const h=o.processor.mesh.strategy,d="cluster"===h.type||"binning"===h.type,y="heatmap"===o.processor.mesh.factory.symbology.type,g=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(g),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new ee;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new ee;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=le(this._lastAvailableFields,e);return this._lastAvailableFields=t,C(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[ye(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||c.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function ye(e,t,r,i,s,a){s&&(s=s.clone());const o=null!=s?s.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(s??=new k,s.timeExtent=n),s=t.addFilters?.(s,e)??s,a&&(s??=new k,s.where=v(s.where,a));let u=s?.toJSON()??null;return i.size&&(u??=(new k).toJSON(),u.hiddenIds=Array.from(i)),u}e([b()],de.prototype,"_commandsQueue",void 0),e([b()],de.prototype,"_sourceRefreshVersion",void 0),e([b()],de.prototype,"_displayRefreshVersion",void 0),e([b({readOnly:!0})],de.prototype,"_pipelineUpdating",void 0),e([b()],de.prototype,"_sourceUpdating",void 0),e([b({readOnly:!0})],de.prototype,"dataUpdating",null),e([b({readOnly:!0})],de.prototype,"hasAllFeatures",null),e([b({readOnly:!0})],de.prototype,"hasAllFeaturesInView",null),e([b({readOnly:!0})],de.prototype,"hasFullGeometries",null),e([b()],de.prototype,"featureEffectView",void 0),e([b()],de.prototype,"labelingCollisionInfos",null),e([b()],de.prototype,"layerAdapter",null),e([b({readOnly:!0})],de.prototype,"timeExtent",null),de=e([S("esri.views.2d.layers.FeatureLayerView2D")],de);export{de as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import i from"../../../TrackGraphic.js";import{isSome as s}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import c from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as g,throwIfNotAbortError as f,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as _}from"../../../core/unitUtils.js";import{property as b}from"../../../core/accessorSupport/decorators/property.js";import{subclass as S}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import{isCurvedGeometry as j}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as U}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import x from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as I}from"../../../layers/graphics/featureConversionUtils.js";import k from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as E}from"../../../layers/support/featureLayerUtils.js";import{packFields as C}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as O}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as R}from"../../../layers/support/timeSupport.js";import V from"../../../rest/support/AggregateFeatureSet.js";import q from"../../../rest/support/AttributeBinsFeatureSet.js";import Q from"../../../rest/support/AttributeBinsQuery.js";import L from"../../../rest/support/FeatureSet.js";import M from"../../../rest/support/Query.js";import{LayerView2DMixin as T}from"./LayerView2D.js";import{FeatureContainer as P}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as H}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as D}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as G}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as N}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as J}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as $}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as B}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as z}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as Z}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as K}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as X}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Y}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as ee}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as te}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as re}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ie}from"./support/util.js";import{FeatureTileSubscriptionManager as se}from"../tiling/FeatureTileSubscriptionManager.js";import ae from"../../layers/FeatureLayerView.js";import oe from"../../layers/LayerView.js";import{RefreshableLayerView as ne}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ue}from"../../support/highlightOptionsUtils.js";function le(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ce=4294967294;function he(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}function pe(e){if(!e.geometry)return e;if(!j(e.geometry))return e;const t=.001/_(e.geometry.spatialReference),r=100;return{geometry:U(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}let de=class extends(ae(ne(T(oe)))){constructor(){super(...arguments),this._commandsQueue=new te({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new x,this._lastUpdate=0}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),g(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===O(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await H(t)}async _attachProxy(){const e={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};try{await this._workerProxy.pipeline.onAttach(e),this._workerAttached.resolve()}catch(t){this._workerAttached.reject(d()),f(t)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:i,labelingInfo:s})=>({labelingInfo:s,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:i,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new J(this.layer):new G(this.layer);case"geojson":case"csv":case"wfs":return new J(this.layer);case"parquet":return new Z(this.layer);case"subtype-group":return new X(this.layer);case"ogc-feature":return new B(this.layer);case"stream":return new K(this.layer);case"oriented-imagery":return new z(this.layer);case"knowledge-graph-sublayer":return new $(this.layer);case"catalog-footprint":return new D(this.layer);default:o(this.layer)}return null}get timeExtent(){return R(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let i;e instanceof r?i=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?i=[e]:a.isCollection(e)&&e.length>0?i=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=i?.filter(s);if(!o?.length)return u();const n=ue(t);return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,s){const a=await this.featureContainer.hitTest(s);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),c=this.featureContainer.getSortKeys(a),h=({displayId:e},{displayId:t})=>c.has(e)&&c.has(t)?c.get(e)-c.get(t):e-t;return n.sort(h).reverse(),u.sort(h).reverse(),[...u.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createTrackGraphicHit(e,i.fromJSON(t))),...n.map(t=>this._createFeatureGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return re(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r);return re(a,{})}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r);return re(s,{})}async queryUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r);return re(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r);return re(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r);return re(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r);return re(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r);return re(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r);return re(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=L.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=await re(r,{features:[]}),s=L.fromJSON(i);return s.features.forEach(e=>this._setOriginForFeature(e)),s}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=await re(r,{features:[]}),s=V.fromJSON(i);return s.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),s}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return re(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return re(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return re(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return re(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return re(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return re(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),i=await re(r,{count:0,extent:null});return{count:i.count,extent:F.fromJSON(i.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),i=await re(r,{features:[]});return q.fromJSON(i)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),i=new Set(this.subscriptionManager.coverage?.target.keys());for(const s of this.featureContainer.tiles||[])s.isCoverage=i.has(s.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),g(this._updatingHandles.addPromise(this._workerAttached.promise)),g(this._attachProxy()),this.featureContainer=new P(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new se({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),g(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([he([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.symbolFader.restartDeclutter(),this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.view.labelManager.removeContainer(this.featureContainer),this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=h(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),g(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,i=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||r)||i||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return s}_createClientOptions(){const e=this;return{openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const i of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(i));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const s=r.visualVariableUniforms,a=ie(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Y({...o.data,hasTextStringTemplates:!0},{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=M.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=Q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=M.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ce+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ce+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?c.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const i="globalIdField"in this.layer&&this.layer.globalIdField,s=i&&this.availableFields.includes(i);if(r.length&&!s)return c.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,i=ie(this.layer.geometryType),s=N(this.layer),a=[];for(const o of e.added){const e=I(pe(o),i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=I(pe(o),i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,i="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(i&&this._canEditByFeature(i)){const{adds:e,deletes:t,updates:s}=i.editedFeatures,a=this.layer.objectIdField,o=s.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[s,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...s,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),E(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const i=this.featureEffect,s={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:await this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(s,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.strategy,o.source.strategy)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=i);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const c=await this.getWorker();await c.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=i,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const h=o.processor.mesh.strategy,d="cluster"===h.type||"binning"===h.type,y="heatmap"===o.processor.mesh.factory.symbology.type,g=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(g),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new ee;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new ee;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=le(this._lastAvailableFields,e);return this._lastAvailableFields=t,C(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[ye(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||c.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function ye(e,t,r,i,s,a){s&&(s=s.clone());const o=null!=s?s.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(s??=new k,s.timeExtent=n),s=t.addFilters?.(s,e)??s,a&&(s??=new k,s.where=v(s.where,a));let u=s?.toJSON()??null;return i.size&&(u??=(new k).toJSON(),u.hiddenIds=Array.from(i)),u}e([b()],de.prototype,"_commandsQueue",void 0),e([b()],de.prototype,"_sourceRefreshVersion",void 0),e([b()],de.prototype,"_displayRefreshVersion",void 0),e([b({readOnly:!0})],de.prototype,"_pipelineUpdating",void 0),e([b()],de.prototype,"_sourceUpdating",void 0),e([b({readOnly:!0})],de.prototype,"dataUpdating",null),e([b({readOnly:!0})],de.prototype,"hasAllFeatures",null),e([b({readOnly:!0})],de.prototype,"hasAllFeaturesInView",null),e([b({readOnly:!0})],de.prototype,"hasFullGeometries",null),e([b()],de.prototype,"featureEffectView",void 0),e([b()],de.prototype,"labelingCollisionInfos",null),e([b()],de.prototype,"layerAdapter",null),e([b({readOnly:!0})],de.prototype,"timeExtent",null),de=e([S("esri.views.2d.layers.FeatureLayerView2D")],de);export{de 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{quantizeX as t,quantizeY as e,quantizeOptimizedGeometry as r}from"../../../../../layers/graphics/featureConversionUtils.js";import i from"../../../../../layers/graphics/OptimizedGeometry.js";import{AAggregateCell as s}from"./AAggregateCell.js";import{AccumulatedStatistics as o}from"./AccumulatedStatistics.js";class l extends s{static createId(t,e){return`${t}.${e}`}static create(t,e,r,i){return new l(t,e,o.create(r),i)}constructor(t,e,r,i){super(r),this.gridX=t,this.gridY=e,this._worldUnitsPerCell=i,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return l.createId(this.gridX,this.gridY)}get containedObjectIds(){return this._objectIds}get count(){return this._count}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}get usedMemory(){return 48}clone(){const t=new l(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return t._count=this._count,t._xWorldTotal=this._xWorldTotal,t._yWorldTotal=this._yWorldTotal,t._firstFeatureAttributes=this._firstFeatureAttributes,t._objectIds=new Set(this._objectIds),t}insert(t,e,r,i){0===this._count?this._firstFeatureAttributes=t.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=r,this._yWorldTotal+=i,this._statistics.insert(t,e),this._objectIds.add(t.getObjectId())}merge(t){if(0!==t._count){this._count+=t._count,this._firstFeatureAttributes=t._firstFeatureAttributes,this._xWorldTotal+=t._xWorldTotal,this._yWorldTotal+=t._yWorldTotal,this._statistics.merge(t._statistics);for(const e of t._objectIds.values())this._objectIds.add(e)}}getCentroidX(e){return null==e?this.centroidXWorld:t(e,this.centroidXWorld)}getCentroidY(t){return null==t?this.centroidYWorld:e(t,this.centroidYWorld)}getGeometry(t,e){const s=this.gridX*this._worldUnitsPerCell,o=this.gridY*this._worldUnitsPerCell,l=new i([4],[s,o,s+this._worldUnitsPerCell,o,s+this._worldUnitsPerCell,o+this._worldUnitsPerCell,s,o+this._worldUnitsPerCell]);
|
|
5
|
+
import{quantizeX as t,quantizeY as e,quantizeOptimizedGeometry as r}from"../../../../../layers/graphics/featureConversionUtils.js";import i from"../../../../../layers/graphics/OptimizedGeometry.js";import{AAggregateCell as s}from"./AAggregateCell.js";import{AccumulatedStatistics as o}from"./AccumulatedStatistics.js";class l extends s{static createId(t,e){return`${t}.${e}`}static create(t,e,r,i){return new l(t,e,o.create(r),i)}constructor(t,e,r,i){super(r),this.gridX=t,this.gridY=e,this._worldUnitsPerCell=i,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return l.createId(this.gridX,this.gridY)}get containedObjectIds(){return this._objectIds}get count(){return this._count}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}get usedMemory(){return 48}clone(){const t=new l(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return t._count=this._count,t._xWorldTotal=this._xWorldTotal,t._yWorldTotal=this._yWorldTotal,t._firstFeatureAttributes=this._firstFeatureAttributes,t._objectIds=new Set(this._objectIds),t}insert(t,e,r,i){0===this._count?this._firstFeatureAttributes=t.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=r,this._yWorldTotal+=i,this._statistics.insert(t,e),this._objectIds.add(t.getObjectId())}merge(t){if(0!==t._count){this._count+=t._count,this._firstFeatureAttributes=t._firstFeatureAttributes,this._xWorldTotal+=t._xWorldTotal,this._yWorldTotal+=t._yWorldTotal,this._statistics.merge(t._statistics);for(const e of t._objectIds.values())this._objectIds.add(e)}}getCentroidX(e){return null==e?this.centroidXWorld:t(e,this.centroidXWorld)}getCentroidY(t){return null==t?this.centroidYWorld:e(t,this.centroidYWorld)}getGeometry(t,e){const s=this.gridX*this._worldUnitsPerCell,o=this.gridY*this._worldUnitsPerCell,l=new i([4],[s,o,s+this._worldUnitsPerCell,o,s+this._worldUnitsPerCell,o+this._worldUnitsPerCell,s,o+this._worldUnitsPerCell]);return null!=e?r(l,"esriGeometryPolygon",e):l}getCentroid(t){const e=new i([],[this.centroidXWorld,this.centroidYWorld]);return null!=t?r(e,"esriGeometryPoint",t):e}getGeometricCentroid(t,e){const s=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,o=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,l=new i([],[s,o]);return null!=e?r(l,"esriGeometryPoint",e):l}getAttributes(){const t={aggregateId:this.id};for(const e of this._statistics.values())t[e.field.name]=e.value;return null!=this._firstFeatureAttributes?{...t,...this._firstFeatureAttributes}:t}}export{l as GridCell};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{EventEmitter as e}from"../../../../../core/Evented.js";import{create as r}from"../../../../../geometry/support/aaBoundingBox.js";import{getBoundsOptimizedGeometry as t}from"../../../../../layers/graphics/featureConversionUtils.js";import{optimizedFeatureQueryEngineAdapter as a}from"../../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter.js";import{QueryEngine as s}from"../../../../../layers/graphics/data/QueryEngine.js";import{collectExpressionDependencies as o}from"../../../../../support/ArcadeExpression.js";import{AProcessorStrategy as n}from"./AProcessorStrategy.js";class i extends n{constructor(r,t,s,n,i){super(r,t,i),this.spatialReference=s,this.aggregateFields=n,this._arcadeDependencies=new Set,this.events=new e,this.featureAdapter=a;for(const e of n)o(this._arcadeDependencies,e.computed)}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new s({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,featureIdInfo:this._metadata.featureIdInfo,spatialReference:this.spatialReference})),this._aggregateQueryEngine}get isAggregate(){return!0}removeChunks(e){}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}forEach(e){return this.forEachAggregateWorldSpace(e)}forEachInBounds(e,r){}forEachBounds(e,a){const s=r();for(const r of e){const e=t(s,r.geometry
|
|
5
|
+
import{EventEmitter as e}from"../../../../../core/Evented.js";import{create as r}from"../../../../../geometry/support/aaBoundingBox.js";import{getBoundsOptimizedGeometry as t}from"../../../../../layers/graphics/featureConversionUtils.js";import{optimizedFeatureQueryEngineAdapter as a}from"../../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter.js";import{QueryEngine as s}from"../../../../../layers/graphics/data/QueryEngine.js";import{collectExpressionDependencies as o}from"../../../../../support/ArcadeExpression.js";import{AProcessorStrategy as n}from"./AProcessorStrategy.js";class i extends n{constructor(r,t,s,n,i){super(r,t,i),this.spatialReference=s,this.aggregateFields=n,this._arcadeDependencies=new Set,this.events=new e,this.featureAdapter=a;for(const e of n)o(this._arcadeDependencies,e.computed)}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new s({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,featureIdInfo:this._metadata.featureIdInfo,spatialReference:this.spatialReference})),this._aggregateQueryEngine}get isAggregate(){return!0}removeChunks(e){}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}forEach(e){return this.forEachAggregateWorldSpace(e)}forEachInBounds(e,r){}forEachBounds(e,a){const s=r();for(const r of e){const e=t(s,r.geometry);e&&a(e)}}}export{i as AAggregateStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../geometry/SpatialReference.js";import{convertToFeature as t,
|
|
5
|
+
import e from"../../../../../geometry/SpatialReference.js";import{convertToFeature as t,unquantizeOptimizedGeometryInPlace as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as a}from"../../../../../layers/graphics/OptimizedFeature.js";import{checkProjectionSupport as r}from"../../../../../layers/graphics/data/projectionSupport.js";import i from"../../../../../layers/support/FieldsIndex.js";import{ComputedAggregateField as o}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as n}from"./AAggregateStrategy.js";import{ASendState as l}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as d,FeatureTileUpdateMessage as c}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as u}from"../support/ComputedAttributeStorage.js";import f from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as p}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as h}from"../support/FeatureSetReaderJSON.js";import m from"../../../tiling/TileKey.js";class g extends l{constructor(e,t){super(e),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.done=!1}destroy(){const e=this.subscription.tile.key.level;for(const t of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${t}.${e}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const e of this.featureCache.values()){const t=e.clone();t.geometry&&s(t.geometry,this.subscription.tile.transform),yield t}}}class y extends n{static async create(t,s,a,i,n,l){const d=new u({spatialReference:s}),c=await Promise.all(t.fields.map(async e=>o.create(d,e))),p=t.featureFilter?await f.create({geometryType:a.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:a.metadata.timeInfo,fieldsIndex:a.metadata.fieldsIndex,spatialReference:s,filterJSON:t.featureFilter}):null;return"geohash"===t.index.type&&await r(s,e.WGS84),new y(t,p,n,c,s,a,i,l)}constructor(e,t,s,a,r,o,n,l){super(o,n,r,a,l),this._schema=e,this._featureFilter=t,this._arcadeContextInfo=s,this._metadata=p.createFeature({geometryType:"esriGeometryPolygon",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new i(e.fields).toJSON(),globalIdField:null,spatialReference:o.metadata.spatialReference,outSpatialReference:o.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}createState(e){return new g(e,this._attributeStore)}async*applyOverrideUpdate(e){for(const t of this._sendStates.values()){t.reset();const e=new d(t.subscription,h.empty(this._source.metadata),!0,!1,{});yield e}}displayMap(e,t,s){const a=new Map(e.map(e=>[t(e),e])),r=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace()){const{objectId:t,displayId:i}=e,o=a.get(t);if(null!=o){const e=s(i,o,t);r.push(e),a.delete(t)}}return r}getDisplayFeatures(e){const s=new Set(e),a=new Set,r=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace())s.has(e.displayId)&&!a.has(e.objectId)&&(e.geometry&&r.push({...t(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),a.add(e.objectId));return{features:[],aggregates:r,tracks:[]}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.containedObjectIds);return[]}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const s of this._sendStates.values())for(const a of s.featuresWorldSpace())t.has(a.objectId)||(e(a),t.add(a.objectId))}_createIndexOptions(e){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:e.scale,sqlOptions:this._sqlOptions};case"grid":{const t=this._schema.index.fixedBinLevel,s=null!=t?e.tileInfoView.getLODInfoAt(t).scale:e.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:s,sqlOptions:this._sqlOptions}}}}async*_update(e,t){const{handledChunks:s,subscription:r,bins:i,featureCache:o}=e,n=r.tile;if(e.done)return;for(const a of t.chunks()){if(s.has(a.chunkId))continue;s.add(a.chunkId);const t=a.queryInfo;if("tileId"in t){const e=new m(t.tileId);if(e.level!==n.level||e.world!==n.key.world)continue}a.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(i,e.tile.extent,e.tile.resolution)}const l=[],d=r.tile.transform,u=r.tile.key.level;for(const c of i.values()){let e=o.get(c.id);if(e)e.attributes=c.getAttributes();else{const t=c.getGeometry(this.spatialReference,d);e=new a(t,c.getAttributes(),null,c.id),t||(e.centroid=c.getGeometricCentroid(this.spatialReference,d)),e.displayId=this._attributeStore.createDisplayIdForObjectId(`${e.objectId}.${u}`),o.set(c.id,e)}l.push(e)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const f=h.fromOptimizedFeatures(l,this._metadata,d),p=f.getCursor(),g=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo);for(;p.next();)this._attributeStore.setAttributeData(p.getDisplayId(),p,g,this._sqlOptions);const y=new c(e.subscription,f,[],e.done,{});yield y}}export{g as BinningState,y as BinningStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../../core/has.js";import{AProcessorStrategy as
|
|
5
|
+
import has from"../../../../../core/has.js";import{AProcessorStrategy as e,ASendState as t}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as o}from"../sources/strategies/chunks/Overrides.js";import{createArcadeEvaluationOptions as a}from"../support/arcadeUtils.js";import{FeatureSetReaderJSON as n}from"../support/FeatureSetReaderJSON.js";class d extends t{}class i extends e{constructor(e,t,s,r){super(e,t,r),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const e of this._source.chunks())this._cleanupChunkIds(e)}invalidateAttributeData(e){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=e,null!=this._evalOptions&&(this._evalOptions=a(this._evalOptions.$view.scale,e))}onSubscribe(e){super.onSubscribe(e),this._evalOptions=e.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(e){return new d(e)}get aggregateQueryEngine(){return null}displayMap(e,t,s){const r=new Map(e.map(e=>[t(e),e])),o=[];for(const a of this._source.chunks()){const e=a.reader.getCursor();for(;e.next();){const t=e.getObjectId(),a=e.getDisplayId(),n=r.get(t);if(null!=n){const e=s(a,n,t);o.push(e),r.delete(t)}}}return o}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const o of this._source.chunks()){const e=o.reader.getCursor();for(;e.next();){const o=e.getObjectId(),a=e.getDisplayId();t.has(a)&&!s.has(o)&&(r.push({...e.readLegacyFeatureWorldSpace(),displayId:a}),s.add(o))}}return{features:r,aggregates:[],tracks:[]}}async*applyOverrideUpdate(e){const t=[];for(const s of e.modified){const e=this._attributeStore.createDisplayIdForObjectId(s.objectId);s.displayId=e,t.push(e)}const r=n.fromOptimizedFeatures(e.modified,this._source.metadata).getCursor();for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,this._evalOptions,this._sqlOptions);const a=[];for(const s of e.removed){const e=this._attributeStore.getDisplayIdForObjectId(s);null!=e&&a.push(e)}has("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:e,modifiedDisplayIds:t,removedDisplayIds:a});const d=o.fromFeatures(e.modified,this._source.metadata);this.handledChunks.add(d.chunkId),this.handledChunksForAttributeData.add(d.chunkId),this.handledChunksForIdCreation.add(d.chunkId);for(const o of this._sendStates.values())o.handledChunks.add(d.chunkId),yield new s(o.subscription,null,t,!1,d.queryInfo);for(const o of this._sendStates.values()){const e=d.getTileReader(o.subscription.tile);yield new s(o.subscription,e,a,!1,d.queryInfo)}for(const s of e.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(e):this._attributeStore.releaseDisplayIdForObjectId(e)}this.handledChunksForIdCreation.delete(e.chunkId)}}_updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const e=s.getCursor();for(;e.next();){const t=this._attributeStore.createDisplayIdForObjectId(e.getObjectId());e.setDisplayId(t)}}}for(const e of this._source.chunks())if(this._attributeStore.referencesScale()||!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const e=t.getDisplayId();this._attributeStore.setAttributeData(e,t,this._evalOptions,this._sqlOptions)}}}*_update(e){const{subscription:t,handledChunks:s}=e;for(const o of this._source.chunks()){const{chunkId:a}=o;if(s.has(a)||!this.handledChunksForIdCreation.has(a)||!this.handledChunksForAttributeData.has(a))continue;s.add(a);const n=o.getTileReader(t.tile);n&&(yield new r(e.subscription,n,!1,o.end,o.queryInfo))}}}export{d as DefaultSendState,i as FeatureUpdateStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromNestedArray as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as b}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class W{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class z{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new b(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLineGeometry,this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=new g;m(a,r,!1,!1,this._metadata.geometryType,t.subscription.tile.transform);const o=l(1/0,1/0,-1/0,-1/0);E(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new b(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=new g;m(e,this._trackLineGeometry,!1,!1,"esriGeometryPolyline",t.subscription.tile.transform);return new b(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new b(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class M extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o,n){const l=new R({spatialReference:e}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}destroy(){super.destroy();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map(t=>t.chunkId));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new M(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=z.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new z(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e);null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function q(t,e,s){if(e.length<2)return _(t,[e],!1,!1);if(s.isWrappable){let r=!1;for(let t=1;t<e.length;t++){const i=e[t][0],a=h(i,e[t-1][0],s);i!==a&&(e[t][0]=a,r=!0)}if(r){const r=p({paths:[e],spatialReference:s});if(null!=r)return _(t,r.paths,!1,!1)}return _(t,[e],!1,!1)}const r=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),i=C.fromSpatialReference(s);if(null!=i){const e=a(r,1e6,i,o.geodesic);if(null!=e){const s=C.toGeometry(e,i);if(null!=s&&"paths"in s)return _(t,s.paths,!1,!1)}}return _(t,[e],!1,!1)}function E(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
|
|
5
|
+
import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromPolyline as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as b}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class W{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class z{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new b(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new g,o=l(1/0,1/0,-1/0,-1/0);E(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new b(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new g;return new b(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new b(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class M extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o,n){const l=new R({spatialReference:e}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}destroy(){super.destroy();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map(t=>t.chunkId));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new M(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=z.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new z(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e);null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function q(t,e){if(t.length<2)return _({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const i=t[r][0],a=h(i,t[r-1][0],e);i!==a&&(t[r][0]=a,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return _({paths:s.paths},!1,!1)}return _({paths:[t]},!1,!1)}const s=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=C.fromSpatialReference(e);if(null!=r){const t=a(s,1e6,r,o.geodesic);if(null!=t){const e=C.toGeometry(t,r);if(null!=e&&"paths"in e)return _({paths:e.paths},!1,!1)}}return _({paths:[t]},!1,!1)}function E(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../../core/has.js";import{executeQuery as e,executeQueryForCount as t}from"../../../../../rest/query/operations/query.js";import r from"../../../../../rest/support/StatisticDefinition.js";import{FeatureSourceQueryInfo as i}from"../sources/FeatureSourceQueryInfo.js";import{FeatureMetadata as
|
|
5
|
+
import has from"../../../../../core/has.js";import{executeQuery as e,executeQueryForCount as t}from"../../../../../rest/query/operations/query.js";import r from"../../../../../rest/support/StatisticDefinition.js";import{FeatureSourceQueryInfo as i}from"../sources/FeatureSourceQueryInfo.js";import{FeatureMetadata as s}from"../support/FeatureMetadata.js";async function n(e,t,r){return{type:"feature",service:e,strategy:await a(e,r,t)}}async function a(e,t,r){const i=t.customParameters??{};t.apiKey&&(i.apiKey=t.apiKey);const s=t.displayFilterEnabled?t.displayFilterInfo?.toJSON():null,n=t.historicMoment?.getTime(),a=t.timeExtent?.toJSON(),o={...t,displayFilterInfo:s,customParameters:i,historicMoment:n,timeExtent:a};if("feature-service"===e.type&&null!=r&&!await y(e,o,r))return{type:"snapshot",snapshotInfo:r,partial:{availableFields:t.availableFields},full:{displayFilterInfo:null,queryScaleRanges:null,sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,customParameters:t.customParameters,gdbVersion:t.gdbVersion,historicMoment:n,timeExtent:a}};return"feature-service"===e.type&&e.isSourceHosted||"memory"===e.type||"ogc"===e.type?{type:"paged-tile",partial:{availableFields:t.availableFields},full:{sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,customParameters:t.customParameters,gdbVersion:t.gdbVersion,historicMoment:n,queryScaleRanges:t.queryScaleRanges,timeExtent:a,displayFilterInfo:s}}:{type:"drill-down",partial:{availableFields:t.availableFields},full:{sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,customParameters:t.customParameters,gdbVersion:t.gdbVersion,historicMoment:n,queryScaleRanges:t.queryScaleRanges,timeExtent:a,displayFilterInfo:s}}}function o(e,t,r,i,s,n){const a=m(i);if(!(!!has("featurelayer-snapshot-enabled")&&r?.query.supportsPagination&&!r?.operations.supportsEditing&&!t))return null;const o=c(s,n),{min:y,max:p}=a,d=o?p:y,f=l(i);let h=has("featurelayer-snapshot-initial-tolerance");return"esriGeometryPoint"!==i&&"esriGeometryMultipoint"!==i||(h=null),{supportsExceedsLimit:u(e,r),initialTolerance:h,maxFeatureCount:d,maxVertexCount:f}}function u(e,t){return!(!e&&!has("featurelayer-snapshot-non-hosted-exceedslimit-enabled"))&&t?.operations.supportsExceedsLimitStatistics}function l(e){switch(e){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":case"esriGeometryMultiPatch":case"esriGeometryMultipoint":return has("featurelayer-snapshot-max-vertex-count")}}function c(e,t){const r=t?.clone().intersection(e),i=null!=r?r.width*r.height:0,s=t?t.width*t.height:0,n=0===s?0:i/s,a=has("featurelayer-snapshot-coverage");return!isNaN(n)&&n>=a}function m(e){switch(e){case"esriGeometryMultipoint":return{min:has("featurelayer-snapshot-multipoint-min-threshold"),max:has("featurelayer-snapshot-multipoint-max-threshold")};case"esriGeometryPoint":return{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")};case"esriGeometryMultiPatch":case"esriGeometryPolygon":return{min:has("featurelayer-snapshot-polygon-min-threshold"),max:has("featurelayer-snapshot-polygon-max-threshold")};case"esriGeometryPolyline":return{min:has("featurelayer-snapshot-polyline-min-threshold"),max:has("featurelayer-snapshot-polyline-max-threshold")}}}async function y(t,n,a){const o=s.createFeature(t.metadata),u=i.create(t,n,o);if(!a.supportsExceedsLimit)return p(t,u,a);try{const i=t.source,s=u.createQuery();s.inner.orderByFields=[],s.inner.returnGeometry=!1;const n=new r;n.statisticType="exceedslimit",n.maxPointCount=a.maxFeatureCount,n.maxRecordCount=a.maxFeatureCount,n.outStatisticFieldName="exceedslimit",a.maxVertexCount&&(n.maxVertexCount=a.maxVertexCount),s.inner.outStatistics=[n],s.inner.cacheHint=!0;const o=await e(i,s.inner,void 0,{query:s.customParameters}),l=o.data.features[0]?.attributes.exceedslimit;return!(0===l)}catch(l){return!0}}async function p(e,r,i){if("esriGeometryPoint"!==e.metadata.geometryType)return!0;const s=e.source,n=r.createQuery();n.inner.orderByFields=[],n.inner.returnGeometry=!1,n.inner.cacheHint=!0;try{return(await t(s,n.inner,{query:n.customParameters})).data.count>i.maxFeatureCount}catch(a){return!0}}export{n as createFeatureSourceSchema,o as createSnapshotInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../../core/object.js";import{ignoreAbortErrors as r,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{OptimizedFeature as a}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as i}from"../../../../../layers/graphics/data/QueryEngine.js";import{FeatureStoreStatistics as n}from"../FeatureStoreStatistics.js";import{StreamMessenger as o}from"./StreamMessenger.js";import{UpdateStatus as c}from"./strategies/ALoadStrategy.js";import{FeatureDrillDownTileLoadStrategy as d}from"./strategies/FeatureDrillDownTileLoadStrategy.js";import{FeaturePagedTileLoadStrategy as h}from"./strategies/FeaturePagedTileLoadStrategy.js";import{FeatureSnapshotLoadStrategy as u}from"./strategies/FeatureSnapshotLoadStrategy.js";import{ParquetSnapshotLoadStrategy as
|
|
5
|
+
import has from"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../../core/object.js";import{ignoreAbortErrors as r,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{OptimizedFeature as a}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as i}from"../../../../../layers/graphics/data/QueryEngine.js";import{FeatureStoreStatistics as n}from"../FeatureStoreStatistics.js";import{StreamMessenger as o}from"./StreamMessenger.js";import{UpdateStatus as c}from"./strategies/ALoadStrategy.js";import{FeatureDrillDownTileLoadStrategy as d}from"./strategies/FeatureDrillDownTileLoadStrategy.js";import{FeaturePagedTileLoadStrategy as h}from"./strategies/FeaturePagedTileLoadStrategy.js";import{FeatureSnapshotLoadStrategy as u}from"./strategies/FeatureSnapshotLoadStrategy.js";import{ParquetSnapshotLoadStrategy as m}from"./strategies/ParquetSnapshotLoadStrategy.js";import{ParquetTileLoadStrategy as p}from"./strategies/ParquetTileLoadStrategy.js";import{StreamLoadStrategy as g}from"./strategies/StreamLoadStrategy.js";import{OverrideParameters as y}from"./strategies/chunks/Overrides.js";import{FeatureSourceChunkStore as l}from"./strategies/chunks/SourceChunkStore.js";import{UpdateTracking2D as _}from"../../support/UpdateTracking2D.js";class f{constructor(e,t,r,s){this._aggregateAdapter=e,this._subscriptions=t,this._connection=r,this._cachedObjectIds=s,this._updateTracking=new _({debugName:"FeatureSource"}),this.store=new l(()=>{if(null==this._overrideParameters)throw new Error("InternalError: Override parameters must be defined");return this._overrideParameters})}destroy(){this._strategy?.destroy(),this._streamMessenger?.destroy(),this._updateTracking?.destroy(),this.store.destroy()}get metadata(){return this._strategy.metadata}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return n.from(this.store)}get updateTracking(){return this._updateTracking}get usedMemory(){return this.store.usedMemory}get queryEngine(){if(!this._queryEngine){if(!this.store||!this._strategy)return null;this._queryEngine=new i({featureStore:this.store,fieldsIndex:this.metadata.fieldsIndex,geometryType:this.metadata.geometryType,featureIdInfo:this.metadata.featureIdInfo,hasM:!1,hasZ:!1,spatialReference:this.metadata.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:this.metadata.timeInfo,definitionExpression:this._strategy?.definitionExpression,availableFields:this._strategy?.availableFields})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasQueryDisplayFilter(){if(!this._schema)return!1;switch(this._schema.type){case"feature":return null!=this._schema.strategy.full.displayFilterInfo;case"parquet":case"stream":return!1}}chunks(){return Array.from(this.store.chunks())}prepareCacheUpdate(e,t){const r=new Set,s=new Set;for(const a of e)this._cachedObjectIds.has(a)||(this._cachedObjectIds.add(a),r.add(a));for(const a of t)this._cachedObjectIds.delete(a),s.add(a);this.hasQueryDisplayFilter&&this._strategy.prepareCacheUpdate(r,s)}async applyCacheUpdate(){this.hasQueryDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this.store.cleanup()}onSubscribe(e){if(this._connection.onEvent({type:"subscribe",tile:e.tile.id}),!this._strategy)return;const t=this._strategy.load(e);t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t})),this._updateTracking.addPromise(t)}onResume(e){this._updateTracking.addPromise(r(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}applyOverride(e){this._strategy?.applyOverride(e)}takeOverrideUpdate(){return this._strategy?.takeOverrideUpdate()}async update(r,s){const a=this._schema;if(this._schema=r,this._queryEngine=e(this._queryEngine),a&&a.type!==r.type)throw new Error("InternalError: Reconfiguring source types is not supported.");const i=new c;if(!a||t(a.service,r.service)||a.strategy.type!==r.strategy.type||t(r.strategy.full,a.strategy.full)||!await this._strategy.tryUpdate(i,r.strategy.partial)){await this._updateStrategyType(this._schema.service,r,s);const e=this._schema.strategy.full.definitionExpression;return this._overrideParameters=await y.create(this._strategy.metadata,e),!0}return i.requiresInvalidation}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.strategy.full.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new o(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(a.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(a.fromJSON),remove:e.commands.remove,release:e.commands.release}},r=e.commands.updateByIdWeak,s=await this._queryOptimizedFeatures(r);if(s.length!==r.length){const e=new Set(s.map(e=>e.objectId));for(const s of r)e.has(s)||t.commands.removeWeak.push(s)}return t.commands.updateWeak.push(...s),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],r=(await this._strategy.queryByObjectId(e)).getCursor();for(;r.next();)t.push(r.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){const t=this.metadata.globalIdField;if(null==t)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const r=this.store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(r)}async _updateStrategyType(e,t,r){const a=this._createStrategy(e,t);this._connection.onEvent({type:"updateStrategyStart",about:a.about});const i=!!this._strategy;this.store.clear(),this._strategy?.destroy(),this._strategy=a,has("esri-2d-update-debug")&&console.debug(`Version[${r}] FeatureSource.updateStrategy`,{strategy:a});const n=Array.from(this._subscriptions.values());if(!n.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const o=Promise.all(n.map(e=>this._strategy.load(e).then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))));this._updateTracking.addPromise(o),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{i&&await o}catch(c){s(c)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${r}] FeatureSource.updateStrategyEnd`,{strategy:a})}_createStrategy(e,t){const r={connection:this._connection,store:this.store};switch(t.type){case"feature":return this._createFeatureLoadStrategy(e,t.strategy,r);case"parquet":return this._createParquetLoadStrategy(e,t.strategy,r);case"stream":return this._createStreamLoadStrategy(e,t.strategy,r)}}_createFeatureLoadStrategy(e,t,r){switch(t.type){case"drill-down":return new d(e,t,r);case"paged-tile":return new h(e,t,r);case"snapshot":return new u(e,t,r)}}_createParquetLoadStrategy(e,t,r){switch(t.type){case"xz":return new p(e,t,r);case"snapshot":return new m(e,t,r)}}_createStreamLoadStrategy(e,t,r){const s=new g(e,t,r);return this.streamMessenger.strategy=s,s}}export{f as FeatureSource};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{notDeepEqual as e}from"../../../../../../core/object.js";import{QueueProcessor as t}from"../../../../../../core/QueueProcessor.js";import{difference as i,union as a}from"../../../../../../core/SetUtils.js";import s from"../../../../../../geometry/Polygon.js";import r from"../../../../../../geometry/SpatialReference.js";import{toExtent as n}from"../../../../../../geometry/support/aaBoundingRect.js";import{convertFromPolygon as o}from"../../../../../../layers/graphics/featureConversionUtils.js";import
|
|
5
|
+
import{notDeepEqual as e}from"../../../../../../core/object.js";import{QueueProcessor as t}from"../../../../../../core/QueueProcessor.js";import{difference as i,union as a}from"../../../../../../core/SetUtils.js";import s from"../../../../../../geometry/Polygon.js";import r from"../../../../../../geometry/SpatialReference.js";import{toExtent as n}from"../../../../../../geometry/support/aaBoundingRect.js";import{convertFromPolygon as o}from"../../../../../../layers/graphics/featureConversionUtils.js";import{project as l}from"../../../../../../layers/graphics/data/projectionSupport.js";import d from"../../../../../../layers/support/FieldsIndex.js";import{createParquetFile as m}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as u}from"./ALoadStrategy.js";import{ParquetSourceChunk as h}from"./chunks/ParquetSourceChunk.js";import{FeatureSetReaderParquet as p}from"../../support/FeatureSetReaderParquet.js";class f extends u{constructor(e,t,i){if(super(e.metadata,t,i),this._files=[],!e.geometryInfo.displayOptimization)throw new Error("InternalError: ParquetTileLoadStrategy only supports XZ-enabled parquet files");this._index=c.create(t.partial.urls,this.metadata,e,new Set(t.partial.availableFields),this.store,()=>t.full.customParameters)}destroy(){super.destroy();for(const e of this._files)e.free()}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(t,i){return e(this.availableFields,i.availableFields)&&await this._updateFields(i.availableFields),this._schema.partial=i,!1}async load(e){const t=await this._index;await t.ensureLoaded(e)}unload(e){this._index.then(t=>t.unload(e.tile))}_onOverride(){}async _updateFields(e){return(await this._index).updateFields(e)}}class c{static async create(e,t,i,a,s,r){const n=await Promise.all(e.map(e=>m(e,{geometryInfo:i.geometryInfo,outSpatialReference:i.outSpatialReference,getCustomParameters:r})));if(1!==n.length)throw new Error("InternalError: experimental parquet XZ display optimization only supports a single file.");const[o]=n,l=o.fields().map(e=>({name:e.name,alias:e.name,type:e.type,column:o.columnForFieldName(e.name)})),{timeZoneByFieldName:u}=i.metadata.fieldsIndex,h=d.fromJSON({fields:l,timeZoneByFieldName:u}),p=new Uint32Array(Array.from(a.values()).map(e=>h.get(e)?.column).filter(e=>null!=e)),f=i.geometryInfo.displayOptimization;if(!f)throw new Error("InternalError: tiled parquet load requires display optimization");return new c(t,await Promise.all(n),h,p,s,a,f)}constructor(e,i,a,s,r,n,o){this._metadata=e,this._files=i,this._fieldsIndex=a,this._fieldIndices=s,this._store=r,this._availableFields=n,this._displayOptimization=o,this.fileIndex=0,this._queue=new t({concurrency:1,process:e=>this._ensureLoaded(e)}),this._tileIdToChunkId=new Map}get file(){return this._files[0]}async ensureLoaded(e){return this._queue.push(e)}unload(e){const t=this._tileIdToChunkId.get(e.id);if(null!=t){for(const e of t)this._store.removeById(e);this._tileIdToChunkId.delete(e.id)}}async _ensureLoaded(e){const t=this._metadata.outSpatialReference,i=e.tile,{xmin:a,ymin:s,xmax:r,ymax:n}=_(i.extent,t);let o=0;const l={extent:i.extent,extent_lat_lng:{xmin:a,ymin:s,xmax:r,ymax:n},tile_level:i.level,attributes:this._fieldIndices};if("z"===this._displayOptimization.mode?await this.file.queryZChunks(l.extent_lat_lng,this._fieldIndices,e.signal,t=>{if(e.signal.aborted)return;const a=new p(this._metadata,this._fieldsIndex,t,o,this.fileIndex),s=new h(this._metadata,a,i,o++,!1);this._insertChunk(i,s)}):await this.file.queryXZChunks(l,e.signal,t=>{if(e.signal.aborted)return;const a=new p(this._metadata,this._fieldsIndex,t,o,this.fileIndex),s=new h(this._metadata,a,i,o++,!1);this._insertChunk(i,s)}),e.signal.aborted)return;const d=new h(this._metadata,null,i,o++,!0);this._insertChunk(i,d)}_insertChunk(e,t){let i=this._tileIdToChunkId.get(e.id);null==i&&(i=[],this._tileIdToChunkId.set(e.id,i)),i.push(t.chunkId),this._store.insert(t)}async updateFields(e){const t=new Set(e),s=i(t,this._availableFields);if(this._availableFields=a(s,this._availableFields),s.size)for(const i of this._files){const e=Array.from(s).map(e=>this._fieldsIndex.get(e)?.column);await i.ensureFields(new Uint32Array(e))}}}function _(e,t){const i=[e.xmin,e.ymin,e.xmax,e.ymax],a=s.fromExtent(n(i,t)),d=l(a,t,r.WGS84);if(!d)return null;const m=o(d,!1,!1),u=m.coords.filter((e,t)=>!(t%2)),h=m.coords.filter((e,t)=>t%2);return{xmin:Math.min(...u),ymin:Math.min(...h),xmax:Math.max(...u),ymax:Math.max(...h)}}export{f as ParquetTileLoadStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{parseWhereClause as e}from"../../../../../../../core/sql.js";import{ASourceChunk as t}from"./ASourceChunk.js";import{FeatureSetReaderJSON as s}from"../../../support/FeatureSetReaderJSON.js";const r=1e4,i=1e3;class n{static async create(t,s){const r=s?await e(s,t.fieldsIndex):null;return new n(t,r,s)}constructor(e,t,s){this.metadata=e,this._clause=t,this._definitionExpression=s}get hash(){return this._definitionExpression}testFeature(e){return null==this._clause||this._clause.testFeature(e)}}class a{constructor(){this.modified=[],this.removed=[]}modify(e){this.modified.push(e)}remove(e){this.removed.push(e)}get isEmpty(){return 0===this.modified.length&&0===this.removed.length}applyWhereClause(e){const t=new a;for(const s of this.modified)e.testFeature(s)?t.modified.push(s):t.removed.push(s.objectId);return t}}class o extends t{constructor(e){super(),this._reader=e,this.chunkId="override",this.normalizedChunkId="override"}static fromFeatures(e,t){const r=s.fromOptimizedFeatures(e,t);return new o(r)}get reader(){return this._reader}get queryInfo(){return{}}get first(){return!1}get end(){return!1}get isTiled(){return!1}getTileReader(e){if(!this._reader.getSize())return null;const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class d{constructor(e,t){this.inner=e,this.isWeak=t,this.lastWeak=null}get isStrong(){return!this.isWeak}}class h{constructor(e){this._getOverrideParameters=e,this._overrides=new Map,this._update=new a,this._lastCleanup=0}hasOverride(e){return this._overrides.has(e)}onChunkInsert(e){if(this._overrides.size){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId(),s=this._overrides.get(e);if(s?.lastWeak&&(s.lastWeak=null),s?.isWeak){const e=t.readOptimizedFeatureWorldSpace();s.inner=e,this._update.modify(e),this.invalidate()}}}e.registerOverrides(this)}apply(e,t){const{updateWeak:s,removeWeak:r,update:i,remove:n,release:a}=e.commands;this.invalidate();for(const o of s){const e=new d(o,!0),t=this._overrides.get(o.objectId);t?.isStrong?t.lastWeak=e:(this._overrides.set(o.objectId,e),this._update.modify(o))}for(const o of i){const e=new d(o,!1),t=this._overrides.get(o.objectId);e.lastWeak=t?.isWeak?t:t?.lastWeak??null,this._overrides.set(o.objectId,e),this._update.modify(o)}for(const o of r){const e=new d(null,!0),t=this._overrides.get(o);t?.isStrong?t.lastWeak=e:(this._overrides.set(o,e),this._update.remove(o))}for(const o of n){const e=new d(null,!1),t=this._overrides.get(o);e.lastWeak=t?.isWeak?t:t?.lastWeak??null,this._overrides.set(o,e),this._update.remove(o)}if(a.length){const e=new Set;for(const t of a){const s=this._overrides.get(t);s?.lastWeak?(this._overrides.set(t,s.lastWeak),null==s.lastWeak.inner?this._update.remove(t):this._update.modify(s.lastWeak.inner)):s&&!s.isWeak&&(this._overrides.delete(t),e.add(t))}t.forEachUnsafe(t=>{const s=t.getObjectId();e.has(s)&&(this._update.modify(t.readOptimizedFeatureWorldSpace()),e.delete(s))});for(const t of e.values())this._update.remove(t)}}clearWeakOverrides(){for(const[e,t]of this._overrides.entries())t.isWeak&&this._overrides.delete(e);this.invalidate()}cleanup(e){if(this._overrides.size<r)return;const t=performance.now();if(t-this._lastCleanup<i)return;this._lastCleanup=t;const s=this._getWeakDeletions();if(!(s.size<r)){for(const t of e){const e=t.reader.withoutOverrides().getCursor();for(;e.next();){const t=e.getObjectId();s.delete(t)}}for(const e of s)this._overrides.delete(e);s.size&&this.invalidate()}}takeOverrideUpdate(){const e=this._update;return e.isEmpty?null:(this._update=new a,e.applyWhereClause(this._getOverrideParameters()))}asChunk(){const e=this._getOverrideParameters();if(this._lastOverrideParametersHash!==e.hash&&(this._lastOverrideParametersHash=e.hash,this._chunk=null),!this._chunk){const t=[];for(const s of this._overrides.values())null!=s.inner&&e.testFeature(s.inner)&&t.push(s.inner);this._chunk=o.fromFeatures(t,e.metadata)}return this._chunk}invalidate(){this._chunk=null}putWeakObjectIdsFromGlobalIds(e,t,s){for(const[r,i]of this._overrides.entries()){if(i.isWeak&&null!=i.inner){const n=i.inner.attributes[s];n&&t.has(n)&&!e.has(n)&&e.set(n,r);continue}if(null!=i.lastWeak&&null!=i.lastWeak.inner){const n=i.lastWeak.inner.attributes[s];n&&t.has(n)&&!e.has(n)&&e.set(n,r)}}}_getWeakDeletions(){const e=new Set;for(const[t,s]of this._overrides.entries())s.isWeak&&null==s.inner&&e.add(t);return e}}export{o as OverrideChunk,n as OverrideParameters,h as OverrideState,a as OverrideUpdate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{EventEmitter as e}from"../../../../../../../core/Evented.js";import has from"../../../../../../../core/has.js";import{create as s}from"../../../../../../../geometry/support/aaBoundingBox.js";import{FeatureStoreQueryAdapter as t}from"../../../FeatureStoreQueryAdapter.js";import{OverrideState as r}from"./Overrides.js";class o{constructor(s){this.
|
|
5
|
+
import{EventEmitter as e}from"../../../../../../../core/Evented.js";import has from"../../../../../../../core/has.js";import{create as s}from"../../../../../../../geometry/support/aaBoundingBox.js";import{FeatureStoreQueryAdapter as t}from"../../../FeatureStoreQueryAdapter.js";import{OverrideState as r}from"./Overrides.js";class o{constructor(s){this._chunks=new Map,this._chunksToRemove=[],this.events=new e,this.featureAdapter=new t,null!=s&&(this._overrides=new r(s))}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._overrides?.clearWeakOverrides()}get usedMemory(){let e=0;for(const s of this._chunks.values())e+=s.usedMemory;return e}*chunks(){this._overrides&&(yield this._overrides.asChunk()),yield*this._chunks.values()}insert(e){has("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._overrides?.onChunkInsert(e),this._chunks.set(e.chunkId,e),this.events.emit("changed")}remove(e){has("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}removeById(e){has("esri-2d-update-debug")&&console.debug(`Chunk[${e}] SourceChunkStore.remove`);const s=this._chunks.get(e);this._chunks.delete(e),s&&this._chunksToRemove.push(s)}cleanup(){const e=this._chunksToRemove;return this._chunksToRemove=[],this._overrides?.cleanup(this._chunks.values()),e}applyOverride(e){if(null==this._overrides)throw new Error("InternalError: Overrides not supported");this._overrides.apply(e,this),this.events.emit("changed");for(const s of this._chunks.values())s.invalidate()}takeOverrideUpdate(){return this._overrides?.takeOverrideUpdate()}refresh(){this.events.emit("refresh")}forEach(e){const s=new Set;for(const t of this.chunks()){const r=t.reader.getCursor();for(;r.next();){const t=r.getObjectId();s.has(t)||(e(r.copy()),s.add(t))}}}forEachUnsafe(e){const s=new Set;for(const t of this.chunks()){const r=t.reader.getCursor();for(;r.next();){const t=r.getObjectId();s.has(t)||(e(r),s.add(t))}}}mapObjectIdsFromGlobalIds(e,s){const t=new Map,r=new Set(e);return this._overrides?.putWeakObjectIdsFromGlobalIds(t,r,s),this._forEachUnsafeIgnoreOverrides(e=>{const o=e.readAttribute(s);if(o&&r.has(o)&&!t.has(o)){const s=e.getObjectId();t.set(o,s)}}),t}forEachInBounds(e,s){const t=new Set;for(const r of this.chunks()){const o=r.queryFeaturesInBounds(e);for(;o.next();){const e=o.getObjectId();t.has(e)||(s(o.copy()),t.add(e))}}}forEachBounds(e,t){const r=s();for(const s of e){s.getBounds(r)&&t(r)}}_forEachUnsafeIgnoreOverrides(e){const s=new Set;for(const t of this._chunks.values()){const r=t.reader.withoutOverrides().getCursor();for(;r.next();){const t=r.getObjectId();s.has(t)||(e(r),s.add(t))}}}}export{o as FeatureSourceChunkStore};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/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{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as s}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as r,maxHighlightReasons as a}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as n}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as o}from"../../../engine/webgl/Utils.js";import{nanMagicNumber as l}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as h,DEBUG_ATTR_UPDATES as d}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as c}from"./DisplayIdGenerator.js";import u from"./FeatureFilterEvaluator.js";import{PixelType as p}from"../../../../webgl/enums.js";function g(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}const
|
|
5
|
+
import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as s}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as r,maxHighlightReasons as a}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as n}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as o}from"../../../engine/webgl/Utils.js";import{nanMagicNumber as l}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as h,DEBUG_ATTR_UPDATES as d}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as c}from"./DisplayIdGenerator.js";import u from"./FeatureFilterEvaluator.js";import{PixelType as p}from"../../../../webgl/enums.js";function g(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}const f=()=>e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),_=h(d,f()),y={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};class m{constructor(t,e,i){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:r,textureOnly:a}=e;this.textureOnly=a||!1,this.pixelType=s,this.layout=r,this._resetRange(),this.size=t,this.isLocal=i,a||(this.data=this._initData(s,t))}get usedMemory(){return this.data?.byteLength??0}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=n(t);return this.data[i*this.texelSize+e]}setData(t,e,i){const s=n(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)):f().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t),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.isLocal,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){const i=ArrayBuffer,s=o(t),r=new s(new i(e*e*4*s.BYTES_PER_ELEMENT));for(let a=0;a<r.length;a+=4)r[a+1]=255;return r}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class b{constructor(t){this._client=t,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=r,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new c,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const t=p.FLOAT;_(`Creating AttributeStore ${y.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:p.UNSIGNED_BYTE,layout:1},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:p.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}get usedMemory(){let t=0;for(const e of this._blocks)e&&(t+=e.usedMemory);return t+=this._idGenerator.usedMemory,t}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(t){return this._idGenerator.createIdForObjectId(t)}releaseDisplayIdForObjectId(t){return this._idGenerator.releaseIdForObjectId(t)}getDisplayIdForObjectId(t){return this._idGenerator.getDisplayIdForObjectId(t)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}releaseAllIds(){this._idGenerator.releaseAll()}async update(t,e,s,r=0){const a=i(this._schema,t);if(this.version=r,a&&(has("esri-2d-update-debug")&&console.debug(`Version[${r}] AttributeStore.update`,{changed:a}),this._schema=t,this._attributeComputeInfo=null,this._initialize(),null!=t))if(s&&(this._filters=await Promise.all(t.filters.map(t=>t?u.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:t}):null))),"multi"!==t.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(t.bindings.map(async t=>{const i=await this._bind(e,t);this._updateReferences(i)}));else{this._attributeComputeInfo={type:"multi",keyField:t.keyField,map:new Map};for(const i in t.bindings){const s=t.bindings[i];await Promise.all(s.map(async t=>{const s=await this._bind(e,t,parseInt(i,10));this._updateReferences(s)}))}}}setHighlight(t,e){let i=null;0===t.length&&0===e.length&&(i=this._getBlock(0),i.unsetComponentAllTexels(0,(1<<a)-1));for(const{displayId:s,highlightFlags:r}of t){if(null==s||-1===s)continue;i||(i=this._getBlock(0),i.unsetComponentAllTexels(0,(1<<a)-1));const t=n(s);i.setComponent(0,r,[t])}this._idsToHighlight.clear();for(const{objectId:s,highlightFlags:r}of t)this._idsToHighlight.set(s,r);for(const{objectId:s,highlightFlags:r}of e)this._idsToHighlight.set(s,r)}setData(t,e,i,s){const r=n(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlags(t){return this._idsToHighlight.get(t)||0}unsetAttributeData(t){const e=n(t);this._getBlock(0).setData(e,0,0)}referencesScale(){const t=this._attributeComputeInfo;if(!t)return!1;if("multi"===t.type){for(const e of t.map.values())for(const{field:t}of e.values())if(t?.hasArcadeDependency("scale"))return!0}else for(const{field:e}of t.map.values())if(e?.hasArcadeDependency("scale"))return!0;return!1}setAttributeData(t,e,i,s){const r=n(t);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(e,s));const a=this._attributeComputeInfo,o=1,h=4;let d=null;a&&(d="multi"===a.type?a.map.get(e.readAttribute(a.keyField)):a.map,d?.size&&d.forEach((t,s)=>{const a=s*o%h,n=Math.floor(s*o/h),d=this._getBlock(n+3);let c=t.field?.read(e,i);t.valueRepresentation&&(c=g(c,t.valueRepresentation));(null===c||isNaN(c)||c===1/0||c===-1/0)&&(c=l),d.setData(r,a,c)}))}get epoch(){return this._epoch}sendUpdates(){const t=this._blocks.map(t=>null!=t?t.toMessage():null),e=this._getInitArgs();has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:e,blockData:t,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}async _bind(t,e,i){const s=await t.createComputedField(e),{valueRepresentation:r}=e,a=this._attributeComputeInfo;if("multi"===a.type){const t=a.map.get(i)??new Map;t.set(e.binding,{field:s,valueRepresentation:r}),a.map.set(i,t)}else a.map.set(e.binding,{field:s,valueRepresentation:r});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(1),this._getBlock(2),this._getBlock(7),{blockSize:this._size,blockDescriptors:this._blocks.map(t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null)})}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;_(`Initializing AttributeBlock at index ${t}`);const i=new m(this._size,this._blockDescriptors[t],this._client.isLocal);return this._blocks[t]=i,this._initialized=!1,i}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const t=this._size<<=1;_("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._initialized=!1,this._size=t,0}return f().error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(t){s(this._arcadeDependencies,t)}isVisible(t){return!!(this._getBlock(0).getData(t,0)&1<<a)}getFilterFlags(t,e){let i=0;for(let r=0;r<this._filters.length;r++){const s=!!(1<<r),a=this._filters[r];i|=(!s||null==a||a.check(t,e)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlags(e)}return i<<a|s}}export{b as AttributeStore,g as getVisualVariableSizeValueRepresentationRatio};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../../core/Error.js";import e from"../../../../../core/Logger.js";import{create as i}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as
|
|
5
|
+
import t from"../../../../../core/Error.js";import e from"../../../../../core/Logger.js";import{create as i}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as r}from"../../../../../geometry/support/boundsUtils.js";import{normalizeQueryLike as s}from"../../../../../layers/graphics/data/queryUtils.js";import{getSpatialQueryOperator as o}from"../../../../../layers/graphics/data/spatialQuerySupport.js";import{getTimeOperator as a}from"../../../../../layers/graphics/data/timeSupport.js";import l from"../../../../../rest/support/Query.js";import{FeatureStoreQueryAdapter as h}from"../FeatureStoreQueryAdapter.js";import{createWhereClause as n}from"./whereUtils.js";const m=1,d=2;class p{constructor(t){this._geometryBounds=i(),this._idToVisibility=new Map,this._serviceInfo=t}static async create(t){const e=new p(t);return await e.update(t.filterJSON,t.spatialReference),e}get hash(){return this._hash}check(t,e){return this._applyFilter(t,e)}invalidate(){this._idToVisibility.forEach((t,e)=>{this._idToVisibility.set(e,0)})}setKnownIds(t){for(const e of t)this._idToVisibility.set(e,m)}setTrue(t){const e=[],i=[],r=new Set(t);return this._idToVisibility.forEach((t,s)=>{const o=!!(this._idToVisibility.get(s)&m),a=r.has(s);!o&&a?e.push(s):o&&!a&&i.push(s),this._idToVisibility.set(s,a?m|d:0)}),{show:e,hide:i}}createQuery(){const{geometry:t,spatialRel:e,where:i,timeExtent:r,objectIds:s}=this;return l.fromJSON({geometry:t,spatialRel:e,where:i,timeExtent:r,objectIds:s})}async update(t,e){this._hash=JSON.stringify(t);const i=await s(t,null,e);await Promise.all([this._setGeometryFilter(i),this._setIdFilter(i),this._setAttributeFilter(i),this._setTimeFilter(i)])}async _setAttributeFilter(t){if(!t?.where)return this._clause=null,void(this.where=null);this._clause=await n(t.where,this._serviceInfo.fieldsIndex),this.where=t.where}_setIdFilter(t){this._idsToShow=t?.objectIds&&new Set(t.objectIds),this._idsToHide=t?.hiddenIds&&new Set(t.hiddenIds),this.objectIds=t?.objectIds}async _setGeometryFilter(t){if(!t?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const e=t.geometry,i=t.spatialRel??"esriSpatialRelIntersects",s=await o(i,e,this._serviceInfo.geometryType);r(this._geometryBounds,e),this._spatialQueryOperator=s,this.geometry=e,this.spatialRel=i}_setTimeFilter(i){if(this.timeExtent=this._timeOperator=null,i?.timeExtent){if(!this._serviceInfo.timeInfo){const r=new t("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",i.timeExtent);return void e.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(r)}this.timeExtent=i.timeExtent,this._timeOperator=a(this._serviceInfo.timeInfo,i.timeExtent,h.Shared)}}_applyFilter(t,e){return this._filterByGeometry(t)&&this._filterById(t)&&this._filterByTime(t)&&this._filterByExpression(t,e)}_filterByExpression(t,e){return!this.where||this._clause(t,e)}_filterById(t){return(!this._idsToHide?.size||!this._idsToHide.has(t.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(t.getObjectId()))}_filterByGeometry(t){if(!this.geometry)return!0;const e=t.readGeometryWorldSpace();return!!e&&this._spatialQueryOperator(e)}_filterByTime(t){return null==this._timeOperator||this._timeOperator(t)}}export{p as default};
|