@arcgis/core 5.0.0-next.3 → 5.0.0-next.5
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/0366b78b0ccf4ed5f6ac.js +1 -0
- package/assets/esri/core/workers/chunks/037b2548bf85e2d7c6ac.js +1 -0
- package/assets/esri/core/workers/chunks/{c0feec6e2f0e45900ae0.js → 0686243904381ef863dc.js} +1 -1
- package/assets/esri/core/workers/chunks/06ba43843e9c4988049b.js +1 -0
- package/assets/esri/core/workers/chunks/0f100e163e1847e04155.js +1 -0
- package/assets/esri/core/workers/chunks/{388482cea4b9fdeaf06e.js → 0f30a9514571c7be9978.js} +1 -1
- package/assets/esri/core/workers/chunks/0f8847f9ae3068833fa4.js +1 -0
- package/assets/esri/core/workers/chunks/{14ace5dc4b8984212a57.js → 17d5f8dba6ebb1184506.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2add7338258ca7c24dd.js → 1da74aa308ded5748ef5.js} +1 -1
- package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
- package/assets/esri/core/workers/chunks/1eedac33c9fcd7681427.js +1 -0
- package/assets/esri/core/workers/chunks/239377336a2009caea01.js +1 -0
- package/assets/esri/core/workers/chunks/285762ff92d5388b6024.js +1 -0
- package/assets/esri/core/workers/chunks/{40b81d1c2d53cf598b8e.js → 2f03d33f4ca8a48461fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{4f01be74dd26e639330f.js → 2f24017e72d41c259faa.js} +1 -1
- package/assets/esri/core/workers/chunks/3271614322ba4b44fb5a.js +1 -0
- 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/4442817beb7a76c95770.js +1 -0
- package/assets/esri/core/workers/chunks/4c5a7249a311070d8f43.js +1 -0
- package/assets/esri/core/workers/chunks/551c6c89b51b99f4864b.js +1 -0
- package/assets/esri/core/workers/chunks/{9a723d739ac44b45432c.js → 557960763695abee4a83.js} +1 -1
- package/assets/esri/core/workers/chunks/655360995c1cbc78a5a3.js +1 -0
- package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/6a69dafeb7c9ca8a3d84.js +1 -0
- 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/71762199aef5d3107da2.js +1 -0
- package/assets/esri/core/workers/chunks/72c851c400752094b162.js +1 -0
- package/assets/esri/core/workers/chunks/7558919912f7fdc4837b.js +1 -0
- package/assets/esri/core/workers/chunks/7596d005a4dc3964b140.js +1 -0
- package/assets/esri/core/workers/chunks/762fe93015b705546188.js +1 -0
- 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/{2a5f331c0f18d8574b4e.js → 811d4c46c75cf6a63e78.js} +1 -1
- package/assets/esri/core/workers/chunks/829bc5dbda2f51561446.js +1 -0
- package/assets/esri/core/workers/chunks/8372f142c4d7a65c7954.js +1 -0
- package/assets/esri/core/workers/chunks/8605ec4678eb4511c715.js +1 -0
- package/assets/esri/core/workers/chunks/883ffaa69b3e6eb158bf.js +1 -0
- package/assets/esri/core/workers/chunks/{3d22fe2f2c40abbc246e.js → 88d942cd25bef74fd50a.js} +1 -1
- package/assets/esri/core/workers/chunks/{0086a09441627842d34a.js → 8f3503b2fb6cd38757b9.js} +1 -1
- package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +1 -0
- package/assets/esri/core/workers/chunks/98311fec6c16a1b23586.js +1 -0
- package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +1 -0
- package/assets/esri/core/workers/chunks/a091623bbfb3d771c8d8.js +1 -0
- package/assets/esri/core/workers/chunks/a137c27ce078bea44f89.js +1 -0
- package/assets/esri/core/workers/chunks/a29d7205394cb8b2a847.js +1 -0
- package/assets/esri/core/workers/chunks/a2a284d4dd5caaecbc2e.js +1 -0
- package/assets/esri/core/workers/chunks/{135e270b4f03c4270870.js → a4db5c9a90107e097df8.js} +1 -1
- package/assets/esri/core/workers/chunks/a61cb4f1ca282bf8b75d.js +1 -0
- package/assets/esri/core/workers/chunks/a6ac1ff89c40f3a4797a.js +1 -0
- package/assets/esri/core/workers/chunks/{dc31865edea480f0ebba.js → a8c4fd779e454e4075c4.js} +1 -1
- package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/aa6eb55e4fb57c4e8eeb.js +1 -0
- package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/af3fc2562bb6d217adf6.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/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/c0b7e86860838638537f.js +1 -0
- package/assets/esri/core/workers/chunks/c134ebbaeac514cbd657.js +1 -0
- package/assets/esri/core/workers/chunks/c2b47a7dc961863d283f.js +1 -0
- 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/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/d048e4926e78458afa3e.js +1 -0
- package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
- package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/d886fb97bdb348a16f25.js +1 -0
- package/assets/esri/core/workers/chunks/{00aa85ae6419aad183ea.js → dc4982b0ac007bd70213.js} +1 -1
- package/assets/esri/core/workers/chunks/e1258b6a404e58878c7a.js +1 -0
- package/assets/esri/core/workers/chunks/e31192ae920e3e19b6aa.js +1 -0
- package/assets/esri/core/workers/chunks/e6a86cad44056735ed26.js +1 -0
- package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.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/f5b7e7f2860a825ed373.js +1 -0
- package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{18da83afbc324fef9fd8.js → f779034623980bf9a37c.js} +2 -2
- 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/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/QueueProcessor.js +1 -1
- package/core/has.js +1 -1
- package/core/sanitizerUtils.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/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 +426 -347
- 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/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/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/elevationInfoUtils.js +1 -1
- package/support/requestImageUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/GoToManager.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.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/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/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/featureTileQuery3D.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/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/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/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/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/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/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Texture.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/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/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/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/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/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/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/c362fbbafec91c44eeb2.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{create as e,fromValues as t}from"../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fadeDuration as i}from"../../vectorTiles/decluttering/config.js";import{vtlTextureBindingUnitSprites as a,vtlTextureBindingUnitGlyphs as r}from"../definitions.js";import{degToByte as n}from"../GeometryUtils.js";import s from"./WGLBrush.js";import{PrimitiveType as o,DataType as l}from"../../../../webgl/enums.js";const f=1/65536;class c extends s{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=e()}dispose(){}drawMany(e,t){const i=e.styleLayer;this._drawIcons(e,i,t),this._drawText(e,i,t)}_drawIcons(e,t,r){const{context:s,displayLevel:o,painter:l,spriteMosaic:f,state:c,styleLayerUID:u,requestRender:p,allowDelayedRender:m}=e,g=t.iconMaterial,d=l.vectorTilesMaterialManager;let y,_=!1;for(const i of r)if(i.layerData.has(u)&&(y=i.layerData.get(u),y.iconPerPageElementsMap.size>0)){_=!0;break}if(!_)return;const h=t.getPaintValue("icon-translate",o),M=t.getPaintValue("icon-translate-anchor",o);let U=t.getLayoutValue("icon-rotation-alignment",o);2===U&&(U=0===t.getLayoutValue("symbol-placement",o)?1:0);const x=0===U,P=t.getLayoutValue("icon-keep-upright",o)&&x,S=y.isIconSDF,E=this._iconProgramOptions;E.sdf=S;const v=d.getMaterialProgram(s,g,E);if(m&&null!=p&&!v.compiled)return void p();s.useProgram(v),v.setUniformMatrix3fv("u_displayViewMat3",0===U?c.displayViewMat3:c.displayMat3),v.setUniformMatrix3fv("u_displayMat3",1===M?c.displayMat3:c.displayViewMat3),v.setUniform2fv("u_iconTranslation",h),v.setUniform1f("u_depth",t.z),v.setUniform1f("u_mapRotation",n(c.rotation)),v.setUniform1f("u_keepUpright",P?1:0),v.setUniform1f("u_level",10*o),v.setUniform1i("u_texture",a),v.setUniform1f("u_fadeDuration",i/1e3);let D=-1;for(const i of r){if(!i.layerData.has(u))continue;if(i.key.level!==D&&(D=i.key.level,g.setDataUniforms(v,o,t,D,f)),y=i.layerData.get(u),0===y.iconPerPageElementsMap.size)continue;y.prepareForRendering(s),y.updateOpacityInfo();const a=y.iconVAO;if(null!=a){s.bindVAO(a),v.setUniformMatrix3fv("u_dvsMat3",i.transforms.displayViewScreenMat3),v.setUniform1f("u_time",(performance.now()-y.lastOpacityUpdate)/1e3);for(const[t,a]of y.iconPerPageElementsMap)this._renderIconRange(e,v,a,t,i)}}}_renderIconRange(e,t,i,r,n){const{context:s,spriteMosaic:f}=e;this._spritesTextureSize[0]=f.getWidth(r)/4,this._spritesTextureSize[1]=f.getHeight(r)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),f.bind(s,9729,r,a),this._setStencilState(e,n),s.drawElements(o.TRIANGLES,i[1],l.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),n.triangleCount+=i[1]/3}_drawText(e,a,s){const{context:o,displayLevel:l,glyphMosaic:c,painter:u,pixelRatio:p,spriteMosaic:m,state:g,styleLayerUID:d,requestRender:y,allowDelayedRender:_}=e,h=a.textMaterial,M=u.vectorTilesMaterialManager;let U,x=!1;for(const t of s)if(t.layerData.has(d)&&(U=t.layerData.get(d),U.glyphPerPageElementsMap.size>0)){x=!0;break}if(!x)return;const P=a.getPaintProperty("text-opacity");if(P&&!P.isDataDriven&&0===P.getValue(l))return;const S=a.getPaintProperty("text-color"),E=!S||S.isDataDriven||S.getValue(l)[3]>0,v=a.getPaintProperty("text-halo-width"),D=a.getPaintProperty("text-halo-color"),T=(!v||v.isDataDriven||v.getValue(l)>0)&&(!D||D.isDataDriven||D.getValue(l)[3]>0);if(!E&&!T)return;const V=24/8;let w=a.getLayoutValue("text-rotation-alignment",l);2===w&&(w=0===a.getLayoutValue("symbol-placement",l)?1:0);const R=0===w,I=a.getLayoutValue("text-keep-upright",l)&&R,L=.8*V/p;this._glyphTextureSize||(this._glyphTextureSize=t(c.width/4,c.height/4));const z=a.getPaintValue("text-translate",l),N=a.getPaintValue("text-translate-anchor",l),b=this._sdfProgramOptions,k=M.getMaterialProgram(o,h,b);if(_&&null!=y&&!k.compiled)return void y();o.useProgram(k),k.setUniformMatrix3fv("u_displayViewMat3",0===w?g.displayViewMat3:g.displayMat3),k.setUniformMatrix3fv("u_displayMat3",1===N?g.displayMat3:g.displayViewMat3),k.setUniform2fv("u_textTranslation",z),k.setUniform1f("u_depth",a.z+f),k.setUniform2fv("u_mosaicSize",this._glyphTextureSize),k.setUniform1f("u_mapRotation",n(g.rotation)),k.setUniform1f("u_keepUpright",I?1:0),k.setUniform1f("u_level",10*l),k.setUniform1i("u_texture",r),k.setUniform1f("u_antialiasingWidth",L),k.setUniform1f("u_fadeDuration",i/1e3);let O=-1;for(const t of s){if(!t.layerData.has(d))continue;if(t.key.level!==O&&(O=t.key.level,h.setDataUniforms(k,l,a,O,m)),U=t.layerData.get(d),0===U.glyphPerPageElementsMap.size)continue;U.prepareForRendering(o),U.updateOpacityInfo();const i=U.textVAO;if(null==i)continue;o.bindVAO(i),k.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3),this._setStencilState(e,t);const r=(performance.now()-U.lastOpacityUpdate)/1e3;k.setUniform1f("u_time",r),U.glyphPerPageElementsMap.forEach((e,i)=>{this._renderGlyphRange(o,e,i,c,k,T,E,t)})}}_renderGlyphRange(e,t,i,a,n,s,f,c){a.bind(e,9729,i,r),s&&(n.setUniform1f("u_halo",1),e.drawElements(o.TRIANGLES,t[1],l.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),c.triangleCount+=t[1]/3),f&&(n.setUniform1f("u_halo",0),e.drawElements(o.TRIANGLES,t[1],l.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),c.triangleCount+=t[1]/3)}_setStencilState(e,t){const{context:i,is3D:a,stencilSymbols:r}=e;if(i.setStencilTestEnabled(!0),r)return i.setStencilWriteMask(255),void i.setStencilFunction(519,t.stencilRef,255);i.setStencilWriteMask(0),a?i.setStencilFunction(514,t.stencilRef,255):i.setStencilFunction(516,255,255)}}export{c as WGLBrushVTLSymbol};
|
|
5
|
+
import{create as e,fromValues as t}from"../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fadeDuration as i}from"../../vectorTiles/decluttering/config.js";import{vtlTextureBindingUnitSprites as a,vtlTextureBindingUnitGlyphs as r}from"../definitions.js";import{degToByte as n}from"../GeometryUtils.js";import s from"./WGLBrush.js";import{PrimitiveType as o,DataType as l}from"../../../../webgl/enums.js";const f=1/65536;class c extends s{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=e()}dispose(){}drawMany(e,t){const i=e.styleLayer;this._drawIcons(e,i,t),this._drawText(e,i,t)}_drawIcons(e,t,r){const{context:s,displayLevel:o,painter:l,spriteMosaic:f,state:c,styleLayerUID:u,requestRender:p,allowDelayedRender:m}=e,g=t.iconMaterial,d=l.vectorTilesMaterialManager;let y,_=!1;for(const i of r)if(i.layerData.has(u)&&(y=i.layerData.get(u),y.iconPerPageElementsMap.size>0)){_=!0;break}if(!_)return;const h=t.getPaintValue("icon-translate",o),M=t.getPaintValue("icon-translate-anchor",o);let U=t.getLayoutValue("icon-rotation-alignment",o);2===U&&(U=0===t.getLayoutValue("symbol-placement",o)?1:0);const x=0===U,P=t.getLayoutValue("icon-keep-upright",o)&&x,S=y.isIconSDF,E=this._iconProgramOptions;E.sdf=S;const v=d.getMaterialProgram(s,g,E);if(m&&null!=p&&!v.compiled)return void p();s.useProgram(v),v.setUniformMatrix3fv("u_displayViewMat3",0===U?c.displayViewMat3:c.displayMat3),v.setUniformMatrix3fv("u_displayMat3",1===M?c.displayMat3:c.displayViewMat3),v.setUniform2fv("u_iconTranslation",h),v.setUniform1f("u_depth",t.z),v.setUniform1f("u_mapRotation",n(c.rotation)),v.setUniform1f("u_keepUpright",P?1:0),v.setUniform1f("u_level",10*o),v.setUniform1i("u_texture",a),v.setUniform1f("u_fadeDuration",i/1e3),v.setUniform1i("u_isStencilPass",e.stencilSymbols?1:0);let D=-1;for(const i of r){if(!i.layerData.has(u))continue;if(i.key.level!==D&&(D=i.key.level,g.setDataUniforms(v,o,t,D,f)),y=i.layerData.get(u),0===y.iconPerPageElementsMap.size)continue;y.prepareForRendering(s),y.updateOpacityInfo();const a=y.iconVAO;if(null!=a){s.bindVAO(a),v.setUniformMatrix3fv("u_dvsMat3",i.transforms.displayViewScreenMat3),v.setUniform1f("u_time",(performance.now()-y.lastOpacityUpdate)/1e3);for(const[t,a]of y.iconPerPageElementsMap)this._renderIconRange(e,v,a,t,i)}}}_renderIconRange(e,t,i,r,n){const{context:s,spriteMosaic:f}=e;this._spritesTextureSize[0]=f.getWidth(r)/4,this._spritesTextureSize[1]=f.getHeight(r)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),f.bind(s,9729,r,a),this._setStencilState(e,n),s.drawElements(o.TRIANGLES,i[1],l.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),n.triangleCount+=i[1]/3}_drawText(e,a,s){const{context:o,displayLevel:l,glyphMosaic:c,painter:u,pixelRatio:p,spriteMosaic:m,state:g,styleLayerUID:d,requestRender:y,allowDelayedRender:_}=e,h=a.textMaterial,M=u.vectorTilesMaterialManager;let U,x=!1;for(const t of s)if(t.layerData.has(d)&&(U=t.layerData.get(d),U.glyphPerPageElementsMap.size>0)){x=!0;break}if(!x)return;const P=a.getPaintProperty("text-opacity");if(P&&!P.isDataDriven&&0===P.getValue(l))return;const S=a.getPaintProperty("text-color"),E=!S||S.isDataDriven||S.getValue(l)[3]>0,v=a.getPaintProperty("text-halo-width"),D=a.getPaintProperty("text-halo-color"),T=(!v||v.isDataDriven||v.getValue(l)>0)&&(!D||D.isDataDriven||D.getValue(l)[3]>0);if(!E&&!T)return;const V=24/8;let w=a.getLayoutValue("text-rotation-alignment",l);2===w&&(w=0===a.getLayoutValue("symbol-placement",l)?1:0);const R=0===w,I=a.getLayoutValue("text-keep-upright",l)&&R,L=.8*V/p;this._glyphTextureSize||(this._glyphTextureSize=t(c.width/4,c.height/4));const z=a.getPaintValue("text-translate",l),N=a.getPaintValue("text-translate-anchor",l),b=this._sdfProgramOptions,k=M.getMaterialProgram(o,h,b);if(_&&null!=y&&!k.compiled)return void y();o.useProgram(k),k.setUniformMatrix3fv("u_displayViewMat3",0===w?g.displayViewMat3:g.displayMat3),k.setUniformMatrix3fv("u_displayMat3",1===N?g.displayMat3:g.displayViewMat3),k.setUniform2fv("u_textTranslation",z),k.setUniform1f("u_depth",a.z+f),k.setUniform2fv("u_mosaicSize",this._glyphTextureSize),k.setUniform1f("u_mapRotation",n(g.rotation)),k.setUniform1f("u_keepUpright",I?1:0),k.setUniform1f("u_level",10*l),k.setUniform1i("u_texture",r),k.setUniform1f("u_antialiasingWidth",L),k.setUniform1f("u_fadeDuration",i/1e3);let O=-1;for(const t of s){if(!t.layerData.has(d))continue;if(t.key.level!==O&&(O=t.key.level,h.setDataUniforms(k,l,a,O,m)),U=t.layerData.get(d),0===U.glyphPerPageElementsMap.size)continue;U.prepareForRendering(o),U.updateOpacityInfo();const i=U.textVAO;if(null==i)continue;o.bindVAO(i),k.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3),this._setStencilState(e,t);const r=(performance.now()-U.lastOpacityUpdate)/1e3;k.setUniform1f("u_time",r),U.glyphPerPageElementsMap.forEach((e,i)=>{this._renderGlyphRange(o,e,i,c,k,T,E,t)})}}_renderGlyphRange(e,t,i,a,n,s,f,c){a.bind(e,9729,i,r),s&&(n.setUniform1f("u_halo",1),e.drawElements(o.TRIANGLES,t[1],l.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),c.triangleCount+=t[1]/3),f&&(n.setUniform1f("u_halo",0),e.drawElements(o.TRIANGLES,t[1],l.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),c.triangleCount+=t[1]/3)}_setStencilState(e,t){const{context:i,is3D:a,stencilSymbols:r}=e;if(i.setStencilTestEnabled(!0),r)return i.setStencilWriteMask(255),void i.setStencilFunction(519,t.stencilRef,255);i.setStencilWriteMask(0),a?i.setStencilFunction(514,t.stencilRef,255):i.setStencilFunction(516,255,255)}}export{c as WGLBrushVTLSymbol};
|
|
@@ -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{triangulate as t}from"../../../../../../geometry/libtess.js";import{TileClipper as e}from"../../../../../../geometry/support/TileClipper.js";import n from"../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as o}from"../../definitions.js";import{bufcut as r}from"../bufcut.js";const s=1e-5,l=new e(0,0,0,1,0),i=new e(0,0,0,1,0);function f(t,e,n){let o=0;for(let r=1;r<n;r++){const n=t[2*(e+r-1)],s=t[2*(e+r-1)+1];o+=(t[2*(e+r)]-n)*(t[2*(e+r)+1]+s)}return o}function u(t,e,n,o,r){let s=0;const l=2;for(let i=n;i<o;i+=3){const n=(t[i]-r)*l,o=(t[i+1]-r)*l,f=(t[i+2]-r)*l;s+=Math.abs((e[n]-e[f])*(e[o+1]-e[n+1])-(e[n]-e[o])*(e[f+1]-e[n+1]))}return s}function h(t,e){const{coords:n,lengths:o}=e,l=0,i=t;let h=0;for(let c=0;c<o.length;){let t=c,e=o[c],a=f(n,h,e);const g=[];for(;++t<o.length;){const r=o[t],s=f(n,h+e,r);if(!(s>0))break;a+=s,g.push(h+e),e+=r}const p=i.length;r(i,n,h,h+e,g,2,l);const m=u(i,n,p,i.length,l),x=Math.abs(a);if(Math.abs((m-x)/Math.max(1e-7,x))>s)return i.length=0,!1;c=t,h+=e}return!0}function c(e){const{coords:n,lengths:o}=e,{buffer:r}=t(n,o);return r}function a(t,e,n){let o=0;for(let r=0;r<t.lengths.length;r++){const s=t.lengths[r];for(let r=0;r<s;r++){const s=t.coords[2*(r+o)],l=t.coords[2*(r+o)+1];if(s<e||s>n||l<e||l>n)return!0}o+=s}return!1}function g(t,e){if(null==t)return null;if(!a(t,-128,o+128))return t;l.setPixelMargin(e),l.reset(3);let r=0;for(let n=0;n<t.lengths.length;n++){const e=t.lengths[n];let o=t.coords[2*(0+r)],s=t.coords[2*(0+r)+1];l.moveTo(o,s);for(let n=1;n<e;n++)o=t.coords[2*(n+r)],s=t.coords[2*(n+r)+1],l.lineTo(o,s);l.close(),r+=e}const s=l.result(!1);if(!s)return null;const i=[],f=[];for(const n of s){
|
|
5
|
+
import{triangulate as t}from"../../../../../../geometry/libtess.js";import{TileClipper as e}from"../../../../../../geometry/support/TileClipper.js";import n from"../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as o}from"../../definitions.js";import{bufcut as r}from"../bufcut.js";const s=1e-5,l=new e(0,0,0,1,0),i=new e(0,0,0,1,0);function f(t,e,n){let o=0;for(let r=1;r<n;r++){const n=t[2*(e+r-1)],s=t[2*(e+r-1)+1];o+=(t[2*(e+r)]-n)*(t[2*(e+r)+1]+s)}return o}function u(t,e,n,o,r){let s=0;const l=2;for(let i=n;i<o;i+=3){const n=(t[i]-r)*l,o=(t[i+1]-r)*l,f=(t[i+2]-r)*l;s+=Math.abs((e[n]-e[f])*(e[o+1]-e[n+1])-(e[n]-e[o])*(e[f+1]-e[n+1]))}return s}function h(t,e){const{coords:n,lengths:o}=e,l=0,i=t;let h=0;for(let c=0;c<o.length;){let t=c,e=o[c],a=f(n,h,e);const g=[];for(;++t<o.length;){const r=o[t],s=f(n,h+e,r);if(!(s>0))break;a+=s,g.push(h+e),e+=r}const p=i.length;r(i,n,h,h+e,g,2,l);const m=u(i,n,p,i.length,l),x=Math.abs(a);if(Math.abs((m-x)/Math.max(1e-7,x))>s)return i.length=0,!1;c=t,h+=e}return!0}function c(e){const{coords:n,lengths:o}=e,{buffer:r}=t(n,o);return r}function a(t,e,n){let o=0;for(let r=0;r<t.lengths.length;r++){const s=t.lengths[r];for(let r=0;r<s;r++){const s=t.coords[2*(r+o)],l=t.coords[2*(r+o)+1];if(s<e||s>n||l<e||l>n)return!0}o+=s}return!1}function g(t,e){if(null==t)return null;if(!a(t,-128,o+128))return t;l.setPixelMargin(e),l.reset(3);let r=0;for(let n=0;n<t.lengths.length;n++){const e=t.lengths[n];let o=t.coords[2*(0+r)],s=t.coords[2*(0+r)+1];l.moveTo(o,s);for(let n=1;n<e;n++)o=t.coords[2*(n+r)],s=t.coords[2*(n+r)+1],l.lineTo(o,s);l.close(),r+=e}const s=l.result(!1);if(!s)return null;const i=[],f=[];for(const n of s){for(const{x:t,y:e}of n)f.push(t,e);i.push(n.length)}return new n(i,f)}function p(t,e){i.setPixelMargin(e);const n=i,r=-e,s=o+e;let l=[],f=!1;if(!t.nextPath())return null;let u=t.pathLength(),h=!0;for(;h;){t.seekPathStart();const e=[];if(!t.pathSize)return null;n.reset(2),t.nextPoint();let o=t.x,i=t.y;if(f)n.moveTo(o,i);else{if(o<r||o>s||i<r||i>s){f=!0;continue}e.push({x:o,y:i})}let c=!1;for(;t.nextPoint();)if(o=t.x,i=t.y,f)n.lineTo(o,i);else{if(o<r||o>s||i<r||i>s){c=!0;break}e.push({x:o,y:i})}if(c)f=!0;else{if(f){const t=n.resultWithStarts();if(t)for(const e of t)l.push({...e,pathLength:u})}else l.push({line:e,start:0,pathLength:u});h=t.nextPath(),u=h?t.pathLength():0,f=!1}}return l=l.filter(t=>t.line.length>1),0===l.length?null:l}l.setExtent(o),i.setExtent(o);export{f as area,p as clipLinesMarshall,g as clipMarshall,u as triangleAreaArray,h as triangulate,c as triangulateLibtess};
|
|
@@ -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{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{maxTileCoordValue as i}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as
|
|
5
|
+
import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{maxTileCoordValue as i}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{spritePadding as s}from"../../../definitions.js";import{AAnimatedMeshWriter as n}from"./AnimatedMeshWriter.js";import{angle as o,sizing as a,animationPointerAndBaseSizeAndReferenceSize as c,uv as l,offset as m,pos as d,bitset as p,id as h,lineLength as u,value1Position2Value2 as f,zoomRange as x}from"./attributes.js";import{createComputedAnimatedMeshParams as y}from"./ComputedAnimatedParams.js";import{c256ToRad as P}from"../shaders/constants.js";const M=64,g=64,v=2;class w extends n{get vertexSpec(){return{createComputedParams:y,optionalAttributes:{zoomRange:x,value1Position2Value2:f,lineLength:u},attributes:{id:h,bitset:p,pos:d,offset:m.marker,uv:l.marker,animationPointerAndBaseSizeAndReferenceSize:c,sizing:a,angle:o}}}_write(e,i,r){const s=this.evaluatedMeshParams.sprite,{textureBinding:n}=s;e.recordStart(this.instanceId,this.attributeLayout,n);const o=i.getDisplayId();if(this.shift&&"esriGeometryPolyline"===i.geometryType){if(!r){const r=t.fromFeatureSetReaderCIM(i);r&&this._writeParticles(e,i,r)}}else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(e,i);else if("esriGeometryPolygon"===i.geometryType){const t=i.readCentroidForDisplay();if(!t)return;const[r,s]=t.coords;this._writeQuad(e,o,r,s)}else if("esriGeometryPoint"===i.geometryType){const t=i.readXForDisplay(),r=i.readYForDisplay();this._writeQuad(e,o,t,r)}else{const t=i.readGeometryForDisplay();t&&t.forEachVertex((t,i)=>{this._writeQuad(e,o,t,i)})}e.recordEnd()}_writePlacedMarkers(s,n){const o=t.fromFeatureSetReaderCIM(n)?.clone();if(!o)return;const a=-1,c=r.getPlacement(o,a,this.evaluatedMeshParams.placement,e(1),s.id);if(!c)return;const l=n.getDisplayId();let m=c.next(),d=null;for(;null!=m;){const e=m.tx,t=-m.ty;if(Math.abs(e)>i||Math.abs(t)>i){m=c.next();continue}const r=-m.getAngle();s.recordBounds(e,t,M,g),this.shift?d&&this._writeQuad(s,l,d[0],d[1],void 0,r):this._writeQuad(s,l,e,t,void 0,r),d=[e,t],m=c.next()}}_writeParticles(e,t,i){const r=t.getDisplayId();for(;i.nextPath();){const t=[];for(;i.nextPoint();)t.push([i.x,i.y]);const s=_(t);let n=0;for(let e=1;e<t.length;e++){const i=t[e][0]-t[e-1][0],r=t[e][1]-t[e-1][1],s=Math.sqrt(i*i+r*r);n+=s}const o=t=>{for(const i of s){const{a:s,b:o}=i;this._writeQuad(e,r,s.position[0],s.position[1],[s.distance-t,o.position[0],o.position[1],o.distance-t],this.evaluatedMeshParams.angleToLine?Math.atan2(s.direction[1],s.direction[0]):0,n,!0)}},{placement:a}=this.evaluatedMeshParams;if(!a||"placementTemplate"in a||"CIMMarkerPlacementOnVertices"===a.type){let e;if(a&&"CIMMarkerPlacementOnVertices"!==a.type)e=a.placementTemplate;else{e=[0];for(const t of s){const{a:i,b:r}=t,s=i.position[0]-r.position[0],n=i.position[1]-r.position[1],o=Math.sqrt(s*s+n*n);e.push(o)}}let t=-1*n;for(;t<(1+v/2)*n;)for(const i of e)t+=i,o(t)}else"CIMMarkerPlacementAtExtremities"===a.type?"JustBegin"===a.extremityPlacement?o(1):"JustEnd"===a.extremityPlacement?(o(n-1),o(-1)):"Both"===a.extremityPlacement&&(o(1),o(n-1)):"CIMMarkerPlacementOnLine"===a.type&&("LineBeginning"===a.relativeTo?o(1):"LineEnd"===a.relativeTo?(o(n-1),o(-1)):"LineMiddle"===a.relativeTo&&o(n/2))}}_writeQuad(e,t,i,r,n,o=0,a=0,c=!1){const l=this.evaluatedMeshParams.sprite,{rect:m}=l,d=m.x+s,p=m.y+s,h=m.x+m.width-s,u=m.y+m.height-s,f=e.vertexCount();c||e.recordBounds(i,r,M,M);const x={texXmin:d,texYmin:p,texXmax:h,texYmax:u,value1Position2Value2:n,angle:o/P,lineLength:a};for(let s=0;s<4;s++)this._writeVertex(e,t,i,r,x);e.indexEnsureSize(6),e.indexWrite(f),e.indexWrite(f+1),e.indexWrite(f+2),e.indexWrite(f+1),e.indexWrite(f+3),e.indexWrite(f+2)}}function _(e){const t=[];let i=0;for(let r=1;r<e.length;r++){const s=e[r-1],n=e[r],o=n[0]-s[0],a=n[1]-s[1],c=Math.sqrt(o*o+a*a),l=o/c,m=a/c;t.push({a:{position:s,distance:i,direction:[l,m]},b:{position:n,distance:i+c,direction:[l,m]}}),i+=c}return t}class b extends w{constructor(){super(...arguments),this.shift=!1}}class C extends w{constructor(){super(...arguments),this.shift=!0}}export{b as AnimatedMarkerMeshWriter,C as AnimatedMarkerShiftMeshWriter};
|
|
@@ -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{loadLibtess as e}from"../../../../../../../geometry/libtess.js";import{clipMarshall as t,triangulate as r,triangulateLibtess as s}from"../../../mesh/templates/templateUtils.js";import{MeshWriter as i}from"../mesh/MeshWriter.js";const o=100,n=has("featurelayer-fast-triangulation-enabled");class a extends i{async loadDependencies(){await Promise.all([super.loadDependencies(),e()])}_write(e,t,r){const s=r?.asOptimized()??t.readGeometryForDisplay(),i=this._clip(s);i&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,t,i),e.recordEnd())}_clip(e){if(!e)return null;const r=this.hasEffects;return t(e,r?256:8)}_writeGeometry(e,t,i){const a=i.maxLength>o,c=[],l=this.createTesselationParams(t);if(!a&&n&&r(c,i))return void(c.length&&this._writeVertices(e,t,i.coords,l,c));const d=s(i);this._writeVertices(e,t,d,l)}_writeVertices(e,t,r,s,i){const o=t.getDisplayId(),n=e.vertexCount(),a=this.hasEffects;let c=0;if(i)for(const l of i){const t=r[2*l],i=r[2*l+1];a&&e.recordBounds(t,i,0,0),this._writeVertex(e,o,t,i,s),c++}else for(let l=0;l<r.length;l+=2){const t=Math.round(r[l]),i=Math.round(r[l+1]);a&&e.recordBounds(t,i,0,0),this._writeVertex(e,o,t,i,s),c++}e.indexEnsureSize(c);for(let l=0;l<c;l++)e.indexWrite(l+n)}}export{a as AFillMeshWriter};
|
|
5
|
+
import has from"../../../../../../../core/has.js";import{loadLibtess as e}from"../../../../../../../geometry/libtess.js";import{clipMarshall as t,triangulate as r,triangulateLibtess as s}from"../../../mesh/templates/templateUtils.js";import{MeshWriter as i}from"../mesh/MeshWriter.js";const o=100,n=has("featurelayer-fast-triangulation-enabled");class a extends i{async loadDependencies(){await Promise.all([super.loadDependencies(),e()])}_write(e,t,r){const s=r?.asOptimized()??t.readGeometryForDisplay(),i=this._clip(s);i&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,t,i.justXY()),e.recordEnd())}_clip(e){if(!e)return null;const r=this.hasEffects;return t(e,r?256:8)}_writeGeometry(e,t,i){const a=(i=i.justXY()).maxLength>o,c=[],l=this.createTesselationParams(t);if(!a&&n&&r(c,i))return void(c.length&&this._writeVertices(e,t,i.coords,l,c));const d=s(i);this._writeVertices(e,t,d,l)}_writeVertices(e,t,r,s,i){const o=t.getDisplayId(),n=e.vertexCount(),a=this.hasEffects;let c=0;if(i)for(const l of i){const t=r[2*l],i=r[2*l+1];a&&e.recordBounds(t,i,0,0),this._writeVertex(e,o,t,i,s),c++}else for(let l=0;l<r.length;l+=2){const t=Math.round(r[l]),i=Math.round(r[l+1]);a&&e.recordBounds(t,i,0,0),this._writeVertex(e,o,t,i,s),c++}e.indexEnsureSize(c);for(let l=0;l<c;l++)e.indexWrite(l+n)}}export{a as AFillMeshWriter};
|
|
@@ -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{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{numericHash as i}from"../../../../../../../core/string.js";import{fromRotation as r,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as n,set as a,sub as l,normalize as c,add as h,scale as m}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as u}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{GeometryCursor as f}from"../../../../../../../geometry/GeometryCursor.js";import{generalizeOptimizedGeometry as g,convertToGeometry as _}from"../../../../../../../layers/graphics/featureConversionUtils.js";import p from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as b,minMaxZoomPrecisionFactor as x}from"../../../definitions.js";import v from"../../../collisions/BoundingBox.js";import{LabelMetric as M}from"../../../collisions/LabelMetric.js";import{smoothPaths as P,pathDivide as y}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as w,processColorInput as L}from"../fill/meshWriterUtils.js";import{TextMeshWriter as I,maxLabelZoom as B}from"../text/TextMeshWriter.js";const S=1,z=0,D=128;function A(e,t,r){return i(`${e}${t}${r}`)}function j(e,t,r,s,o){return i(`${e}${t}${r}${s*2**(B-o)}`)}function G(e,t,r){return i(`${e}${t}${r}`)}function Z(e,t,r,s,o){return i(`${e}${o}${t}${r*2**(B-s)}`)}const k=e(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class F extends I{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,r){if(this._zoomLevel=r||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,i,r,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":{const i=t.readCentroidForDisplay();if(!i)return;const[r,s]=i.coords;this._writePoint(e,r,s,0,t);break}case"esriGeometryMultipoint":{let i=0;const r=f.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,r,s,o){const[n,a]=this._getMetricDir(),l=this.evaluatedMeshParams.scaleInfo?.maxScale??0,c=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this.evaluatedMeshParams.labelClassId;return new M(e,h,t,i,r,s,n,a,l,c,o)}_writePoint(e,t,i,r,s){if(t<0||t>b||i<0||i>b)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=A(this.evaluatedMeshParams.layerId,s.getObjectId(),r),c=G(s.getObjectId(),a,r),[h,m]=this._getMetricDir(),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,u=this.evaluatedMeshParams.scaleInfo?.minScale??0,f=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new M(n,a,l,c,t,i,h,m,d,u,f)),this._writeGlyphs(e,n,t,i,o,0,f,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:r}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,r)=>this._placeSubdivGlyphs(e,t,i,r),a=(o.bounds.width+s)/(1<<S);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:w(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===r?"above":"top"===r?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=new p;g(a,n,!1,!1,"esriGeometryPolyline",1);const l=$(new p,a,o),c=$(new p,a,-o),h=_(c,"esriGeometryPolyline",!1,!1),m=_(l,"esriGeometryPolyline",!1,!1),d=P(m.paths,s.bounds.width),u=P(h.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<d.length;f++)this._current.pathIndex=f,y(d[f],i,t,!!r);this._current.offsetDirection="below";for(let f=0;f<u.length;f++)this._current.pathIndex=f,y(u[f],i,t,!!r)}_writeCenterAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=P(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,y(o[n],i,t,!!r)}_placeSubdivGlyphs(e,t,i,r){const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n,layerId:a,labelClassId:l}=this.evaluatedMeshParams,{objId:c,shaping:h,pathIndex:m}=this._current,d=this._current.zoomRange[0],u=k(t),f=this._current.shaping.bounds.width/(1<<S),g=Math.sqrt(n||D)/(1<<S),_=Math.min(i,r-i),p=h.isMultiline?B:Math.log2(_/(g+f/2)),b=0===t?p:Math.min(u,p),x=Math.max(d,this._zoomLevel+S-b),v=this._zoomLevel-x,M=h.bounds.width/2*2**v,P=j(a,c,m,t,this._zoomLevel),y=Z(c,m,t,this._zoomLevel,l);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,x,P,y):s&&v<0?this._placeStraightAlong(e,d,P,y):"parallel"===o?this._placeStraightAlong(e,x,P,y):"curved"===o&&this._placeCurved(e,x,M,P,y)}_placeStraight(e,t,i,r){const{out:s,id:o,shaping:n,referenceBounds:a}=this._current,{x:l,y:c}=e;s.metricStart(this._createLineLabelMetric(o,i,r,l,c)),s.metricBoxWrite(n.boundsT);const h=e.angle*(180/Math.PI)%360,m=(e.angle*(180/Math.PI)+180)%360;if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const e={clipAngle:h,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const e={clipAngle:m,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}s.metricEnd()}_placeCurved(e,t,i,r,s){const{out:o,id:n}=this._current;o.metricStart(this._createLineLabelMetric(n,r,s,e.x,e.y));const a=e.clone(),l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,l),this._placeBack(e,a,t,i,1,l),this._placeForward(e,a,t,i,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,c),this._placeBack(e,a,t,i,0,c),this._placeForward(e,a,t,i,0,c)),o.metricEnd()}_placeStraightAlong(e,i,n,a){const{out:l,id:c,shaping:h,zoomRange:m,referenceBounds:u}=this._current,{boxBorderLineColor:f,boxBackgroundColor:g}=this.evaluatedMeshParams,_=e.clone(),p=e.angle*(180/Math.PI)%360,b=(e.angle*(180/Math.PI)+180)%360,x=h.glyphs.length>0&&!(!f&&!g);if(l.metricStart(this._createLineLabelMetric(c,n,a,e.x,e.y)),x){const n=Math.max(i,m[0],0),a=Math.min(B,m[1]),f=r(o(),-e.angle),g={minZoom:n,maxZoom:a,clipAngle:p,mapAligned:!0,isLineLabel:!0},_=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=d(_,-1*x),[i,r]=h.shapeBackground(s(o(),f,t));l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,u,g),l.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=d(_,x),[i,r]=h.shapeBackground(s(o(),f,t));g.clipAngle=b,l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,u,g),l.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(_,i,1,p,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(_,i,0,b,!0),l.metricEnd()}_placeBack(e,t,i,r,s,o){const n=e.clone();let a=e.backwardLength+z;for(;n.prev()&&!(a>=r);)this._placeOnSegment(n,t,a,i,-1,s,o),a+=n.length+z}_placeForward(e,t,i,r,s,o){const n=e.clone();let a=e.remainingLength+z;for(;n.next()&&!(a>=r);)this._placeOnSegment(n,t,a,i,1,s,o),a+=n.length+z}_placeFirst(e,i,s,a,l=!1){const{out:c,id:h,shaping:m,zoomRange:u,referenceBounds:f}=this._current,g=m.glyphs,_=t(this.evaluatedMeshParams.offsetX),p=t(this.evaluatedMeshParams.offsetY),b=d(_,p),x=r(o(),-e.angle);n(b,b,x);for(const t of g){const r=t.x>m.bounds.x?s:1-s,o=r*e.remainingLength+(1-r)*e.backwardLength,n=Math.abs(t.x+t.width/2-m.bounds.x),d=Math.max(0,this._zoomLevel+Math.log2(n/(o+z))),g=Math.max(i,l?0:d);if(t.maxZoom=Math.min(u[1],B),t.angle=e.angle+(1-s)*Math.PI,t.minZoom=Math.max(u[0],g),this._writeLineGlyph(c,h,e.x,e.y,t,a,f,!0),(s||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom)){const e=new v(t.bounds.x+b[0],t.bounds.y+b[1],t.bounds.width,t.bounds.height);c.metricBoxWrite(e)}}}_placeOnSegment(e,i,s,a,l,c,h){const{out:m,id:u,shaping:f,referenceBounds:g}=this._current,_=f.glyphs,p=e.dx/e.length,b=e.dy/e.length,x={x:e.x+s*-l*p,y:e.y+s*-l*b},M=t(this.evaluatedMeshParams.offsetX),P=t(this.evaluatedMeshParams.offsetY),y=d(M,P),w=r(o(),-e.angle);n(y,y,w);for(const t of _){const i=t.x>f.bounds.x?c:1-c;if(!(i&&1===l||!i&&-1===l))continue;const r=Math.abs(t.x+t.width/2-f.bounds.x),o=Math.max(0,this._zoomLevel+Math.log2(r/s)-.1),n=Math.max(a,this._zoomLevel+Math.log2(r/(s+e.length+z)));if(0!==o&&(t.angle=e.angle+(1-c)*Math.PI,t.minZoom=n,t.maxZoom=o,this._writeLineGlyph(m,u,x.x,x.y,t,h,g,!0),(c||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom))){const e=new v(t.bounds.x+y[0],t.bounds.y+y[1],t.bounds.width,t.bounds.height);m.metricBoxWrite(e)}}}_writeLineGlyph(e,t,i,r,s,o,n,a){if(i<0||i>b||r<0||r>b)return;e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:c}=s,{fontSize:h,haloSize:m,outlineSize:d}=this._textMeshTransformProps;this._writeQuad(e,t,i,r,{texcoords:l,offsets:c,fontSize:h,haloSize:m,outlineSize:d,color:L(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:n,minZoom:Math.max(this._current.zoomRange[0],s.minZoom),maxZoom:Math.min(this._current.zoomRange[1],s.maxZoom),clipAngle:o,mapAligned:a,isLineLabel:!0}),e.recordEnd()}_packedZoom(e){return Math.floor(e*x)/x}_isVisible(e,t){let i=Math.max(this._current.zoomRange[0],e),r=Math.min(this._current.zoomRange[1],t);i=this._packedZoom(i),r=this._packedZoom(r);const s=this._packedZoom(this._zoomLevel);return i<=s&&s<=r}}function $(e,t,i){const{coords:r,lengths:s}=t,o=u(),n=u(),d=u(),f=u(),g=u(),_=u(),p=2;let b=0;for(let u=0;u<s.length;u++){const t=s[u];for(let s=0;s<t;s++){const u=p*(s+b-1),x=p*(s+b),v=p*(s+b+1);s>0?a(o,r[u],r[u+1]):a(o,0,0),a(n,r[x],r[x+1]),s<t-1?a(d,r[v],r[v+1]):a(d,0,0),0===s?a(f,0,0):(l(f,n,o),c(f,f),a(f,f[1],-f[0])),s===t-1?a(g,0,0):(l(g,d,n),c(g,g),a(g,g[1],-g[0])),h(_,f,g),c(_,_);const M=_[0]*g[0]+_[1]*g[1];0!==M&&m(_,_,M),m(_,_,i),e.coords.push(n[0]+_[0],n[1]+_[1])}e.lengths.push(t),b+=t}return e}export{F as LabelMeshWriter,A as labelIdHash,G as labelMetricHash,j as lineLabelIdHash,Z as lineLabelMetricHash};
|
|
5
|
+
import{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{numericHash as i}from"../../../../../../../core/string.js";import{fromRotation as r,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as n,set as a,sub as l,normalize as c,add as h,scale as m}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as u}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{GeometryCursor as f}from"../../../../../../../geometry/GeometryCursor.js";import{generalizeOptimizedGeometry as g,convertToGeometry as _}from"../../../../../../../layers/graphics/featureConversionUtils.js";import p from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as b,minMaxZoomPrecisionFactor as x}from"../../../definitions.js";import v from"../../../collisions/BoundingBox.js";import{LabelMetric as M}from"../../../collisions/LabelMetric.js";import{smoothPaths as P,pathDivide as y}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as w,processColorInput as L}from"../fill/meshWriterUtils.js";import{TextMeshWriter as I,maxLabelZoom as B}from"../text/TextMeshWriter.js";const S=1,z=0,D=128;function A(e,t,r){return i(`${e}${t}${r}`)}function j(e,t,r,s,o){return i(`${e}${t}${r}${s*2**(B-o)}`)}function G(e,t,r){return i(`${e}${t}${r}`)}function Z(e,t,r,s,o){return i(`${e}${o}${t}${r*2**(B-s)}`)}const k=e(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class F extends I{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,r){if(this._zoomLevel=r||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,i,r,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":{const i=t.readCentroidForDisplay();if(!i)return;const[r,s]=i.coords;this._writePoint(e,r,s,0,t);break}case"esriGeometryMultipoint":{let i=0;const r=f.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,r,s,o){const[n,a]=this._getMetricDir(),l=this.evaluatedMeshParams.scaleInfo?.maxScale??0,c=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this.evaluatedMeshParams.labelClassId;return new M(e,h,t,i,r,s,n,a,l,c,o)}_writePoint(e,t,i,r,s){if(t<0||t>b||i<0||i>b)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=A(this.evaluatedMeshParams.layerId,s.getObjectId(),r),c=G(s.getObjectId(),a,r),[h,m]=this._getMetricDir(),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,u=this.evaluatedMeshParams.scaleInfo?.minScale??0,f=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new M(n,a,l,c,t,i,h,m,d,u,f)),this._writeGlyphs(e,n,t,i,o,0,f,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:r}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,r)=>this._placeSubdivGlyphs(e,t,i,r),a=(o.bounds.width+s)/(1<<S);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:w(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===r?"above":"top"===r?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=g(n,"esriGeometryPolyline",1)??new p,l=$(a,o),c=$(a,-o),h=_(c,"esriGeometryPolyline",!1,!1),m=_(l,"esriGeometryPolyline",!1,!1),d=P(m.paths,s.bounds.width),u=P(h.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<d.length;f++)this._current.pathIndex=f,y(d[f],i,t,!!r);this._current.offsetDirection="below";for(let f=0;f<u.length;f++)this._current.pathIndex=f,y(u[f],i,t,!!r)}_writeCenterAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=P(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,y(o[n],i,t,!!r)}_placeSubdivGlyphs(e,t,i,r){const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n,layerId:a,labelClassId:l}=this.evaluatedMeshParams,{objId:c,shaping:h,pathIndex:m}=this._current,d=this._current.zoomRange[0],u=k(t),f=this._current.shaping.bounds.width/(1<<S),g=Math.sqrt(n||D)/(1<<S),_=Math.min(i,r-i),p=h.isMultiline?B:Math.log2(_/(g+f/2)),b=0===t?p:Math.min(u,p),x=Math.max(d,this._zoomLevel+S-b),v=this._zoomLevel-x,M=h.bounds.width/2*2**v,P=j(a,c,m,t,this._zoomLevel),y=Z(c,m,t,this._zoomLevel,l);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,x,P,y):s&&v<0?this._placeStraightAlong(e,d,P,y):"parallel"===o?this._placeStraightAlong(e,x,P,y):"curved"===o&&this._placeCurved(e,x,M,P,y)}_placeStraight(e,t,i,r){const{out:s,id:o,shaping:n,referenceBounds:a}=this._current,{x:l,y:c}=e;s.metricStart(this._createLineLabelMetric(o,i,r,l,c)),s.metricBoxWrite(n.boundsT);const h=e.angle*(180/Math.PI)%360,m=(e.angle*(180/Math.PI)+180)%360;if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const e={clipAngle:h,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const e={clipAngle:m,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}s.metricEnd()}_placeCurved(e,t,i,r,s){const{out:o,id:n}=this._current;o.metricStart(this._createLineLabelMetric(n,r,s,e.x,e.y));const a=e.clone(),l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,l),this._placeBack(e,a,t,i,1,l),this._placeForward(e,a,t,i,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,c),this._placeBack(e,a,t,i,0,c),this._placeForward(e,a,t,i,0,c)),o.metricEnd()}_placeStraightAlong(e,i,n,a){const{out:l,id:c,shaping:h,zoomRange:m,referenceBounds:u}=this._current,{boxBorderLineColor:f,boxBackgroundColor:g}=this.evaluatedMeshParams,_=e.clone(),p=e.angle*(180/Math.PI)%360,b=(e.angle*(180/Math.PI)+180)%360,x=h.glyphs.length>0&&!(!f&&!g);if(l.metricStart(this._createLineLabelMetric(c,n,a,e.x,e.y)),x){const n=Math.max(i,m[0],0),a=Math.min(B,m[1]),f=r(o(),-e.angle),g={minZoom:n,maxZoom:a,clipAngle:p,mapAligned:!0,isLineLabel:!0},_=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=d(_,-1*x),[i,r]=h.shapeBackground(s(o(),f,t));l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,u,g),l.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=d(_,x),[i,r]=h.shapeBackground(s(o(),f,t));g.clipAngle=b,l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,u,g),l.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(_,i,1,p,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(_,i,0,b,!0),l.metricEnd()}_placeBack(e,t,i,r,s,o){const n=e.clone();let a=e.backwardLength+z;for(;n.prev()&&!(a>=r);)this._placeOnSegment(n,t,a,i,-1,s,o),a+=n.length+z}_placeForward(e,t,i,r,s,o){const n=e.clone();let a=e.remainingLength+z;for(;n.next()&&!(a>=r);)this._placeOnSegment(n,t,a,i,1,s,o),a+=n.length+z}_placeFirst(e,i,s,a,l=!1){const{out:c,id:h,shaping:m,zoomRange:u,referenceBounds:f}=this._current,g=m.glyphs,_=t(this.evaluatedMeshParams.offsetX),p=t(this.evaluatedMeshParams.offsetY),b=d(_,p),x=r(o(),-e.angle);n(b,b,x);for(const t of g){const r=t.x>m.bounds.x?s:1-s,o=r*e.remainingLength+(1-r)*e.backwardLength,n=Math.abs(t.x+t.width/2-m.bounds.x),d=Math.max(0,this._zoomLevel+Math.log2(n/(o+z))),g=Math.max(i,l?0:d);if(t.maxZoom=Math.min(u[1],B),t.angle=e.angle+(1-s)*Math.PI,t.minZoom=Math.max(u[0],g),this._writeLineGlyph(c,h,e.x,e.y,t,a,f,!0),(s||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom)){const e=new v(t.bounds.x+b[0],t.bounds.y+b[1],t.bounds.width,t.bounds.height);c.metricBoxWrite(e)}}}_placeOnSegment(e,i,s,a,l,c,h){const{out:m,id:u,shaping:f,referenceBounds:g}=this._current,_=f.glyphs,p=e.dx/e.length,b=e.dy/e.length,x={x:e.x+s*-l*p,y:e.y+s*-l*b},M=t(this.evaluatedMeshParams.offsetX),P=t(this.evaluatedMeshParams.offsetY),y=d(M,P),w=r(o(),-e.angle);n(y,y,w);for(const t of _){const i=t.x>f.bounds.x?c:1-c;if(!(i&&1===l||!i&&-1===l))continue;const r=Math.abs(t.x+t.width/2-f.bounds.x),o=Math.max(0,this._zoomLevel+Math.log2(r/s)-.1),n=Math.max(a,this._zoomLevel+Math.log2(r/(s+e.length+z)));if(0!==o&&(t.angle=e.angle+(1-c)*Math.PI,t.minZoom=n,t.maxZoom=o,this._writeLineGlyph(m,u,x.x,x.y,t,h,g,!0),(c||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom))){const e=new v(t.bounds.x+y[0],t.bounds.y+y[1],t.bounds.width,t.bounds.height);m.metricBoxWrite(e)}}}_writeLineGlyph(e,t,i,r,s,o,n,a){if(i<0||i>b||r<0||r>b)return;e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:c}=s,{fontSize:h,haloSize:m,outlineSize:d}=this._textMeshTransformProps;this._writeQuad(e,t,i,r,{texcoords:l,offsets:c,fontSize:h,haloSize:m,outlineSize:d,color:L(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:n,minZoom:Math.max(this._current.zoomRange[0],s.minZoom),maxZoom:Math.min(this._current.zoomRange[1],s.maxZoom),clipAngle:o,mapAligned:a,isLineLabel:!0}),e.recordEnd()}_packedZoom(e){return Math.floor(e*x)/x}_isVisible(e,t){let i=Math.max(this._current.zoomRange[0],e),r=Math.min(this._current.zoomRange[1],t);i=this._packedZoom(i),r=this._packedZoom(r);const s=this._packedZoom(this._zoomLevel);return i<=s&&s<=r}}function $(e,t){const i=new p,{coords:r,lengths:s}=e,o=u(),n=u(),d=u(),f=u(),g=u(),_=u(),b=2;let x=0;for(let u=0;u<s.length;u++){const e=s[u];for(let s=0;s<e;s++){const u=b*(s+x-1),p=b*(s+x),v=b*(s+x+1);s>0?a(o,r[u],r[u+1]):a(o,0,0),a(n,r[p],r[p+1]),s<e-1?a(d,r[v],r[v+1]):a(d,0,0),0===s?a(f,0,0):(l(f,n,o),c(f,f),a(f,f[1],-f[0])),s===e-1?a(g,0,0):(l(g,d,n),c(g,g),a(g,g[1],-g[0])),h(_,f,g),c(_,_);const M=_[0]*g[0]+_[1]*g[1];0!==M&&m(_,_,M),m(_,_,t),i.coords.push(n[0]+_[0],n[1]+_[1])}i.lengths.push(e),x+=e}return i}export{F as LabelMeshWriter,A as labelIdHash,G as labelMetricHash,j as lineLabelIdHash,Z as lineLabelMetricHash};
|
|
@@ -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};
|