@arcgis/core 4.34.0-next.54 → 4.34.0-next.56
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/WebScene.js +1 -1
- package/analysis/ElevationProfile/ElevationProfileGroundLine.d.ts +4 -0
- package/analysis/ElevationProfile/ElevationProfileGroundLine.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileInputLine.d.ts +4 -0
- package/analysis/ElevationProfile/ElevationProfileInputLine.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileLine.d.ts +4 -0
- package/analysis/ElevationProfile/ElevationProfileLine.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileLineChartOptions.d.ts +4 -0
- package/analysis/ElevationProfile/{LineChartOptions.js → ElevationProfileLineChartOptions.js} +1 -1
- package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +4 -0
- package/analysis/ElevationProfile/{LineViewOptions.js → ElevationProfileLineViewOptions.js} +1 -1
- package/analysis/ElevationProfile/ElevationProfileQueryLine.d.ts +4 -0
- package/analysis/ElevationProfile/ElevationProfileQueryLine.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileSceneLine.d.ts +4 -0
- package/analysis/ElevationProfile/ElevationProfileSceneLine.js +5 -0
- package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +4 -0
- package/analysis/ElevationProfile/{Units.js → ElevationProfileUnits.js} +1 -1
- package/analysis/ElevationProfile/ElevationProfileViewOptions.d.ts +4 -0
- package/analysis/ElevationProfile/{ViewOptions.js → ElevationProfileViewOptions.js} +1 -1
- package/analysis/ElevationProfile/elevationProfileLineTypes.js +1 -1
- package/analysis/ElevationProfileAnalysis.js +1 -1
- package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01e8b9dc77a57d1c2a52.js +1 -0
- package/assets/esri/core/workers/chunks/027cfcde29fe87aa2ffe.js +1 -0
- package/assets/esri/core/workers/chunks/0a4586e596413ef7a4b5.js +1 -0
- package/assets/esri/core/workers/chunks/10b46438885916d18425.js +1 -0
- package/assets/esri/core/workers/chunks/1166ed298cf5ca7ad444.js +1 -0
- package/assets/esri/core/workers/chunks/13797036850dcc3671c3.js +1 -0
- package/assets/esri/core/workers/chunks/18ceea59e469a0f2721b.js +1 -0
- package/assets/esri/core/workers/chunks/199a17b0a0f75cbaed16.js +1 -0
- package/assets/esri/core/workers/chunks/1eee7cf11df01a52c1bf.js +1 -0
- package/assets/esri/core/workers/chunks/{ac41b882f9cbf8d56f0c.js → 222f981e876f60ae282f.js} +1 -1
- package/assets/esri/core/workers/chunks/22334a464f798b5279b2.js +1 -0
- package/assets/esri/core/workers/chunks/{99b9392946d776a62997.js → 23e600e368ac829680b5.js} +1 -1
- package/assets/esri/core/workers/chunks/24ac204d8a045aa821be.js +1 -0
- package/assets/esri/core/workers/chunks/27197b0a2ffb2b6104ea.js +1 -0
- package/assets/esri/core/workers/chunks/{93af38d29d066f27ed28.js → 2cb14d040e67a261b31c.js} +1 -1
- package/assets/esri/core/workers/chunks/{0021118bafefd1e47ff7.js → 31c088966ccfff2ea1db.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9c109d43a1e5160955d.js → 3490d47cac7c8dec70cd.js} +2 -2
- package/assets/esri/core/workers/chunks/3d800fbc449bea18b1cd.js +1 -0
- package/assets/esri/core/workers/chunks/43a56c8fa4e5be18c12a.js +1 -0
- package/assets/esri/core/workers/chunks/4874aabdb5c60ca66216.js +1 -0
- package/assets/esri/core/workers/chunks/4b58da6cb91f7bf6af8b.js +1 -0
- package/assets/esri/core/workers/chunks/{cac060a187f3a27a19ba.js → 4d5abcf57a6ded4750ba.js} +1 -1
- package/assets/esri/core/workers/chunks/527557b603400189d49a.js +1 -0
- package/assets/esri/core/workers/chunks/{d0bf1fc6e3c198bc565d.js → 57486b18421a3c9690d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{4bd92232928b832dea76.js → 5900dde7a201a7d47469.js} +1 -1
- package/assets/esri/core/workers/chunks/5f518931a660b3c4f519.js +1 -0
- package/assets/esri/core/workers/chunks/63f3e46bfa820436161c.js +1 -0
- package/assets/esri/core/workers/chunks/66f3659ba18f92cd623e.js +1 -0
- package/assets/esri/core/workers/chunks/67355372ac5fd8a15d18.js +1 -0
- package/assets/esri/core/workers/chunks/{b0ee061747bef6729bb9.js → 6801b92bce7a918fda6f.js} +1 -1
- package/assets/esri/core/workers/chunks/6940bb6524938894a246.js +1 -0
- package/assets/esri/core/workers/chunks/6b11476b2004b4db576e.js +1 -0
- package/assets/esri/core/workers/chunks/{5691d504ffe5592bc40f.js → 6dc0009889f2b7cc8cff.js} +1 -1
- package/assets/esri/core/workers/chunks/71cac356874b36f9a383.js +1 -0
- package/assets/esri/core/workers/chunks/{69dc5a7abc1fda2474ad.js → 722931d1a60be461e521.js} +1 -1
- package/assets/esri/core/workers/chunks/79ab06fb4c91ac8da323.js +1 -0
- package/assets/esri/core/workers/chunks/{0a4357af5b8c0532b439.js → 7bdfc7c7ce1d94c00745.js} +1 -1
- package/assets/esri/core/workers/chunks/{0ce671588de2858516d2.js → 83737d86584bf1b32368.js} +1 -1
- package/assets/esri/core/workers/chunks/853b9f29b4d62fa621b9.js +1 -0
- package/assets/esri/core/workers/chunks/855f25ce748aaef44b1a.js +1 -0
- package/assets/esri/core/workers/chunks/{71acded1b3c0057917a1.js → 862fe2f96d4b777ff5b8.js} +1 -1
- package/assets/esri/core/workers/chunks/{98ea12c7a000a30f3dc0.js → 87f68c2b9361bd3f8cac.js} +1 -1
- package/assets/esri/core/workers/chunks/8fa50cac57b6e1ecec76.js +1 -0
- package/assets/esri/core/workers/chunks/9307108821d82c131654.js +1 -0
- package/assets/esri/core/workers/chunks/97ae2fdb6cb98249f5fa.js +1 -0
- package/assets/esri/core/workers/chunks/9a20390602126995f831.js +1 -0
- package/assets/esri/core/workers/chunks/9b10e70f28873cff44f5.js +1 -0
- package/assets/esri/core/workers/chunks/9cdeead9d444e8d95477.js +1 -0
- package/assets/esri/core/workers/chunks/a778a72456fefdf40115.js +1 -0
- package/assets/esri/core/workers/chunks/a999f804fc2f00b2e7ae.js +1 -0
- package/assets/esri/core/workers/chunks/adf11d31f95481f89a55.js +1 -0
- package/assets/esri/core/workers/chunks/ae73ac81bd10614c2b53.js +1 -0
- package/assets/esri/core/workers/chunks/af4412e79275c5a87539.js +1 -0
- package/assets/esri/core/workers/chunks/{7a8d740d1226719a578a.js → b457b7dd907f06278bee.js} +1 -1
- package/assets/esri/core/workers/chunks/{81e518dd62bd95611d00.js → b47688e3263099540873.js} +1 -1
- package/assets/esri/core/workers/chunks/c7d4c296011c5393bcaa.js +1 -0
- package/assets/esri/core/workers/chunks/c86e339e45900c54c9f5.js +1 -0
- package/assets/esri/core/workers/chunks/c91217d977a6baaee74a.js +1 -0
- package/assets/esri/core/workers/chunks/{a1d3f1c221389eb6090c.js → c95e6bef8c97cf647869.js} +1 -1
- package/assets/esri/core/workers/chunks/{e1b25b1ce3bd4f0f2cda.js → cb57cdff976d2d4b0b41.js} +1 -1
- package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +1 -0
- package/assets/esri/core/workers/chunks/{9fef330b241f958b55df.js → d0124b0dd62b331afe58.js} +1 -1
- package/assets/esri/core/workers/chunks/d3a7747f23e91d1f1b5e.js +1 -0
- package/assets/esri/core/workers/chunks/d3ae88fcde2d7fb3e2e2.js +1 -0
- package/assets/esri/core/workers/chunks/{b6a201e86f9caef45ff0.js → d42fd0effc560eefb14b.js} +1 -1
- package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +1 -0
- package/assets/esri/core/workers/chunks/{2da12a64d3baef4aaaa1.js → d87fdc64a5cc6be4bd69.js} +1 -1
- package/assets/esri/core/workers/chunks/db5d3feeb61ccb5ede98.js +1 -0
- package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +1 -0
- package/assets/esri/core/workers/chunks/{aab349d4624b78ef429f.js → e6bf4f3f6868dc9028e3.js} +1 -1
- package/assets/esri/core/workers/chunks/e982cf44906eb26164f2.js +1 -0
- package/assets/esri/core/workers/chunks/{081b22fa73ef7b696409.js → ead1acf95c3385630da8.js} +2 -2
- package/assets/esri/core/workers/chunks/f1c50f37a81c672263a1.js +1 -0
- package/assets/esri/core/workers/chunks/f74b0cdc1c2b56bac5f0.js +1 -0
- package/assets/esri/core/workers/chunks/f807e7fc90e0e7ce6b67.js +1 -0
- package/assets/esri/core/workers/chunks/{fae6030a81cb91a91b69.js → faf4002f9547a0cc4e33.js} +1 -1
- package/assets/esri/core/workers/chunks/ff323db554c9e09749e8.js +1 -0
- package/assets/esri/core/workers/chunks/{fe55833c80cf59df9c2b.js → ff42b24b48019a03d841.js} +1 -1
- package/assets/esri/core/workers/chunks/{e10c5405f956b2cc59e4.js → ff4e15a872de94d2b438.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff7962063d132c1ec814.js → ff8a4bf1bceb362d67ab.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/bundle.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/vec42.js +1 -1
- package/config.js +1 -1
- package/core/ArrayPool.js +1 -1
- package/core/Collection.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec4.js +1 -1
- package/core/pbf.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/geohash/GeohashCell.js +1 -1
- package/geohash/GeohashTree.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/support/DoubleArray.js +1 -1
- package/geometry/support/boundedPlane.js +1 -1
- package/geometry/support/coordsUtils.js +1 -1
- package/geometry/support/extentUtils.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/graphic/KMLGraphicOrigin.js +5 -0
- package/graphic/isKMLGraphicOrigin.js +5 -0
- package/interfaces.d.ts +147 -142
- package/kernel.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/KMLSublayer.js +1 -1
- package/layers/support/featureReductionUtils.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/views/2d/engine/Container.js +1 -1
- package/views/2d/engine/DisplayObject.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/DisplayEntity.js +1 -1
- package/views/2d/engine/webgl/DisplayRecord.js +1 -1
- package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/PooledUint32Array.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
- package/views/2d/layers/features/FeatureSpatialIndex.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/aggregation/AccumulatedStatistics.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridCell.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.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/DisplayIdGenerator.js +1 -1
- package/views/2d/layers/features/support/FeatureSetCache.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
- package/views/2d/layers/features/support/StaticBitSet.js +1 -1
- package/views/2d/tiling/TileCoverage.js +1 -1
- package/views/2d/tiling/TileKey.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/ElevationProfile/{HoveredPointVisualization.js → ElevationProfileHoveredPointVisualization.js} +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileLinesVisualization.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileSceneLineComputation.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +5 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceController.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/{ArrowManipulator.js → ViewshedArrowManipulator.js} +1 -1
- package/views/3d/analysis/Viewshed/{FieldOfViewManipulation.js → ViewshedFieldOfViewManipulation.js} +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +5 -0
- package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +5 -0
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +5 -0
- package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/support/ViewSlice.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/terrain/ScaleRangeQueries.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TilePerLayerInfo.js +1 -1
- package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
- package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +5 -0
- package/views/analysis/ElevationProfile/{ProfileGenerationError.js → ElevationProfileGenerationError.js} +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileGroundLineComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileInputLineComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileQueryLineComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +4 -0
- package/views/analysis/ElevationProfile/ElevationProfileResult.js +5 -0
- package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +5 -0
- package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +5 -0
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/MultipointDrawAction.js +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/drawUtils.js +1 -1
- package/views/draw/support/reshapeTooltipUtils.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/AppendVertex.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/tooltip/infos/SelectedVertexTooltipInfo.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/support/PropertiesPool.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/compare.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLine.d.ts +2 -2
- package/widgets/ElevationProfile/support/profileUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/sketchUtils.js +1 -1
- package/analysis/ElevationProfile/GroundLine.d.ts +0 -4
- package/analysis/ElevationProfile/GroundLine.js +0 -5
- package/analysis/ElevationProfile/InputLine.d.ts +0 -4
- package/analysis/ElevationProfile/InputLine.js +0 -5
- package/analysis/ElevationProfile/Line.d.ts +0 -4
- package/analysis/ElevationProfile/Line.js +0 -5
- package/analysis/ElevationProfile/LineChartOptions.d.ts +0 -4
- package/analysis/ElevationProfile/LineViewOptions.d.ts +0 -4
- package/analysis/ElevationProfile/QueryLine.d.ts +0 -4
- package/analysis/ElevationProfile/QueryLine.js +0 -5
- package/analysis/ElevationProfile/SceneLine.d.ts +0 -4
- package/analysis/ElevationProfile/SceneLine.js +0 -5
- package/analysis/ElevationProfile/Units.d.ts +0 -4
- package/analysis/ElevationProfile/ViewOptions.d.ts +0 -4
- package/assets/esri/core/workers/chunks/02902303e5585a16ebea.js +0 -1
- package/assets/esri/core/workers/chunks/0445de3a8968c0734c91.js +0 -1
- package/assets/esri/core/workers/chunks/09268dc856c3d5ce178f.js +0 -1
- package/assets/esri/core/workers/chunks/0f51e51db83f303ce5a6.js +0 -1
- package/assets/esri/core/workers/chunks/14c6ae4feb4859cfa7c5.js +0 -1
- package/assets/esri/core/workers/chunks/17776d9d3558d45ea7b5.js +0 -1
- package/assets/esri/core/workers/chunks/1cbd59918c60a1a21494.js +0 -1
- package/assets/esri/core/workers/chunks/20a2b3d1f826e9059884.js +0 -1
- package/assets/esri/core/workers/chunks/250b1629becca0410f2a.js +0 -1
- package/assets/esri/core/workers/chunks/2efa4d8fe5454f8b2a05.js +0 -1
- package/assets/esri/core/workers/chunks/3149a86cd25684dcb0b3.js +0 -1
- package/assets/esri/core/workers/chunks/3800764932a1c32cb29f.js +0 -1
- package/assets/esri/core/workers/chunks/38f84294fb2fb4663ba5.js +0 -1
- package/assets/esri/core/workers/chunks/3c57b2e13628b5c1f6de.js +0 -1
- package/assets/esri/core/workers/chunks/3eb3af0b6cf3c2f28131.js +0 -1
- package/assets/esri/core/workers/chunks/43bd338bb0de375b9bb7.js +0 -1
- package/assets/esri/core/workers/chunks/4622a3e64d3c4aafa56b.js +0 -1
- package/assets/esri/core/workers/chunks/47f2e905ef42e36897aa.js +0 -1
- package/assets/esri/core/workers/chunks/50e9eafb118d2a221f10.js +0 -1
- package/assets/esri/core/workers/chunks/55588e668b6acb6aa390.js +0 -1
- package/assets/esri/core/workers/chunks/5b112471dca94b2e8462.js +0 -1
- package/assets/esri/core/workers/chunks/5dfe1aed10095385c066.js +0 -1
- package/assets/esri/core/workers/chunks/5fc414fc2cfc68828c5b.js +0 -1
- package/assets/esri/core/workers/chunks/7389841fabe0f319f1e5.js +0 -1
- package/assets/esri/core/workers/chunks/772e81e9162e2240a7a6.js +0 -1
- package/assets/esri/core/workers/chunks/8c81156b1605a16acc29.js +0 -1
- package/assets/esri/core/workers/chunks/8e0559cc6295008fcdf7.js +0 -1
- package/assets/esri/core/workers/chunks/8f6ff09e7d2f01b79faf.js +0 -1
- package/assets/esri/core/workers/chunks/944fa8261aad94ae0542.js +0 -1
- package/assets/esri/core/workers/chunks/9639a6f6fab52a501bf7.js +0 -1
- package/assets/esri/core/workers/chunks/998c38974372720b1c52.js +0 -1
- package/assets/esri/core/workers/chunks/9e479e7e2e51476c3d27.js +0 -1
- package/assets/esri/core/workers/chunks/a1e179dd6de9c8769b02.js +0 -1
- package/assets/esri/core/workers/chunks/a6493607b98783bf1ef2.js +0 -1
- package/assets/esri/core/workers/chunks/a7530dcb08b43e37bbb2.js +0 -1
- package/assets/esri/core/workers/chunks/a829969ed44cdb814f27.js +0 -1
- package/assets/esri/core/workers/chunks/b2a035befeeff1a55ad8.js +0 -1
- package/assets/esri/core/workers/chunks/b4251e10621fb3ad03a3.js +0 -1
- package/assets/esri/core/workers/chunks/b9f5672093727c6f92c9.js +0 -1
- package/assets/esri/core/workers/chunks/ba45dccb4dab5a74d224.js +0 -1
- package/assets/esri/core/workers/chunks/c51e2a048df152abd901.js +0 -1
- package/assets/esri/core/workers/chunks/cda27c0fafd687dfa72e.js +0 -1
- package/assets/esri/core/workers/chunks/d1842745a7699879a1e1.js +0 -1
- package/assets/esri/core/workers/chunks/d578c3880eaf2dd62324.js +0 -1
- package/assets/esri/core/workers/chunks/ddd6597a66ec6b972f9c.js +0 -1
- package/assets/esri/core/workers/chunks/de499e33035b56b6697d.js +0 -1
- package/assets/esri/core/workers/chunks/e28d3ed65c3a76a044c8.js +0 -1
- package/assets/esri/core/workers/chunks/e3f68f7b408a08d7cd5d.js +0 -1
- package/assets/esri/core/workers/chunks/e9716995ce0c3683eafc.js +0 -1
- package/assets/esri/core/workers/chunks/ed25bf087f52e5d3e71b.js +0 -1
- package/assets/esri/core/workers/chunks/ee0286b5f5475f2d853f.js +0 -1
- package/assets/esri/core/workers/chunks/f8505bf69795f5293a79.js +0 -1
- package/assets/esri/core/workers/chunks/f92e608931b1c168cb45.js +0 -1
- package/views/3d/analysis/ElevationProfile/HoveredPointsVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/InputVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ProfileLinesVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/SceneLineComputation.js +0 -5
- package/views/3d/analysis/ElevationProfile/Visualization.js +0 -5
- package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +0 -5
- package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +0 -5
- package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +0 -5
- package/views/analysis/ElevationProfile/Controller.js +0 -5
- package/views/analysis/ElevationProfile/GroundLineComputation.js +0 -5
- package/views/analysis/ElevationProfile/InputLineComputation.js +0 -5
- package/views/analysis/ElevationProfile/LineComputation.js +0 -5
- package/views/analysis/ElevationProfile/QueryLineComputation.js +0 -5
- package/views/analysis/ElevationProfile/Result.d.ts +0 -4
- package/views/analysis/ElevationProfile/Result.js +0 -5
- package/views/analysis/ElevationProfile/geometryUtils.js +0 -5
- package/views/analysis/ElevationProfile/profileGenerationUtils.js +0 -5
- /package/assets/esri/core/workers/chunks/{c9c109d43a1e5160955d.js.LICENSE.txt → 3490d47cac7c8dec70cd.js.LICENSE.txt} +0 -0
- /package/views/analysis/ElevationProfile/{elevationQuerySourceUtils.js → elevationProfileQuerySourceUtils.js} +0 -0
- /package/views/analysis/ElevationProfile/{statisticsUtils.js → elevationProfileStatisticsUtils.js} +0 -0
- /package/views/analysis/ElevationProfile/{traversalUtils.js → elevationProfileTraversalUtils.js} +0 -0
- /package/views/analysis/ElevationProfile/{unitUtils.js → elevationProfileUnitUtils.js} +0 -0
- /package/views/analysis/ElevationProfile/{visualizationUtils.js → elevationProfileVisualizationUtils.js} +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t,createResolver as s}from"../../../../core/promiseUtils.js";import{UpdatingHandles as r}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import n from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as a}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{RenderState as o}from"./RenderState.js";import{renderHighlight as h}from"../support/util.js";class d{constructor(e,t){this.id=e,this.version=t,this._resolver=s(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class l extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new r,this._hitTestsRequests=[],this._store=new n,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){super.destroy(),this._renderState=e(this._renderState),this._renderStateNext=e(this._renderStateNext)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._layerView.requestUpdate(),this._renderState){const e=Array.from(this._renderState.tiles()).filter(e=>e.needsUpload);if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter(),this.requestRender())}const t=this._layerView.subscriptionManager.updateVisibility();this.setVisibleTiles(t);for(const s of this.children)s.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 16:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get
|
|
5
|
+
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t,createResolver as s}from"../../../../core/promiseUtils.js";import{UpdatingHandles as r}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import n from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as a}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{RenderState as o}from"./RenderState.js";import{renderHighlight as h}from"../support/util.js";class d{constructor(e,t){this.id=e,this.version=t,this._resolver=s(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class l extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new r,this._hitTestsRequests=[],this._store=new n,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){super.destroy(),this._renderState=e(this._renderState),this._renderStateNext=e(this._renderStateNext)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._layerView.requestUpdate(),this._renderState){const e=Array.from(this._renderState.tiles()).filter(e=>e.needsUpload);if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter(),this.requestRender())}const t=this._layerView.subscriptionManager.updateVisibility();this.setVisibleTiles(t);for(const s of this.children)s.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 16:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}get usedMemory(){let e=0;return this._renderState&&(e+=this._renderState.usedMemory),this._renderStateNext&&(e+=this._renderStateNext.usedMemory),e+=this.attributeView.usedMemory,e}get instanceStore(){return this._store}get layerView(){return this._layerView}get tiles(){return this._renderState?.tiles()}get _instanceStore(){return this._store}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&a.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(u(t))return t;return null}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&(this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter())}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe){if(!this._subscriptions.has(t)){const e=new d(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise);continue}this._subscriptions.get(t).version=s}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new o(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.layerView.view.labelManager.symbolFader,this,this.tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const r of t)s.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}lockForOverrides(){this._renderState?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState?.unlockUploads(),this._shouldUnlockAttributeView&&(this.attributeView.unlockTextureUploads(),this._shouldUnlockAttributeView=!1),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState?.flush(),this.requestRender()}trySwapRenderState(){if(this._renderStateNext){has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`);const e=new Map;for(const t of this._renderState?.tiles()||[])e.set(t.id,t.metricsVisibility);this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderState.flush();for(const t of this._renderState.tiles())t.copyMetricsVisibility(e.get(t.id)||new Set);this._renderStateNext=null}this.requestRender()}setVisibleTiles(e){this._visibleTiles=e;for(const t of this.tiles??[])t.rendering=e.has(t.key.id)}async onMessage(e,s){t(s);const r=e.inner;if(!this._subscriptions.has(r.id))return;const i=this._subscriptions.get(r.id);if(i.version!==r.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${r.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${r.id}] FeatureContainer - Dropping message, outdated version]`,r)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==r.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${r.version}]`),n.enqueueUpdate(e),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:t,y:s})=>t===e.x&&s===e.y);const r=s();return t?t.resolvers.push(r):(t={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(t)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((e,t)=>s.set(t,e)),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=a.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&h(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),i=t.getViewport(),n=e.passOptions,a=e.drawPhase;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),e.drawPhase=8;const{distance:o,smallSymbolDistance:h}=e.passOptions,d=Math.max(o,h);for(const l of this.children)l.visible&&l.containsScreenPoint(e.state,e.passOptions.position,2*d)&&this._renderTile(l,e,0);s.draw(e),s.unbind(),t.bindFramebuffer(r),t.restoreViewport(i),e.passOptions=n,e.drawPhase=a}_renderFeatures(e,t){const s=this._getHeatmapInstance(e);null!=s?this._renderHeatmapFeatures(e,t,s):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const s of this.children)s.visible&&this._renderTile(s,e,t)}_renderHeatmapFeatures(e,t,s){for(const r of this.children)r.visible&&this._renderTile(r,e,t,13);s.techniqueRef.renderResolvePass(e,s)}_renderTile(e,t,s,r){const i=has("featurelayer-strict-draw-order")?1:has("featurelayer-force-marker-text-draw-order")?2:0,n=e.getDisplayList(this._instanceStore,i);t.selection=s,n?.render(t,r)}}function u(e){return 13===e.techniqueRef.type}export{l as FeatureContainer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import{tileSize as p}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import l from"./Processor.js";import{FeatureSource as g}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";import b from"../../tiling/TileInfoView.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new b(i),this._source=new g(e.service,this._aggregateAdapter,this._subscriptions,s,this._cachedObjectIds),this._processor=new l(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),u(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),o(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new h(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),h=2*t,l=Math.ceil(p/h);for(const a of n){const t=a.tile,n=new Float64Array(l*l);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/h,i=u.readYForDisplay()/h,a=Math.floor(s),p=Math.floor(i);if(a<0||p<0||a>=l||p>=l)continue;const g=((.5+a-s)*h)**2+((.5+p-i)*h)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[p+a*l]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new _(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{schema:s,version:i}=e.inner;t=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const r=this._source.cleanup();this._processor.removeChunks(r);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e)}catch(o){has("esri-2d-update-debug")&&console.debug("InternalError",o)}await this._connection.container.unlockForOverrides(),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(o){i(o)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),null==e&&t&&await this._connection.container.trySwapRenderState(),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{y as default};
|
|
5
|
+
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import{tileSize as p}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import l from"./Processor.js";import{FeatureSource as g}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";import b from"../../tiling/TileInfoView.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new b(i),this._source=new g(e.service,this._aggregateAdapter,this._subscriptions,s,this._cachedObjectIds),this._processor=new l(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),u(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),o(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new h(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),h=2*t,l=Math.ceil(p/h);for(const a of n){const t=a.tile,n=new Float64Array(l*l);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/h,i=u.readYForDisplay()/h,a=Math.floor(s),p=Math.floor(i);if(a<0||p<0||a>=l||p>=l)continue;const g=((.5+a-s)*h)**2+((.5+p-i)*h)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[p+a*l]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new _(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{schema:s,version:i}=e.inner;t=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const r=this._source.cleanup();this._processor.removeChunks(r);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e)}catch(o){has("esri-2d-update-debug")&&console.debug("InternalError",o)}await this._connection.container.unlockForOverrides(),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(o){i(o)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),null==e&&t&&await this._connection.container.trySwapRenderState(),this._connection.onEvent({type:"performance",usedMemory:this.getUsedMemory()}),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import s from"../../../../core/CircularArray.js";import{EventEmitter as r}from"../../../../core/Evented.js";import
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import s from"../../../../core/CircularArray.js";import{EventEmitter as r}from"../../../../core/Evented.js";import i from"../../../../core/ReactiveMap.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";const n=10;let l=class extends e{constructor(){super(...arguments),this.events=new r,this._updatingStrategy=!0,this._tileToEvent=new i,this._fetchStatus={outstanding:0,done:0},this._pipelineStatistics={type:"performance",usedMemory:0}}get hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}get pipelineStatistics(){return this._pipelineStatistics}get willQueryAllFeatures(){return this._strategyInfo?.willQueryAllFeatures??!1}get willQueryFullResolutionGeometry(){return this._strategyInfo?.willQueryAllFeatures??!1}onEvent(t){switch(t.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(t);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=t.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",t);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),t.done&&(this._fetchStatus={done:0,outstanding:0});break;case"performance":this._pipelineStatistics=t}}_hasAllTileData(){for(const t of this._tileToEvent.values()){const e=t.peekLast();if("loaded"!==e?.type)return!1}return!0}_handleTileEvent(t){switch(t.type){case"subscribe":{const e=new s(n);e.enqueue(t),this._tileToEvent.set(t.tile,e);break}case"unsubscribe":this._tileToEvent.delete(t.tile);break;case"loaded":{const e=this._tileToEvent.get(t.tile);if(!e)return;e.enqueue(t),this._tileToEvent.set(t.tile,e);break}case"error":{const e=this._tileToEvent.get(t.tile);if(!e)return;e.enqueue(t),this._tileToEvent.set(t.tile,e),this.events.emit("error",t);break}}}};t([a({readOnly:!0})],l.prototype,"hasAllData",null),t([a()],l.prototype,"pipelineStatistics",null),t([a()],l.prototype,"willQueryAllFeatures",null),t([a()],l.prototype,"willQueryFullResolutionGeometry",null),t([a()],l.prototype,"_updatingStrategy",void 0),t([a()],l.prototype,"_strategyInfo",void 0),t([a()],l.prototype,"_tileToEvent",void 0),t([a()],l.prototype,"_pipelineStatistics",void 0),l=t([o("esri.views.2d.layers.features.FeatureSourceEventLog")],l);export{l as FeatureSourceEventLog};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{r as
|
|
5
|
+
import{estimateNumberMemory as s}from"../../../../core/memoryEstimations.js";import{r as t}from"../../../../chunks/rbush.js";import{create as e}from"../../../../geometry/support/aaBoundingBox.js";class n{static fromReader(s){const o=[],r=s.copy(),i=e();for(;r.next();){r.getBounds(i)&&o.push(r.getIndex())}const m=t(9,s=>(r.setIndex(s),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return m.load(o),new n(m,o.length)}constructor(s,t){this._index=s,this._size=t}get usedMemory(){return this._size*s}search(s){const t={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3]};return this._index.search(t)}}export{n as FeatureSpatialIndex};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/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{throwIfNotAbortError as s,throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import n from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as c}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as h}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as u}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry 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{throwIfNotAbortError as s,throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import n from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as c}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as h}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as u}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as g}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as p}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as y}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as d}from"./processor/BinningStrategy.js";import{ClusterStrategy as _}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as l}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as m}from"./processor/TrackStrategy.js";import{AttributeStore as f}from"./support/AttributeStore.js";import{ComputedAttributeStorage as b}from"./support/ComputedAttributeStorage.js";class w{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new g,this._proxy=new u({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t)}),this._attributeStore=new f({isLocal:!1,update:e=>o(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(){return this._strategy?.requiresInvalidation()??!1}async update(e,s,r,i,o){const c=e.processor,u=t(this._schema?.storage,c.storage),g=t(this._schema?.mesh.properties,c.mesh.properties),y=t(this._schema?.mesh.factory,c.mesh.factory),d=t(this._schema?.mesh.strategy,c.mesh.strategy),_=S(this._schema?.expressionProperties,c.expressionProperties),l=_.some(e=>this._attributeStore.hasArcadeDependency(e)),m=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&l,w=m||f,I=g||y||d;if(!(u||I||(m||l||f))&&!i)return!1;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a(this._schema,c),schema:c}),this._schema=c;const x=n.fromJSON(this._source.service.outSpatialReference),v=new b({fields:this._source.metadata.fieldsIndex,spatialReference:x}),M={currentUser:c.mesh.properties.currentUser};if((u||I||l)&&(await this._attributeStore.update(c.storage,v,this._source.metadata,s),this._strategy?.invalidateAttributeData(j(c))),!i&&!I&&!w)return!1;(d||g||w)&&await this._updateStrategy(c.mesh.strategy,x,o,j(c),M),this._updateSortKey(v,"sortKey"in c.mesh.properties?c.mesh.properties.sortKey:null);const k="dictionary"===c.mesh.factory.symbology.type?c.mesh.factory.symbology.fieldMap:null,U=new p(v,this._proxy,r,this._registry,k);return(y||"dictionary"===c.mesh.factory.symbology.type)&&(this._factory=await h.create(U,c.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e){if(!this._strategy)return;const t=this._strategy.applyOverrideUpdate(e);for await(const r of t)try{await this._process(r)}catch(s){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const a of e){let e=r.get(a.id);null==e&&(e=new y({concurrency:16,process:e=>this._process(e)}),r.set(a.id,e));const i=e.push(a).catch(e=>s(e));t.push(i)}try{await Promise.all(t)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r,i){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new l(this._source,this._attributeStore,r,i);break;case"binning":this._strategy=await d.create(e,t,this._source,this._attributeStore,r,i);break;case"cluster":this._strategy=await _.create(this._connection,e,t,this._source,this._attributeStore,r,i);break;case"track":this._strategy=await m.create(e,t,this._source,this._attributeStore,r,i)}for(const a of s)this._strategy.onSubscribe(a)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e){const t=e.subscription;if(has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process`)}const s={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(e,s),r(t.signal);const i=await this._write(e,t.tile.createArcadeEvaluationOptions(j(this._schema)),s),a=t.tile.tileInfoView.getLODInfoAt(t.tile.key);r(t.signal);const{message:o,transferList:n}=i.serialize(a),c={objectIdMap:null,inner:e.createMessage(o,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){c.objectIdMap={};const t=e.reader?.getCursor();if(t)for(;t.next();)c.objectIdMap[t.getDisplayId()]=t.getObjectId()}if(r(t.signal),await this._connection.container.onMessage(c,{signal:t.signal,transferList:n}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(j(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t);await this._proxy.fetchEnqueuedResources()}async _write(e,t,s){const a=e.subscription.tile,o=e.reader?.getCursor(),n=o?.getSize()??0,h=a.tileInfoView.tileInfo.isWrappable,u=a.tileInfoView.tileInfo.spatialReference.isWGS84,g=new c(a.key,this._strategy.enablePixelBuffering,h,u,n);if(!o)return g;const p=a.createArcadeEvaluationOptions(j(this._schema));let y=0;for(;o.next();){++y%1e3||(await i(0),r(e.subscription));const n=this._getSortKeyValue(o,t);g.entityStart(o.getDisplayId(),n),this._factory.write(g,this._proxy,o,p,s,a.level),g.entityEnd()}return g}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function S(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function j(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}export{w as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/CircularArray.js";import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{create as s}from"../../../../geometry/support/aaBoundingRect.js";import"../../tiling/TileInfoView.js";import
|
|
5
|
+
import e from"../../../../core/CircularArray.js";import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{create as s}from"../../../../geometry/support/aaBoundingRect.js";import"../../tiling/TileInfoView.js";import n from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{FeatureTile as r}from"../../engine/webgl/FeatureTile.js";const o=1e3;class d{constructor(t,i,s,n,r,d){this.getStage=t,this.getSubscriptionVersion=i,this.version=s,this._fader=n,this._container=r,this._tileInfoView=d,this._pendingUpdates=new e(o),this._locked=!1,this._tiles=new Map}destroy(){for(const e of this.tiles())this._fader.unregisterFeatureTile(e),e.destroy();this._pendingUpdates.clear(),this._tiles.clear(),this._container=null,this._fader=null}tiles(){return this._tiles.values()}size(){return this._tiles.size}get usedMemory(){let e=0;for(const t of this._tiles.values())e+=t.usedMemory;for(const t of this._pendingUpdates.entries)t&&(e+=l(t.inner));return e}getTile(e){return this._tiles.get(e)}setTiles(e){this._tiles.clear();for(const t of e)this._tiles.set(t.key.id,t)}lockUploads(){this._locked=!0}unlockUploads(){this._locked=!1,this.flush()}enqueueUpdate(e){this._pendingUpdates.enqueue(e)}update(e){if(!this._locked)for(;this._pendingUpdates.size;){const t=this._pendingUpdates.peek();if(null==t||t.inner.attributeEpoch>e)break;this._updateTile(t),this._pendingUpdates.dequeue()}}removeTile(e){const t=this._tiles.get(e);has("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t&&(this._fader.unregisterFeatureTile(t),t.destroy()),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&(t.isReady&&t.decluttered)}flush(){for(;this._pendingUpdates.size;){const e=this._pendingUpdates.dequeue();null!=e&&this._updateTile(e)}for(const e of this._tiles.values())e.upload()}_updateTile(e){const{inner:t,objectIdMap:i}=e,s=this.getSubscriptionVersion(t.id);if(s!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${s}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}if(has("esri-2d-update-debug")){const e=t.debugInfo?.chunkId??"<EnsureEnd>";console.debug(`Version[${t.version}] Tile[${t.id}] Chunk[${e}] RenderState.updateTile [${t.type}]`,t)}const n=this._ensureTile(t.id);if("update"===t.type){const[e,...s]=t.modify;n.onMessage({type:"update",modify:e,remove:t.remove,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const n of s){const e=this._tiles.get(n.tileId);e&&e.onMessage({type:"update",modify:n,remove:t.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}return}if(null==t.append)return void n.onMessage({type:"append",clear:t.clear,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});const[r,...o]=t.append;n.onMessage({type:"append",clear:t.clear,append:r,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const d of o){const e=this._tiles.get(d.tileId);e&&e.onMessage({type:"update",modify:d,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){has("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const o=new n(e),d=this._tileInfoView.getTileBounds(s(),o),l=d[0],a=d[3],u=this._tileInfoView.getTileResolution(o.level),p=this._container.instanceStore.find(14)?.instanceId,c=new r(o,u,l,a,this._fader,p,!0);if(this._fader.registerFeatureTile(c),c.stage=this.getStage(),!c.stage){const e=new t("featurelayerview:webgl","Cannot create tile with empty stage");i.getLogger("esri.views.2d.layers.features.RenderState").error(e)}return c}_copyPixelBufferedEntitiesInto(e){let t=7;const i=this._tileInfoView.getLODInfoAt(e.key);for(let s=-1;s<=1;s++)for(let n=-1;n<=1;n++){if(0===s&&0===n)continue;const r=e.key.getNormalizedNeighbor(n,s,i).id,o=this._tiles.get(r);if(null!=o){const i=1<<t;e.copyPixelBufferedEntitesFrom(o,i,n,s)}t--}}}function l(e){switch(e.type){case"update":return e.modify.reduce((e,t)=>e+a(t),0);case"append":return e.append?e.append.reduce((e,t)=>e+a(t),0):0}}function a(e){return e.entities.byteLength+e.data.reduce((e,t)=>e+u(t),0)}function u(e){return e.indices.byteLength+e.vertices.byteLength+(e.metrics?.byteLength??0)}export{d as RenderState};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{baseObjectMemory as t}from"../../../../../core/memoryEstimations.js";import{isBadArcadeResult as e}from"../../../arcade/callExpressionWithCursor.js";const s=Math.PI/180;class i{static create(t){return new i(t.map(t=>n(t)))}constructor(t){this._statistics=t}static get estimatedMemory(){return t+4*t}values(){return this._statistics.values()}insert(t,e){for(const s of this._statistics)s.insert(t,e)}merge(t){for(let e=0;e<this._statistics.length;e++){const s=this._statistics[e],i=t._statistics[e];if(s.field.name!==i.field.name)throw new Error("InternalError: Tried to merge incompatible statistics");s.merge(i)}}clone(){return new i(this._statistics.map(t=>t.clone()))}}function n(t){switch(t.statisticType){case"min":return new u(t);case"max":return new a(t);case"avg":return new o(t);case"avg_angle":return new h(t);case"sum":case"count":return new c(t);case"mode":return new l(t)}}class r{constructor(t){this.field=t}insert(t,s){if(!this.field.computed)return;const i=this.field.computed.read(t,s);e(i)||this._insertValue(i)}}class u extends r{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(t){this.value=Math.min(this.value,t)}merge(t){this.value=Math.min(this.value,t.value)}clone(){const t=new u(this.field);return t.value=this.value,t}}class a extends r{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(t){this.value=Math.max(this.value,t)}merge(t){this.value=Math.max(this.value,t.value)}clone(){const t=new a(this.field);return t.value=this.value,t}}class c extends r{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(t){this.value+=t}merge(t){this.value+=t.value}clone(){const t=new c(this.field);return t.value=this.value,t}}class o extends r{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(t){this._total+=t,this._count+=1}merge(t){this._total+=t._total,this._count+=t._count}clone(){const t=new o(this.field);return t._total=this._total,t._count=this._count,t}}class h extends r{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const t=this._x/this._count,e=this._y/this._count,s=180/Math.PI;return Math.atan2(e,t)*s}_insertValue(t){this._x=this._x+Math.cos(t*s),this._y=this._y+Math.sin(t*s),this._count+=1}merge(t){this._x+=t._x,this._y+=t._y,this._count+=t._count}clone(){const t=new h(this.field);return t._x=this._x,t._y=this._y,t._count=this._count,t}}class l extends r{constructor(){super(...arguments),this._frequencies=new Map}get value(){let t,e=0;for(const[s,i]of this._frequencies.entries())i>e&&(e=i,t=s);return t}_insertValue(t){const e=this._frequencies.get(t);null!=e?this._frequencies.set(t,e+1):this._frequencies.set(t,1)}merge(t){for(const[e,s]of t._frequencies.entries()){const t=this._frequencies.get(e);null!=t?this._frequencies.set(e,t+s):this._frequencies.set(e,s)}}clone(){const t=new l(this.field);return t._frequencies=new Map(this._frequencies),t}}export{i as AccumulatedStatistics};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeohashTree as e}from"../../../../../geohash/GeohashTree.js";import{getGeohashBounds as t,getGeohash as s}from"../../../../../geohash/geohashUtils.js";import{AAggregateSpatialIndex as o}from"./AAggregateSpatialIndex.js";class r extends o{constructor(t){super(t),this._tree=new e(this._options.fields)}put(e){throw new Error("Geohash tree does not support put")}putBounded(e,s,o){const{geohashLevel:r,spatialReference:h}=this._options,i=t(s,o,r,h);null!=i&&this._tree.putBins(e,i)}_insert(e,t,o,r){const{geohashLevel:h,spatialReference:i}=this._options,n=s(t,o,h,i);n&&this._tree.insert(e,t,o,n[0],n[1],h,r)}}export{r as GeohashSpatialIndex};
|
|
5
|
+
import{GeohashTree as e}from"../../../../../geohash/GeohashTree.js";import{getGeohashBounds as t,getGeohash as s}from"../../../../../geohash/geohashUtils.js";import{AAggregateSpatialIndex as o}from"./AAggregateSpatialIndex.js";class r extends o{constructor(t){super(t),this._tree=new e(this._options.fields)}get usedMemory(){return this._tree.usedMemory}put(e){throw new Error("Geohash tree does not support put")}putBounded(e,s,o){const{geohashLevel:r,spatialReference:h}=this._options,i=t(s,o,r,h);null!=i&&this._tree.putBins(e,i)}_insert(e,t,o,r){const{geohashLevel:h,spatialReference:i}=this._options,n=s(t,o,h,i);n&&this._tree.insert(e,t,o,n[0],n[1],h,r)}}export{r as GeohashSpatialIndex};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/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}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]);if(null!=e){const t=new i;return r(t,l,!1,!1,"esriGeometryPolygon",e)}return l}getCentroid(t){const e=new i([],[this.centroidXWorld,this.centroidYWorld]);if(null!=t){const s=new i;return r(s,e,!1,!1,"esriGeometryPoint",t)}return 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]);if(null!=e){const t=new i;return r(t,l,!1,!1,"esriGeometryPoint",e)}return 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};
|
|
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]);if(null!=e){const t=new i;return r(t,l,!1,!1,"esriGeometryPolygon",e)}return l}getCentroid(t){const e=new i([],[this.centroidXWorld,this.centroidYWorld]);if(null!=t){const s=new i;return r(s,e,!1,!1,"esriGeometryPoint",t)}return 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]);if(null!=e){const t=new i;return r(t,l,!1,!1,"esriGeometryPoint",e)}return 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/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getMetersPerUnitForSR as t,inchesPerMeter as
|
|
5
|
+
import{estimateNumberMemory as e}from"../../../../../core/memoryEstimations.js";import{getMetersPerUnitForSR as t,inchesPerMeter as i}from"../../../../../core/unitUtils.js";import{AAggregateSpatialIndex as s}from"./AAggregateSpatialIndex.js";import{GridCell as l}from"./GridCell.js";const o=96;function r(e,s){return t(e)*i*o/s}class n extends s{constructor(e){super(e),this._cells=new Map,this._pixelsPerMapUnit=r(e.spatialReference,e.scale)}get usedMemory(){const t=this._cells.values().next().value;return t?(e+t.usedMemory)*this._cells.size:0}put(e){for(const t of this._cells.values()){const i=e.get(t.id);i?i.merge(t):e.set(t.id,t.clone())}}putBounded(e,t,i){const s=[t.xmin,t.ymin,t.xmax,t.ymax],[l,o,r,n]=s,c=Math.floor(l*this._pixelsPerMapUnit/this._options.cellSize),p=Math.floor(o*this._pixelsPerMapUnit/this._options.cellSize),a=Math.ceil(r*this._pixelsPerMapUnit/this._options.cellSize),h=Math.ceil(n*this._pixelsPerMapUnit/this._options.cellSize);for(let _=p;_<=h;_++)for(let t=c;t<=a;t++){const i=`${t}.${_}`,s=this._cells.get(i);if(!s)continue;const l=e.get(s.id);l?s&&!e.has(s.id)&&l.merge(s):e.set(s.id,s.clone())}}_insert(e,t,i,s){const l=t*this._pixelsPerMapUnit,o=i*this._pixelsPerMapUnit,r=Math.floor(l/this._options.cellSize),n=Math.floor(o/this._options.cellSize);this._getCellOrCreate(r,n).insert(e,s,t,i)}_getCellOrCreate(e,t){const i=l.createId(e,t);let s=this._cells.get(i);if(!s){const o=1*this._options.cellSize/this._pixelsPerMapUnit;s=l.create(e,t,this._options.fields,o),this._cells.set(i,s)}return s}}export{n as GridSpatialIndex,r as pixelsPerMapUnit};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class t{constructor(t){this.subscription=t,this.handledChunks=new Set}destroy(){}}class e{constructor(t,e,s){this._source=t,this._attributeStore=e,this._sqlOptions=s,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}get isAggregate(){return!1}onSubscribe(t){const e=this.createState(t);this._sendStates.set(t.key.id,e),this.updateChunks()}onUnsubscribe(t){this._sendStates.get(t.key.id)?.destroy(),this._sendStates.delete(t.key.id)}get hasSubscribers(){return this._sendStates.size>0}requiresInvalidation(){return!1}invalidate(){const t=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of t)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(t){}hasArcadeDependency(t){return!1}getFeatureObjectIdsForAggregate(t){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(t){return this.displayMap(t,t=>t,t=>t)}getDisplayAndObjectIds(t){return this.displayMap(t,t=>t,(t,e,s)=>[t,s])}afterUpdateChunks(){}}export{e as AProcessorStrategy,t as ASendState};
|
|
5
|
+
class t{constructor(t){this.subscription=t,this.handledChunks=new Set}destroy(){}}class e{constructor(t,e,s){this._source=t,this._attributeStore=e,this._sqlOptions=s,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}get isAggregate(){return!1}get usedMemory(){return 0}onSubscribe(t){const e=this.createState(t);this._sendStates.set(t.key.id,e),this.updateChunks()}onUnsubscribe(t){this._sendStates.get(t.key.id)?.destroy(),this._sendStates.delete(t.key.id)}get hasSubscribers(){return this._sendStates.size>0}requiresInvalidation(){return!1}invalidate(){const t=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of t)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(t){}hasArcadeDependency(t){return!1}getFeatureObjectIdsForAggregate(t){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(t){return this.displayMap(t,t=>t,t=>t)}getDisplayAndObjectIds(t){return this.displayMap(t,t=>t,(t,e,s)=>[t,s])}afterUpdateChunks(){}}export{e as AProcessorStrategy,t as ASendState};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{numericHash as e}from"../../../../../../core/string.js";import{validateLabelingInfo as
|
|
5
|
+
import{numericHash as e}from"../../../../../../core/string.js";import{validateLabelingInfo as l}from"../../../../../../layers/support/labelingInfo.js";import{getServiceGeometryType as s}from"../../layerAdapters/geometryUtils.js";import{createSymbolMeshSchemas as a}from"./symbols/SymbolSchema.js";async function o(e,a,o){const r=a.labelsVisible&&a.labelingInfo||[],i=s(a),t=l(r,i);return{type:"label",classes:await Promise.all(t.map((l,s)=>n(e,l,a.labelsVisible,a.labelingInfoSource,s,i,o)))}}async function n(l,s,o,n,r,i,t){const m=e(`${n} ${r}`),c=n,p=await a(s,{schemaOptions:l,uniforms:t,layerId:c,labelClassId:m});return{maxScale:s.maxScale,minScale:s.minScale,deconflictionEnabled:"none"!==s.deconflictionStrategy&&o,expression:s.labelExpressionInfo?.expression??s.labelExpression,where:s.where,meshes:p,layerId:c,labelClassId:m,geometryType:i}}export{o as createLabelMatcherSchema};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{CIMSymbolHelper as e}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as a}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as i}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{getMaxSizeVVSize as l,noVisualVariables as t}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as n,hasSizeVVUniform as o}from"./utils.js";function r(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function s(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,l,t]=e;return[a,i,l,255*t]}return"string"==typeof e?e:{...e,defaultValue:s(e?.defaultValue)}}async function c(a,i){const{cimResourceManager:l,cimAnalyzer:t,scaleExpression:n}=i.schemaOptions;await Promise.all(e.fetchResources(a.symbol,l,[]));const o=t.analyzeSymbolReference(a,!1),s={scaleInfo:r(a),scaleExpression:n},c=[];for(const e of o)switch(e.type){case"marker":c.push(...u(e,i,s));break;case"fill":c.push(...h(e,i,s));break;case"outlineFill":c.push(...b(e,i,s));break;case"gradientFill":c.push(...d(e,i,s));break;case"line":c.push(...g(e,i,s));break;case"gradientStroke":c.push(...R(e,i,s));break;case"text":c.push(...C(e,i,s))}return c}function u(e,a,l){const{uniforms:n,schemaOptions:o}=a,{store:r}=o,s=e.isOutline?{...t,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue,visualVariableRotation:n.visualVariableRotation};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=a?i.animatedMarkerShift:i.animatedMarker;return f(r.ensureInstance(n,{uniforms:s,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:a}}),e,t,l)}return p(r.ensureInstance(i.marker,{uniforms:s,optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,n,l)}function f(e,a,i,l){if(!a.animationParams)return[];return[e.createMeshInfo({pixelDimensions:a.pixelDimensions,texelDimensions:a.texelDimensions,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:n(a),animations:a.animationParams,scaleInfo:l.scaleInfo,scaleSymbolsProportionally:a.scaleSymbolsProportionally,strokeWidth:a.outlineWidth,isMapAligned:1===a.alignment,colorLocked:a.colorLocked,isStroke:a.isStroke,baseSize:a.baseSize,placement:a.markerPlacement,referenceSize:a.referenceSize,angleToLine:!!a.markerPlacement&&(a.markerPlacement.placement&&"angleToLine"in a.markerPlacement.placement&&a.markerPlacement.placement.angleToLine),sizeRatio:a.sizeRatio,patternHeight:null})]}function m(e,a,i,l){if(!a.animationParams)return[];return[e.createMeshInfo({effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:n(a),animations:a.animationParams,scaleInfo:l.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:a.colorLocked||!1,isStroke:!1,baseSize:"width"in a?a.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:"fill"===a.type&&a.spriteRasterizationParam?a.height:null,joinType:"join"in a?a.join:"round",capType:"cap"in a?a.cap:"round",miterLimit:"miterLimit"in a&&a.miterLimit||2})]}function p(e,i,t,{scaleInfo:n,scaleExpression:r}){const c=o(t);return[e.createMeshInfo({size:i.size,scaleX:i.scaleX,anchorX:i.anchorPoint.x,anchorY:i.anchorPoint.y,angle:i.rotation,color:s(i.color)??[0,0,0,0],colorLocked:i.colorLocked,frameHeight:i.frameHeight,widthRatio:i.widthRatio,scaleInfo:n,offsetX:i.offsetX,offsetY:i.offsetY,outlineColor:s(i.outlineColor)??[0,0,0,0],outlineSize:i.outlineWidth,referenceSize:i.referenceSize||a.CIMVectorMarker.size,rotateClockwise:i.rotateClockwise,scaleFactor:r??1,sizeRatio:i.sizeRatio,alignment:i.alignment,isAbsoluteAnchorPoint:i.isAbsoluteAnchorPoint,scaleSymbolsProportionally:i.scaleSymbolsProportionally,sprite:i.spriteRasterizationParam,hasSizeVV:c,placement:i.markerPlacement,effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null,transforms:i.transform,minPixelBuffer:l(t)})]}function S(e,a,l){const{uniforms:n,schemaOptions:o}=a,{store:r}=o,s={visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity};if(e.animationParams){const a=i.animatedFill;return m(r.ensureInstance(a,{uniforms:{...s,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}}),e,t,l)}return z(r.ensureInstance(i.fill,{uniforms:s,optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,l)}function b(e,a,l){const{uniforms:t,schemaOptions:n}=a,{store:o}=n;return V(o.ensureInstance(i.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,l)}function V(e,a,i){const l=s(a.color)??[0,0,0,0],t=s(a.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:l,outlineColor:t,width:a.outlineWidth,referenceWidth:a.referenceWidth,capType:a.cap,joinType:a.join,miterLimit:a.miterLimit,outlineUsesColorVV:!a.outlineColorLocked,hasSizeVV:!1,scaleInfo:i.scaleInfo,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,outlineEffects:a.outlineEffects?{type:"cim-effect-infos",effectInfos:a.outlineEffects}:null})]}function z(e,a,{scaleInfo:i}){return[e.createMeshInfo({color:s(a.color)??[0,0,0,0],scaleInfo:i,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function h(e,a,l){if(!e.spriteRasterizationParam)return S(e,a,l);const{uniforms:n,schemaOptions:o}=a,{store:r}=o,s={visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity};if(e.animationParams){const a=i.animatedFill;return m(r.ensureInstance(a,{uniforms:{...s,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}}),e,t,l)}return v(r.ensureInstance(i.complexFill,{uniforms:s,optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,null!=n.visualVariableColor,l)}function v(e,a,i,{scaleInfo:l}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const t=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),n=a.sampleAlphaOnly&&!t,o=a.spriteRasterizationParam;return[e.createMeshInfo({color:s(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:n,scaleProportionally:"CIMHatchFill"===o.resource.type,sprite:o,scaleInfo:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function d(e,a,l){const{uniforms:t,schemaOptions:n}=a,{store:o}=n;return y(o.ensureInstance(i.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:t.visualVariableOpacity},optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,l)}function y(e,a,{scaleInfo:i}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=a.spriteRasterizationParam;return[e.createMeshInfo({color:s(a.color)??[0,0,0,0],angle:a.angle,gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:l,scaleInfo:i,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function g(e,a,l){const{uniforms:n,schemaOptions:o}=a,{store:r}=o,s=e.isOutline?{...t,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=i.animatedLine;return m(r.ensureInstance(n,{uniforms:{...s,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:a}}),e,t,l)}const c={uniforms:s,optionalAttributes:{zoomRange:!!l.scaleInfo}},u=!!(s.visualVariableSizeMinMaxValue||s.visualVariableSizeScaleStops||s.visualVariableSizeStops||s.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return M(r.ensureInstance(i.line,c),e,u,l)}return P(r.ensureInstance(i.texturedLine,c),e,u,l)}function I(e,a,{scaleInfo:i}){return{color:s(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:a,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function M(e,a,i,l){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const t=I(a,i,l);return[e.createMeshInfo(t)]}function P(e,a,i,l){const{spriteRasterizationParam:t,scaleDash:n,sampleAlphaOnly:o}=a;if(!t)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...I(a,i,l),offsetAlongLine:a.offsetAlongLine??0,shouldScaleDash:n??!1,shouldSampleAlphaOnly:o,isSDF:"CIMPictureStroke"!==t.resource.type&&"CIMGradientStroke"!==t.resource.type,sprite:t})]}function R(e,a,l){const{uniforms:n,schemaOptions:o}=a,{store:r}=o;return k(r.ensureInstance(i.gradientStroke,{uniforms:e.isOutline?{...t,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,l)}function k(e,a,i){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=a.spriteRasterizationParam;return[e.createMeshInfo({...I(a,!1,i),gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function C(e,a,l){const{uniforms:t,schemaOptions:n}=a,{store:o}=n;return L(o.ensureInstance(i.text,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!l.scaleInfo,referenceSymbol:!1,clipAngle:!1,visibility:!1}}),e,t,l)}function L(e,a,i,{scaleInfo:t,scaleExpression:n}){return[e.createMeshInfo({boxBackgroundColor:s(a.backgroundColor),boxBorderLineColor:s(a.borderLineColor),boxBorderLineSize:a.borderLineWidth??0,color:s(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:s(a.haloColor)??[0,0,0,0],haloSize:a.haloSize??0,outlineColor:s(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:t,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:n??1,minPixelBuffer:l(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,labelClassId:-1})]}export{f as createAnimatedMarkerMeshInfos,m as createAnimatedPolyMeshInfos,v as createComplexFillMeshInfos,p as createComplexMarkerMeshInfos,z as createComplexSimpleFillMeshInfos,M as createComplexSimpleLineMeshInfos,V as createComplexSimpleOutlineFillMeshInfos,c as createComplexSymbolInstances,L as createComplexTextMeshInfos,P as createComplexTexturedLineMeshInfos,y as createGradientFillMeshInfos,k as createGradientStrokeMeshInfos,r as getScaleInfo};
|
|
5
|
+
import{CIMSymbolHelper as e}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as a}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as i}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{getMaxSizeVVSize as l,noVisualVariables as t}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as n,hasSizeVVUniform as o}from"./utils.js";function r(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function s(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,l,t]=e;return[a,i,l,255*t]}return"string"==typeof e?e:{...e,defaultValue:s(e?.defaultValue)}}async function c(a,i){const{cimResourceManager:l,cimAnalyzer:t,scaleExpression:n}=i.schemaOptions;await Promise.all(e.fetchResources(a.symbol,l,[]));const o=t.analyzeSymbolReference(a,!1),s={scaleInfo:r(a),scaleExpression:n},c=[];for(const e of o)switch(e.type){case"marker":c.push(...u(e,i,s));break;case"fill":c.push(...h(e,i,s));break;case"outlineFill":c.push(...b(e,i,s));break;case"gradientFill":c.push(...v(e,i,s));break;case"line":c.push(...g(e,i,s));break;case"gradientStroke":c.push(...R(e,i,s));break;case"text":c.push(...C(e,i,s))}return c}function u(e,a,l){const{uniforms:n,schemaOptions:o}=a,{store:r}=o,s=e.isOutline?{...t,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue,visualVariableRotation:n.visualVariableRotation};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=a?i.animatedMarkerShift:i.animatedMarker;return f(r.ensureInstance(n,{uniforms:s,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:a}}),e,t,l)}return p(r.ensureInstance(i.marker,{uniforms:s,optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,n,l)}function f(e,a,i,l){if(!a.animationParams)return[];return[e.createMeshInfo({pixelDimensions:a.pixelDimensions,texelDimensions:a.texelDimensions,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:n(a),animations:a.animationParams,scaleInfo:l.scaleInfo,scaleSymbolsProportionally:a.scaleSymbolsProportionally,strokeWidth:a.outlineWidth,isMapAligned:1===a.alignment,colorLocked:a.colorLocked,isStroke:a.isStroke,baseSize:a.baseSize,placement:a.markerPlacement,referenceSize:a.referenceSize,angleToLine:!!a.markerPlacement&&(a.markerPlacement.placement&&"angleToLine"in a.markerPlacement.placement&&a.markerPlacement.placement.angleToLine),sizeRatio:a.sizeRatio,patternHeight:null})]}function m(e,a,i,l){if(!a.animationParams)return[];return[e.createMeshInfo({effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:n(a),animations:a.animationParams,scaleInfo:l.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:a.colorLocked||!1,isStroke:!1,baseSize:"width"in a?a.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:"fill"===a.type&&a.spriteRasterizationParam?a.height:null,joinType:"join"in a?a.join:"round",capType:"cap"in a?a.cap:"round",miterLimit:"miterLimit"in a&&a.miterLimit||2})]}function p(e,i,t,{scaleInfo:n,scaleExpression:r}){const c=o(t);return[e.createMeshInfo({size:i.size,scaleX:i.scaleX,anchorX:i.anchorPoint.x,anchorY:i.anchorPoint.y,angle:i.rotation,color:s(i.color)??[0,0,0,0],colorLocked:i.colorLocked,frameHeight:i.frameHeight,widthRatio:i.widthRatio,scaleInfo:n,offsetX:i.offsetX,offsetY:i.offsetY,outlineColor:s(i.outlineColor)??[0,0,0,0],outlineSize:i.outlineWidth,referenceSize:i.referenceSize||a.CIMVectorMarker.size,rotateClockwise:i.rotateClockwise,scaleFactor:r??1,sizeRatio:i.sizeRatio,alignment:i.alignment,isAbsoluteAnchorPoint:i.isAbsoluteAnchorPoint,scaleSymbolsProportionally:i.scaleSymbolsProportionally,sprite:i.spriteRasterizationParam,hasSizeVV:c,placement:i.markerPlacement,effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null,transforms:i.transform,minPixelBuffer:l(t)})]}function S(e,a,l){const{uniforms:n,schemaOptions:o}=a,{store:r}=o,s={visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity};if(e.animationParams){const a=i.animatedFill;return m(r.ensureInstance(a,{uniforms:{...s,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}}),e,t,l)}return z(r.ensureInstance(i.fill,{uniforms:s,optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,l)}function b(e,a,l){const{uniforms:t,schemaOptions:n}=a,{store:o}=n;return V(o.ensureInstance(i.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,l)}function V(e,a,i){const l=s(a.color)??[0,0,0,0],t=s(a.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:l,outlineColor:t,width:a.outlineWidth,referenceWidth:a.referenceWidth,capType:a.cap,joinType:a.join,miterLimit:a.miterLimit,outlineUsesColorVV:!a.outlineColorLocked,hasSizeVV:!1,scaleInfo:i.scaleInfo,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,outlineEffects:a.outlineEffects?{type:"cim-effect-infos",effectInfos:a.outlineEffects}:null})]}function z(e,a,{scaleInfo:i}){return[e.createMeshInfo({color:s(a.color)??[0,0,0,0],scaleInfo:i,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function h(e,a,l){if(!e.spriteRasterizationParam)return S(e,a,l);const{uniforms:n,schemaOptions:o}=a,{store:r}=o,s={visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity};if(e.animationParams){const a=i.animatedFill;return m(r.ensureInstance(a,{uniforms:{...s,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}}),e,t,l)}return d(r.ensureInstance(i.complexFill,{uniforms:s,optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,null!=n.visualVariableColor,l)}function d(e,a,i,{scaleInfo:l}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const t=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),n=a.sampleAlphaOnly&&!t,o=a.spriteRasterizationParam;return[e.createMeshInfo({color:s(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:n,scaleProportionally:"CIMHatchFill"===o.resource.type,sprite:o,scaleInfo:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function v(e,a,l){const{uniforms:t,schemaOptions:n}=a,{store:o}=n;return y(o.ensureInstance(i.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:t.visualVariableOpacity},optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,l)}function y(e,a,{scaleInfo:i}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=a.spriteRasterizationParam;return[e.createMeshInfo({color:s(a.color)??[0,0,0,0],angle:a.angle,gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:l,scaleInfo:i,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function g(e,a,l){const{uniforms:n,schemaOptions:o}=a,{store:r}=o,s=e.isOutline?{...t,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=i.animatedLine;return m(r.ensureInstance(n,{uniforms:{...s,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:a}}),e,t,l)}const c={uniforms:s,optionalAttributes:{zoomRange:!!l.scaleInfo}},u=!!(s.visualVariableSizeMinMaxValue||s.visualVariableSizeScaleStops||s.visualVariableSizeStops||s.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return M(r.ensureInstance(i.line,c),e,u,l)}return P(r.ensureInstance(i.texturedLine,c),e,u,l)}function I(e,a,{scaleInfo:i}){return{color:s(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:a,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function M(e,a,i,l){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const t=I(a,i,l);return[e.createMeshInfo(t)]}function P(e,a,i,l){const{spriteRasterizationParam:t,scaleDash:n,sampleAlphaOnly:o}=a;if(!t)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...I(a,i,l),offsetAlongLine:a.offsetAlongLine??0,shouldScaleDash:n??!1,shouldSampleAlphaOnly:o,isSDF:"CIMPictureStroke"!==t.resource.type&&"CIMGradientStroke"!==t.resource.type,sprite:t})]}function R(e,a,l){const{uniforms:n,schemaOptions:o}=a,{store:r}=o;return k(r.ensureInstance(i.gradientStroke,{uniforms:e.isOutline?{...t,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!l.scaleInfo}}),e,l)}function k(e,a,i){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=a.spriteRasterizationParam;return[e.createMeshInfo({...I(a,!1,i),gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function C(e,a,l){const{uniforms:t,schemaOptions:n}=a,{store:o}=n;return L(o.ensureInstance(i.text,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!l.scaleInfo,referenceSymbol:!1,clipAngle:!1,visibility:!1}}),e,t,l)}function L(e,a,i,{scaleInfo:t,scaleExpression:n}){return[e.createMeshInfo({boxBackgroundColor:s(a.backgroundColor),boxBorderLineColor:s(a.borderLineColor),boxBorderLineSize:a.borderLineWidth??0,color:s(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:s(a.haloColor)??[0,0,0,0],haloSize:a.haloSize??0,outlineColor:s(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:t,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:n??1,minPixelBuffer:l(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{f as createAnimatedMarkerMeshInfos,m as createAnimatedPolyMeshInfos,d as createComplexFillMeshInfos,p as createComplexMarkerMeshInfos,z as createComplexSimpleFillMeshInfos,M as createComplexSimpleLineMeshInfos,V as createComplexSimpleOutlineFillMeshInfos,c as createComplexSymbolInstances,L as createComplexTextMeshInfos,P as createComplexTexturedLineMeshInfos,y as createGradientFillMeshInfos,k as createGradientStrokeMeshInfos,r as getScaleInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../../../core/Logger.js";import{pt2px as i}from"../../../../../../../core/screenUtils.js";import{generateGradient as a}from"../../../../../../../renderers/support/heatmapUtils.js";import l from"../../../../../../../symbols/SimpleFillSymbol.js";import r from"../../../../../../../symbols/SimpleLineSymbol.js";import t from"../../../../../../../symbols/SimpleMarkerSymbol.js";import{CIMSymbolHelper as o,slsDashToTemplateArray as s}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{getSDFInfo as n}from"../../../../../../../symbols/cim/SDFHelper.js";import{getAlignmentFromPlacement as u}from"../../../../../engine/webgl/alignmentUtils.js";import{writeColor as c}from"../../../../../engine/webgl/color.js";import{dotDensityMaxFields as p}from"../../../../../engine/webgl/definitions.js";import{Techniques as f}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{premultiplyColor as b}from"../schemaUtils.js";import{createVisualVariableUniforms as m,getMaxSizeVVSize as S,noVisualVariables as V}from"../VisualVariablesSchema.js";import{createComplexSymbolInstances as y}from"./ComplexSymbolSchema.js";import{hasSizeVVUniform as v,hasRotationVVUniform as h}from"./utils.js";async function z(i,a){if(!i)return[];switch(i.type){case"simple-fill":return U(i,a);case"picture-fill":return j(i,a);case"simple-marker":return C(i,a);case"picture-marker":return I(i,a);case"simple-line":return F(i,a,!1);case"text":return O(i,a);case"label":return A(i,a);case"cim":return y(i.data,a);case"web-style":return z(await i.fetchSymbol({acceptedFormats:["cim","web"]}),a);case"line-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-line`),F(new r,a,!1);case"point-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-marker`),C(new t,a);case"polygon-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-fill`),U(new l,a);case"mesh-3d":case"label-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function d(e,i){const{schemaOptions:a}=i,{store:r}=a,t=new Array(p),o=new Array(p/4);for(let l=0;l<p;l++){const i=l<e.attributes.length?e.attributes[l].color:null;t[l]=[0,0,0,0],c(t[l],i)}for(let l=0;l<p/4;l++)o[l]=[0,0,0,0],o[l][0]=4*l<e.attributes.length?1:0,o[l][1]=4*l+1<e.attributes.length?1:0,o[l][2]=4*l+2<e.attributes.length?1:0,o[l][3]=4*l+3<e.attributes.length?1:0;const s={uniforms:{isActive:o,colors:t,dotValue:e.dotValue,dotScale:e.referenceScale,blending:e.dotBlendingEnabled,dotSize:e.dotSize,seed:e.seed},optionalAttributes:{}},n=r.ensureInstance(f.dotDensity,s).createMeshInfo({effects:null}),u=[],b=new l({color:e.backgroundColor??[0,0,0,0],outline:null}),m=await z(b,i);if(u.push(...m),u.push(n),e.outline){const a=F(e.outline,i,!0);u.push(...a)}return u}async function g(e,l){const{store:r}=l,{radius:t,minDensity:o,maxDensity:s,referenceScale:n,field:u,valueExpression:c,colorStops:p}=e,b=a(p);return[r.ensureInstance(f.heatmap,{uniforms:{radius:i(t),minDensity:o,maxDensity:s,referenceScale:n,isFieldActive:!(!u&&!c),gradient:b,gradientHash:b.join(",")},optionalAttributes:{}}).createMeshInfo({effects:null})]}async function M(e,a){const{store:l}=a,r=e.outline?.width||0,t=m(e),o=l.ensureInstance(f.pieChart,{uniforms:{shader:{outlineWidth:Math.round(i(r)),defaultColor:b(e.defaultColor),outlineColor:b(e.outline?.color),othersColor:b(e.othersCategory?.color),donutRatio:e.holePercentage,sectorThreshold:e.othersCategory?.threshold||0,colors:e.attributes.map(e=>b(e.color)),visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,hittestUniforms:null,highlightUniforms:null},numberOfFields:e.attributes.length},optionalAttributes:{}}).createMeshInfo({size:e.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:S(t)});return[...e.backgroundFillSymbol?await U(e.backgroundFillSymbol,{schemaOptions:a,uniforms:V}):[],o]}function x(e){if("path"===e.style){if(null==e.path)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const i=o.fromSimpleMarker(e);if("outline"in e&&e.outline&&"none"!==e.outline.style){if("solid"!==e.outline.style){if(!i||!i.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:i.symbolLayers[0],overrides:[]}}}return{type:"sprite-rasterization-param",resource:n(i),overrides:[]}}async function C(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l;if("path"===e.style||e.outline&&"solid"!==e.outline.style&&"none"!==e.outline.style){const l=o.fromSimpleMarker(e);if(!l||!l.symbolLayers)throw new Error("Error handling marker! ");if(a.visualVariableRotation&&(l.angleAlignment="Map"),"path"!==e.style){const e=l.symbolLayers[0];if(v(i.uniforms)){const a=S(i.uniforms,0,1);if(a>e.size){const i=a/e.size;e.size=a;const l=e.markerGraphics?.[0].symbol;(l.symbolLayers&&l.symbolLayers[0]).width*=i}}}return y({type:"CIMSymbolReference",symbol:l},i)}const t=r.ensureInstance(f.marker,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue,visualVariableRotation:a.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=x(e);let n=e.color?.toArray()??[0,0,0,0];"CIMVectorMarker"===s.resource.type&&(n=[255,255,255,255]);const u="triangle"===e.style?124/116:1,c=e.size,p=c*u,b=null!=a.visualVariableColor&&("cross"===e.style||"x"===e.style);return[t.createMeshInfo({type:"simple",color:n,height:c,width:p,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:h(a)?1:0,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:c,sprite:s,overrideOutlineColor:b,hasSizeVV:v(a),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:S(a)})]}function I(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=r.ensureInstance(f.marker,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue,visualVariableRotation:a.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=o.createPictureMarkerRasterizationParam(e);if(!s)return[];return[t.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:h(a)?1:0,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:s,overrideOutlineColor:!1,hasSizeVV:v(a),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:S(a)})]}function w(e,i,a){const{uniforms:l,schemaOptions:r}=a,{store:t}=r,o=t.ensureInstance(f.marker,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue,visualVariableRotation:l.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=x(e),n=6,u=n*i.width,c=u,p=e.color?.toArray()??i.color?.toArray()??[0,0,0,0],b="cross"===e.style||"x"===e.style;let m;switch(e.placement){case"begin-end":m="Both";break;case"begin":m="JustBegin";break;case"end":m="JustEnd";break;default:m="None"}const V={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:m,offsetAlongLine:0},overrides:[]};return[o.createMeshInfo({type:"simple",color:p,height:c,width:u,offsetX:0,offsetY:0,angle:0,alignment:h(l)?1:0,outlineColor:p,outlineSize:b?i.width:0,referenceSize:c/n,sprite:s,overrideOutlineColor:b&&null!=l.visualVariableColor,hasSizeVV:v(l),placement:V,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:S(l)})]}function O(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l;return[r.ensureInstance(f.text,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableRotation:a.visualVariableRotation,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1,visibility:!1}}).createMeshInfo({boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:o.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:S(a),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,labelClassId:-1})]}function A(e,a){const{schemaOptions:l,uniforms:r}=a,{store:t}=l,s=e.symbol,{allowOverrun:n,repeatLabel:c,repeatLabelDistance:p}=e,b={maxScale:e.maxScale??0,minScale:e.minScale??0},m=t.ensureInstance(f.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0,visibility:!0}}),V=e.labelPlacement,[y,v]=u(V);return[m.createMeshInfo({boxBackgroundColor:s.backgroundColor?.toArray(),boxBorderLineColor:s.borderLineColor?.toArray(),boxBorderLineSize:s.borderLineSize??0,color:s.color?.toArray()??[0,0,0,0],offsetX:s.xoffset,offsetY:s.yoffset,postAngle:s.angle,fontSize:s.font.size,decoration:s.font.decoration,outlineColor:[0,0,0,0],outlineSize:0,haloColor:s.haloColor?.toArray()??[0,0,0,0],haloSize:s.haloSize??0,lineWidth:s.lineWidth,lineHeightRatio:s.lineHeight,horizontalAlignment:y,verticalAlignment:v,repeatLabel:c,repeatLabelDistance:i(p),allowOverrun:n,labelPosition:e.labelPosition,scaleInfo:b,minPixelBuffer:S(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:s.font.toJSON(),textString:s.text,symbol:o.createCIMTextSymbolfromTextSymbol(s),primitiveName:"label-override"},useLegacyLabelEvaluationRules:null==e.labelExpressionInfo?.expression,overrides:[{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,labelClassId:a.labelClassId})]}function L(e,i){const a=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:a,referenceWidth:a,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:i,outlineUsesColorVV:!1}}function R(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=e.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if("solid"===e.outline?.style){return[r.ensureInstance(f.patternOutlineFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeScaleStops:a.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,...L(e.outline,!!a.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null})]}const s=[],n=r.ensureInstance(f.patternFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null});return s.push(n),e.outline&&s.push(...F(e.outline,i,!0)),s}function k(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=e.color?.toArray()??[0,0,0,0];if("none"!==e.style&&"solid"===e.outline?.style){return[r.ensureInstance(f.outlineFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeScaleStops:a.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,...L(e.outline,!!a.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})]}const o=[];if("none"!==e.style){const e=r.ensureInstance(f.fill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,scaleInfo:null,effects:null});o.push(e)}return e.outline&&o.push(...F(e.outline,i,!0)),o}async function U(e,i){if("cim"===e.type)return y(e.data,i);const{style:a}=e;return a&&"none"!==a&&"solid"!==a?R(e,i):k(e,i)}function j(e,i){const{outline:a}=e,{uniforms:l,schemaOptions:r}=i,{store:t}=r,s=[],n=o.createPictureFillRasterizationParam(e);if(!n)return[];const{width:u,height:c,xoffset:p,yoffset:b,xscale:m,yscale:S}=e,V={color:[255,255,255,255],sprite:n,height:c,aspectRatio:u/c,offsetX:p,offsetY:b,scaleX:m,scaleY:S,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if("solid"===a?.style){return[t.ensureInstance(f.complexOutlineFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...V,...L(a,!!l.visualVariableSizeOutlineScaleStops)})]}const y=t.ensureInstance(f.complexFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return s.push(y.createMeshInfo(V)),a&&s.push(...F(a,i,!0)),s}function F(e,i,a){const{color:l,style:r,width:t,cap:o,join:n}=e,{schemaOptions:u}=i,{store:c}=u,p=[],b=a?{...V,visualVariableSizeScaleStops:i.uniforms.visualVariableSizeOutlineScaleStops}:i.uniforms,m={uniforms:{visualVariableColor:b.visualVariableColor,visualVariableOpacity:b.visualVariableOpacity,visualVariableSizeMinMaxValue:b.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:b.visualVariableSizeScaleStops,visualVariableSizeStops:b.visualVariableSizeStops,visualVariableSizeUnitValue:b.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},S={color:l?.toArray()??[0,0,0,0],width:t,referenceWidth:t,capType:o,joinType:n,miterLimit:e.miterLimit,hasSizeVV:v(b),effects:null,scaleInfo:null};if(null==r||"solid"===r){const e=c.ensureInstance(f.line,m).createMeshInfo(S);p.push(e)}else if("none"!==r){const e=c.ensureInstance(f.texturedLine,m).createMeshInfo({...S,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:s(r,o)},overrides:[]}});p.push(e)}return null!=e.marker&&p.push(...w(e.marker,e,i)),p}export{d as createDotDensityMeshSchemas,g as createHeatmapMeshSchemas,F as createLineInstance,M as createPieChartMeshSchemas,z as createSymbolMeshSchemas};
|
|
5
|
+
import e from"../../../../../../../core/Logger.js";import{pt2px as i}from"../../../../../../../core/screenUtils.js";import{generateGradient as a}from"../../../../../../../renderers/support/heatmapUtils.js";import l from"../../../../../../../symbols/SimpleFillSymbol.js";import r from"../../../../../../../symbols/SimpleLineSymbol.js";import t from"../../../../../../../symbols/SimpleMarkerSymbol.js";import{CIMSymbolHelper as o,slsDashToTemplateArray as s}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{getSDFInfo as n}from"../../../../../../../symbols/cim/SDFHelper.js";import{getAlignmentFromPlacement as u}from"../../../../../engine/webgl/alignmentUtils.js";import{writeColor as c}from"../../../../../engine/webgl/color.js";import{dotDensityMaxFields as p}from"../../../../../engine/webgl/definitions.js";import{Techniques as f}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{premultiplyColor as b}from"../schemaUtils.js";import{createVisualVariableUniforms as m,getMaxSizeVVSize as S,noVisualVariables as V}from"../VisualVariablesSchema.js";import{createComplexSymbolInstances as y}from"./ComplexSymbolSchema.js";import{hasSizeVVUniform as v,hasRotationVVUniform as h}from"./utils.js";async function z(i,a){if(!i)return[];switch(i.type){case"simple-fill":return U(i,a);case"picture-fill":return j(i,a);case"simple-marker":return C(i,a);case"picture-marker":return I(i,a);case"simple-line":return F(i,a,!1);case"text":return O(i,a);case"label":return A(i,a);case"cim":return y(i.data,a);case"web-style":return z(await i.fetchSymbol({acceptedFormats:["cim","web"]}),a);case"line-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-line`),F(new r,a,!1);case"point-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-marker`),C(new t,a);case"polygon-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-fill`),U(new l,a);case"mesh-3d":case"label-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function d(e,i){const{schemaOptions:a}=i,{store:r}=a,t=new Array(p),o=new Array(p/4);for(let l=0;l<p;l++){const i=l<e.attributes.length?e.attributes[l].color:null;t[l]=[0,0,0,0],c(t[l],i)}for(let l=0;l<p/4;l++)o[l]=[0,0,0,0],o[l][0]=4*l<e.attributes.length?1:0,o[l][1]=4*l+1<e.attributes.length?1:0,o[l][2]=4*l+2<e.attributes.length?1:0,o[l][3]=4*l+3<e.attributes.length?1:0;const s={uniforms:{isActive:o,colors:t,dotValue:e.dotValue,dotScale:e.referenceScale,blending:e.dotBlendingEnabled,dotSize:e.dotSize,seed:e.seed},optionalAttributes:{}},n=r.ensureInstance(f.dotDensity,s).createMeshInfo({effects:null}),u=[],b=new l({color:e.backgroundColor??[0,0,0,0],outline:null}),m=await z(b,i);if(u.push(...m),u.push(n),e.outline){const a=F(e.outline,i,!0);u.push(...a)}return u}async function g(e,l){const{store:r}=l,{radius:t,minDensity:o,maxDensity:s,referenceScale:n,field:u,valueExpression:c,colorStops:p}=e,b=a(p);return[r.ensureInstance(f.heatmap,{uniforms:{radius:i(t),minDensity:o,maxDensity:s,referenceScale:n,isFieldActive:!(!u&&!c),gradient:b,gradientHash:b.join(",")},optionalAttributes:{}}).createMeshInfo({effects:null})]}async function M(e,a){const{store:l}=a,r=e.outline?.width||0,t=m(e),o=l.ensureInstance(f.pieChart,{uniforms:{shader:{outlineWidth:Math.round(i(r)),defaultColor:b(e.defaultColor),outlineColor:b(e.outline?.color),othersColor:b(e.othersCategory?.color),donutRatio:e.holePercentage,sectorThreshold:e.othersCategory?.threshold||0,colors:e.attributes.map(e=>b(e.color)),visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,hittestUniforms:null,highlightUniforms:null},numberOfFields:e.attributes.length},optionalAttributes:{}}).createMeshInfo({size:e.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:S(t)});return[...e.backgroundFillSymbol?await U(e.backgroundFillSymbol,{schemaOptions:a,uniforms:V}):[],o]}function x(e){if("path"===e.style){if(null==e.path)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const i=o.fromSimpleMarker(e);if("outline"in e&&e.outline&&"none"!==e.outline.style){if("solid"!==e.outline.style){if(!i||!i.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:i.symbolLayers[0],overrides:[]}}}return{type:"sprite-rasterization-param",resource:n(i),overrides:[]}}async function C(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l;if("path"===e.style||e.outline&&"solid"!==e.outline.style&&"none"!==e.outline.style){const l=o.fromSimpleMarker(e);if(!l||!l.symbolLayers)throw new Error("Error handling marker! ");if(a.visualVariableRotation&&(l.angleAlignment="Map"),"path"!==e.style){const e=l.symbolLayers[0];if(v(i.uniforms)){const a=S(i.uniforms,0,1);if(a>e.size){const i=a/e.size;e.size=a;const l=e.markerGraphics?.[0].symbol;(l.symbolLayers&&l.symbolLayers[0]).width*=i}}}return y({type:"CIMSymbolReference",symbol:l},i)}const t=r.ensureInstance(f.marker,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue,visualVariableRotation:a.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=x(e);let n=e.color?.toArray()??[0,0,0,0];"CIMVectorMarker"===s.resource.type&&(n=[255,255,255,255]);const u="triangle"===e.style?124/116:1,c=e.size,p=c*u,b=null!=a.visualVariableColor&&("cross"===e.style||"x"===e.style);return[t.createMeshInfo({type:"simple",color:n,height:c,width:p,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:h(a)?1:0,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:c,sprite:s,overrideOutlineColor:b,hasSizeVV:v(a),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:S(a)})]}function I(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=r.ensureInstance(f.marker,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue,visualVariableRotation:a.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=o.createPictureMarkerRasterizationParam(e);if(!s)return[];return[t.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:h(a)?1:0,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:s,overrideOutlineColor:!1,hasSizeVV:v(a),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:S(a)})]}function w(e,i,a){const{uniforms:l,schemaOptions:r}=a,{store:t}=r,o=t.ensureInstance(f.marker,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue,visualVariableRotation:l.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=x(e),n=6,u=n*i.width,c=u,p=e.color?.toArray()??i.color?.toArray()??[0,0,0,0],b="cross"===e.style||"x"===e.style;let m;switch(e.placement){case"begin-end":m="Both";break;case"begin":m="JustBegin";break;case"end":m="JustEnd";break;default:m="None"}const V={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:m,offsetAlongLine:0},overrides:[]};return[o.createMeshInfo({type:"simple",color:p,height:c,width:u,offsetX:0,offsetY:0,angle:0,alignment:h(l)?1:0,outlineColor:p,outlineSize:b?i.width:0,referenceSize:c/n,sprite:s,overrideOutlineColor:b&&null!=l.visualVariableColor,hasSizeVV:v(l),placement:V,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:S(l)})]}function O(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l;return[r.ensureInstance(f.text,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableRotation:a.visualVariableRotation,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1,visibility:!1}}).createMeshInfo({boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:o.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:S(a),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}function A(e,a){const{schemaOptions:l,uniforms:r}=a,{store:t}=l,s=e.symbol,{allowOverrun:n,repeatLabel:c,repeatLabelDistance:p}=e,b={maxScale:e.maxScale??0,minScale:e.minScale??0},m=t.ensureInstance(f.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0,visibility:!0}}),V=e.labelPlacement,[y,v]=u(V);return[m.createMeshInfo({boxBackgroundColor:s.backgroundColor?.toArray(),boxBorderLineColor:s.borderLineColor?.toArray(),boxBorderLineSize:s.borderLineSize??0,color:s.color?.toArray()??[0,0,0,0],offsetX:s.xoffset,offsetY:s.yoffset,postAngle:s.angle,fontSize:s.font.size,decoration:s.font.decoration,outlineColor:[0,0,0,0],outlineSize:0,haloColor:s.haloColor?.toArray()??[0,0,0,0],haloSize:s.haloSize??0,lineWidth:s.lineWidth,lineHeightRatio:s.lineHeight,horizontalAlignment:y,verticalAlignment:v,repeatLabel:c,repeatLabelDistance:i(p),allowOverrun:n,labelPosition:e.labelPosition,scaleInfo:b,minPixelBuffer:S(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:s.font.toJSON(),textString:s.text,symbol:o.createCIMTextSymbolfromTextSymbol(s),primitiveName:"label-override"},useLegacyLabelEvaluationRules:null==e.labelExpressionInfo?.expression,overrides:[{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,layerId:a.layerId,labelClassId:a.labelClassId})]}function L(e,i){const a=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:a,referenceWidth:a,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:i,outlineUsesColorVV:!1}}function R(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=e.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if("solid"===e.outline?.style){return[r.ensureInstance(f.patternOutlineFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeScaleStops:a.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,...L(e.outline,!!a.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null})]}const s=[],n=r.ensureInstance(f.patternFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null});return s.push(n),e.outline&&s.push(...F(e.outline,i,!0)),s}function k(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=e.color?.toArray()??[0,0,0,0];if("none"!==e.style&&"solid"===e.outline?.style){return[r.ensureInstance(f.outlineFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeScaleStops:a.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,...L(e.outline,!!a.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})]}const o=[];if("none"!==e.style){const e=r.ensureInstance(f.fill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,scaleInfo:null,effects:null});o.push(e)}return e.outline&&o.push(...F(e.outline,i,!0)),o}async function U(e,i){if("cim"===e.type)return y(e.data,i);const{style:a}=e;return a&&"none"!==a&&"solid"!==a?R(e,i):k(e,i)}function j(e,i){const{outline:a}=e,{uniforms:l,schemaOptions:r}=i,{store:t}=r,s=[],n=o.createPictureFillRasterizationParam(e);if(!n)return[];const{width:u,height:c,xoffset:p,yoffset:b,xscale:m,yscale:S}=e,V={color:[255,255,255,255],sprite:n,height:c,aspectRatio:u/c,offsetX:p,offsetY:b,scaleX:m,scaleY:S,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if("solid"===a?.style){return[t.ensureInstance(f.complexOutlineFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...V,...L(a,!!l.visualVariableSizeOutlineScaleStops)})]}const y=t.ensureInstance(f.complexFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return s.push(y.createMeshInfo(V)),a&&s.push(...F(a,i,!0)),s}function F(e,i,a){const{color:l,style:r,width:t,cap:o,join:n}=e,{schemaOptions:u}=i,{store:c}=u,p=[],b=a?{...V,visualVariableSizeScaleStops:i.uniforms.visualVariableSizeOutlineScaleStops}:i.uniforms,m={uniforms:{visualVariableColor:b.visualVariableColor,visualVariableOpacity:b.visualVariableOpacity,visualVariableSizeMinMaxValue:b.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:b.visualVariableSizeScaleStops,visualVariableSizeStops:b.visualVariableSizeStops,visualVariableSizeUnitValue:b.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},S={color:l?.toArray()??[0,0,0,0],width:t,referenceWidth:t,capType:o,joinType:n,miterLimit:e.miterLimit,hasSizeVV:v(b),effects:null,scaleInfo:null};if(null==r||"solid"===r){const e=c.ensureInstance(f.line,m).createMeshInfo(S);p.push(e)}else if("none"!==r){const e=c.ensureInstance(f.texturedLine,m).createMeshInfo({...S,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:s(r,o)},overrides:[]}});p.push(e)}return null!=e.marker&&p.push(...w(e.marker,e,i)),p}export{d as createDotDensityMeshSchemas,g as createHeatmapMeshSchemas,F as createLineInstance,M as createPieChartMeshSchemas,z as createSymbolMeshSchemas};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a,hasRootDiff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{OptimizedFeature as n}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as o}from"../../../../../layers/graphics/data/QueryEngine.js";import{executeQuery as c,executeQueryForCount as d}from"../../../../../rest/query/operations/query.js";import u from"../../../../../rest/support/StatisticDefinition.js";import{FeatureStoreStatistics as h}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as m}from"./FeatureSourceQueryInfo.js";import{StreamMessenger as p}from"./StreamMessenger.js";import{DrillDownTileLoadStrategy as l}from"./strategies/DrillDownTileLoadStrategy.js";import{PagedTileLoadStrategy as y}from"./strategies/PagedTileLoadStrategy.js";import{ParquetSnapshotLoadStrategy as _}from"./strategies/ParquetSnapshotLoadStrategy.js";import{ParquetTileLoadStrategy as g}from"./strategies/ParquetTileLoadStrategy.js";import{SnapshotLoadStrategy as f}from"./strategies/SnapshotLoadStrategy.js";import{StreamLoadStrategy as S}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as v}from"./strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as b}from"../support/FeatureMetadata.js";import{UpdateTracking2D as E}from"../../support/UpdateTracking2D.js";class F{constructor(e,t,s,r,a){this.service=e,this._aggregateAdapter=t,this._subscriptions=s,this._connection=r,this._cachedObjectIds=a,this._updateTracking=new E({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._metadata=b.createFeature(e.metadata),this._store=new v(this._metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),"memory"===this.service.type&&this.service.source.map(e=>e.close())}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return h.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new o({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,featureIdInfo:s.featureIdInfo,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasDisplayFilter(){return!!this._schema&&("displayFilterInfo"in this._schema.mutable&&null!=this._schema.mutable.displayFilterInfo)}chunks(){return Array.from(this._store.chunks())}prepareCacheUpdate(e,t){const s=new Set,r=new Set;for(const a of e)this._cachedObjectIds.has(a)||(this._cachedObjectIds.add(a),s.add(a));for(const a of t)this._cachedObjectIds.delete(a),r.add(a);this.hasDisplayFilter&&this._strategy.prepareCacheUpdate(s,r)}async applyCacheUpdate(){this.hasDisplayFilter&&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(t(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverride(e)}takeOverrideUpdate(){return this._store.takeOverrideUpdate()}async update(e,t){const s=e.source,n=r(this._schema?.mutable,s.mutable);if(!n)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:n}),this._schema=s,this._queryEngine?.destroy(),this._queryEngine=null,"feature-service"===this.service.type&&null!=this.service.queryMetadata.lastEditDate&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.type&&this._initStreamMessenger(),a(n,"sourceRefreshVersion")&&this._strategy?.refresh)return this._strategy.refresh();if(("feature"===s.type||"parquet"===s.type)&&a(n,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(o){this._connection.onEvent({type:"updateFieldsError",error:o})}}return!1}return!!(i(n,"dataFilter")||i(n,"sourceRefreshVersion")||this._strategy.about.supportsDisplayFilter&&i(n,"displayFilterInfo"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){await this._strategy.addParquetFile(e)}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.mutable.dataFilter.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new p(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(n.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(n.fromJSON),remove:e.commands.remove,release:e.commands.release}},s=e.commands.updateByIdWeak,r=await this._queryOptimizedFeatures(s);return t.commands.updateWeak.push(...r),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],s=(await this._strategy.queryByObjectId(e)).getCursor();for(;s.next();)t.push(s.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 s=this._store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(s)}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this.service.source,s={...t.query,f:"json"},r=(await e(t.path,{query:s,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),s=this.service.source&&"collection"in this.service.source,r=e||t||s;if("stream"===this._schema.type){const e=new S(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=e,e}if("parquet"===this._schema.type){const e=this.service;return null!=e.geometryInfo.displayOptimization?new g(e,this._metadata,this._schema,this._store):new _(e,this._metadata,this._schema,this._store)}const a=this.service,i=m.fromSchema(a,this._schema,this._metadata),n=await this._supportSnapshotMode(a,i);return n?new f(a,i,this._store,n,this.metadata,this._connection):r?new y(a,i,this._store,this.metadata,this._connection):new l(a,i,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const a=Array.from(this._subscriptions.values());if(!a.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const i=Promise.all(a.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(i),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{r&&await i}catch(n){s(n)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:s}=e,r=s.snapshotInfo;if(!r)return null;return await this._executeExceedsLimitQuery(e,t,r)?null:r}async _executeExceedsLimitQuery(e,t,s){if(!s.supportsExceedsLimit)return this._executeExceedsLimitFallbackQuery(e,t,s);try{const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const i=new u;i.statisticType="exceedslimit",i.maxPointCount=s.maxFeatureCount,i.maxRecordCount=s.maxFeatureCount,i.outStatisticFieldName="exceedslimit",s.maxVertexCount&&(i.maxVertexCount=s.maxVertexCount),a.inner.outStatistics=[i],a.inner.cacheHint=!0;const n=await c(r,a.inner,void 0,{query:a.customParameters}),o=n.data.features[0]?.attributes.exceedslimit;return!(0===o)}catch(r){return!0}}async _executeExceedsLimitFallbackQuery(e,t,s){if(s.maxVertexCount)return!0;const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1,a.inner.cacheHint=!0;try{return(await d(r,a.inner,{query:a.customParameters})).data.count>s.maxFeatureCount}catch(i){return!0}}}export{F as FeatureSource};
|
|
5
|
+
import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a,hasRootDiff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{OptimizedFeature as n}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as o}from"../../../../../layers/graphics/data/QueryEngine.js";import{executeQuery as c,executeQueryForCount as d}from"../../../../../rest/query/operations/query.js";import u from"../../../../../rest/support/StatisticDefinition.js";import{FeatureStoreStatistics as h}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as m}from"./FeatureSourceQueryInfo.js";import{StreamMessenger as p}from"./StreamMessenger.js";import{DrillDownTileLoadStrategy as l}from"./strategies/DrillDownTileLoadStrategy.js";import{PagedTileLoadStrategy as y}from"./strategies/PagedTileLoadStrategy.js";import{ParquetSnapshotLoadStrategy as _}from"./strategies/ParquetSnapshotLoadStrategy.js";import{ParquetTileLoadStrategy as g}from"./strategies/ParquetTileLoadStrategy.js";import{SnapshotLoadStrategy as f}from"./strategies/SnapshotLoadStrategy.js";import{StreamLoadStrategy as S}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as v}from"./strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as b}from"../support/FeatureMetadata.js";import{UpdateTracking2D as E}from"../../support/UpdateTracking2D.js";class F{constructor(e,t,s,r,a){this.service=e,this._aggregateAdapter=t,this._subscriptions=s,this._connection=r,this._cachedObjectIds=a,this._updateTracking=new E({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._metadata=b.createFeature(e.metadata),this._store=new v(this._metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),"memory"===this.service.type&&this.service.source.map(e=>e.close())}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return h.from(this._store)}get updateTracking(){return this._updateTracking}get usedMemory(){return this._store.usedMemory}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new o({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,featureIdInfo:s.featureIdInfo,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasDisplayFilter(){return!!this._schema&&("displayFilterInfo"in this._schema.mutable&&null!=this._schema.mutable.displayFilterInfo)}chunks(){return Array.from(this._store.chunks())}prepareCacheUpdate(e,t){const s=new Set,r=new Set;for(const a of e)this._cachedObjectIds.has(a)||(this._cachedObjectIds.add(a),s.add(a));for(const a of t)this._cachedObjectIds.delete(a),r.add(a);this.hasDisplayFilter&&this._strategy.prepareCacheUpdate(s,r)}async applyCacheUpdate(){this.hasDisplayFilter&&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(t(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverride(e)}takeOverrideUpdate(){return this._store.takeOverrideUpdate()}async update(e,t){const s=e.source,n=r(this._schema?.mutable,s.mutable);if(!n)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:n}),this._schema=s,this._queryEngine?.destroy(),this._queryEngine=null,"feature-service"===this.service.type&&null!=this.service.queryMetadata.lastEditDate&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.type&&this._initStreamMessenger(),a(n,"sourceRefreshVersion")&&this._strategy?.refresh)return this._strategy.refresh();if(("feature"===s.type||"parquet"===s.type)&&a(n,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(o){this._connection.onEvent({type:"updateFieldsError",error:o})}}return!1}return!!(i(n,"dataFilter")||i(n,"sourceRefreshVersion")||this._strategy.about.supportsDisplayFilter&&i(n,"displayFilterInfo"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){await this._strategy.addParquetFile(e)}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.mutable.dataFilter.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new p(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(n.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(n.fromJSON),remove:e.commands.remove,release:e.commands.release}},s=e.commands.updateByIdWeak,r=await this._queryOptimizedFeatures(s);return t.commands.updateWeak.push(...r),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],s=(await this._strategy.queryByObjectId(e)).getCursor();for(;s.next();)t.push(s.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 s=this._store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(s)}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this.service.source,s={...t.query,f:"json"},r=(await e(t.path,{query:s,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),s=this.service.source&&"collection"in this.service.source,r=e||t||s;if("stream"===this._schema.type){const e=new S(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=e,e}if("parquet"===this._schema.type){const e=this.service;return null!=e.geometryInfo.displayOptimization?new g(e,this._metadata,this._schema,this._store):new _(e,this._metadata,this._schema,this._store)}const a=this.service,i=m.fromSchema(a,this._schema,this._metadata),n=await this._supportSnapshotMode(a,i);return n?new f(a,i,this._store,n,this.metadata,this._connection):r?new y(a,i,this._store,this.metadata,this._connection):new l(a,i,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const a=Array.from(this._subscriptions.values());if(!a.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const i=Promise.all(a.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(i),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{r&&await i}catch(n){s(n)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:s}=e,r=s.snapshotInfo;if(!r)return null;return await this._executeExceedsLimitQuery(e,t,r)?null:r}async _executeExceedsLimitQuery(e,t,s){if(!s.supportsExceedsLimit)return this._executeExceedsLimitFallbackQuery(e,t,s);try{const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const i=new u;i.statisticType="exceedslimit",i.maxPointCount=s.maxFeatureCount,i.maxRecordCount=s.maxFeatureCount,i.outStatisticFieldName="exceedslimit",s.maxVertexCount&&(i.maxVertexCount=s.maxVertexCount),a.inner.outStatistics=[i],a.inner.cacheHint=!0;const n=await c(r,a.inner,void 0,{query:a.customParameters}),o=n.data.features[0]?.attributes.exceedslimit;return!(0===o)}catch(r){return!0}}async _executeExceedsLimitFallbackQuery(e,t,s){if(s.maxVertexCount)return!0;const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1,a.inner.cacheHint=!0;try{return(await d(r,a.inner,{query:a.customParameters})).data.count>s.maxFeatureCount}catch(i){return!0}}}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/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{FeatureSpatialIndex as e}from"../../../FeatureSpatialIndex.js";import{GeohashSpatialIndex as t}from"../../../aggregation/GeohashSpatialIndex.js";import{GridSpatialIndex as r}from"../../../aggregation/GridSpatialIndex.js";import{FeatureSetReaderIndirect as a}from"../../../support/FeatureSetReaderIndirect.js";class i{size(){return this.reader.getSize()}get fields(){return this.reader.fields}invalidate(){this._aggregateIndex=null,this._aggregateIndexHash=null,this._spatialIndex=null}registerOverrides(e){this.reader.registerOverrides(e),this.invalidate()}queryFeaturesInBounds(e){const t=this._getSpatialIndex().search(e);return a.from(this.reader,t)}getAggregateIndex(e){const a=JSON.stringify(e);if(a!==this._aggregateIndexHash){switch(this._aggregateIndexHash=a,e.type){case"grid":this._aggregateIndex=new r(e);break;case"geohash":this._aggregateIndex=new t(e)}this._aggregateIndex.insert(this.reader,this.isTiled)}return this._aggregateIndex}_getSpatialIndex(){return this._spatialIndex||(this._spatialIndex=e.fromReader(this.reader)),this._spatialIndex}}export{i as ASourceChunk};
|
|
5
|
+
import{FeatureSpatialIndex as e}from"../../../FeatureSpatialIndex.js";import{GeohashSpatialIndex as t}from"../../../aggregation/GeohashSpatialIndex.js";import{GridSpatialIndex as r}from"../../../aggregation/GridSpatialIndex.js";import{FeatureSetReaderIndirect as a}from"../../../support/FeatureSetReaderIndirect.js";class i{size(){return this.reader.getSize()}get fields(){return this.reader.fields}invalidate(){this._aggregateIndex=null,this._aggregateIndexHash=null,this._spatialIndex=null}get usedMemory(){let e=0;return e+=this.reader.underlyingMemory,this._aggregateIndex&&(e+=this._aggregateIndex.usedMemory),this._spatialIndex&&(e+=this._spatialIndex.usedMemory),e}registerOverrides(e){this.reader.registerOverrides(e),this.invalidate()}queryFeaturesInBounds(e){const t=this._getSpatialIndex().search(e);return a.from(this.reader,t)}getAggregateIndex(e){const a=JSON.stringify(e);if(a!==this._aggregateIndexHash){switch(this._aggregateIndexHash=a,e.type){case"grid":this._aggregateIndex=new r(e);break;case"geohash":this._aggregateIndex=new t(e)}this._aggregateIndex.insert(this.reader,this.isTiled)}return this._aggregateIndex}_getSpatialIndex(){return this._spatialIndex||(this._spatialIndex=e.fromReader(this.reader)),this._spatialIndex}}export{i as ASourceChunk};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/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._metadata=s,this._chunks=new Map,this._chunksToRemove=[],this._overrides=new r,this.events=new e,this.featureAdapter=new t}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._overrides.clearWeakOverrides()}*chunks(){this._overrides&&(yield this._overrides.asChunk(this._metadata)),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){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};
|
|
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._metadata=s,this._chunks=new Map,this._chunksToRemove=[],this._overrides=new r,this.events=new e,this.featureAdapter=new t}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(this._metadata)),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){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};
|