@arcgis/core 4.34.0-next.53 → 4.34.0-next.55
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/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/Components/formatUtils.d.ts +3 -0
- package/applications/Components/formatUtils.js +5 -0
- 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/{e58336aafe8c95bb6831.js → 0eb728cee6e40cb30c01.js} +1 -1
- 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/23f54b49742098def8ae.js +1 -0
- package/assets/esri/core/workers/chunks/24ac204d8a045aa821be.js +1 -0
- package/assets/esri/core/workers/chunks/252ee00fd6c4ae0ee7fa.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/3b51b61a7b8a1ef87c9b.js +1 -0
- package/assets/esri/core/workers/chunks/3d800fbc449bea18b1cd.js +1 -0
- package/assets/esri/core/workers/chunks/435169b455fd2846799b.js +1 -0
- package/assets/esri/core/workers/chunks/4874aabdb5c60ca66216.js +1 -0
- package/assets/esri/core/workers/chunks/4d2473e680324dc17cfa.js +1 -0
- package/assets/esri/core/workers/chunks/{2da12a64d3baef4aaaa1.js → 4f8dab492331c9a2d67a.js} +1 -1
- package/assets/esri/core/workers/chunks/527557b603400189d49a.js +1 -0
- package/assets/esri/core/workers/chunks/{4bd92232928b832dea76.js → 5900dde7a201a7d47469.js} +1 -1
- package/assets/esri/core/workers/chunks/62ade6f18b375795ddfd.js +1 -0
- package/assets/esri/core/workers/chunks/63f3e46bfa820436161c.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/69e6000044bfb03776ac.js +1 -0
- package/assets/esri/core/workers/chunks/6b11476b2004b4db576e.js +1 -0
- 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/813efde41e90e652b7db.js +1 -0
- package/assets/esri/core/workers/chunks/82404ff7c298493ff6f4.js +1 -0
- package/assets/esri/core/workers/chunks/{0ce671588de2858516d2.js → 83737d86584bf1b32368.js} +1 -1
- package/assets/esri/core/workers/chunks/{98ea12c7a000a30f3dc0.js → 87f68c2b9361bd3f8cac.js} +1 -1
- 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/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/ae73ac81bd10614c2b53.js +1 -0
- 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/{a1d3f1c221389eb6090c.js → c95e6bef8c97cf647869.js} +1 -1
- package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +1 -0
- package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +1 -0
- package/assets/esri/core/workers/chunks/dd120d562b63618e71c0.js +1 -0
- package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +1 -0
- package/assets/esri/core/workers/chunks/e04951ee32f041faaeca.js +1 -0
- 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/fe5c37c69da3ec1e56ac.js +1 -0
- package/assets/esri/core/workers/chunks/ff323db554c9e09749e8.js +1 -0
- 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/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/operators/json/graphicBufferOperator.js +5 -0
- package/geometry/support/DoubleArray.js +1 -1
- package/geometry/support/boundedPlane.js +1 -1
- package/geometry/support/coordinateSystem.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +232 -322
- package/kernel.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/networks/support/typeUtils.js +1 -1
- package/package.json +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/support/Circuit.js +5 -0
- package/rest/networks/support/CircuitSection.js +1 -1
- package/rest/networks/support/Subcircuit.js +1 -1
- package/rest/print.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/views/2d/analysisViewModuleImportUtils.js +5 -0
- 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/input/MapViewInputManager.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/LayerView2D.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/Dimension/LengthDimensionSubTool.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/LineOfSight/LineOfSightRayIntersector.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/FieldOfViewManipulation.js +1 -1
- package/views/3d/analysisViewModuleImportUtils.js +5 -0
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.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/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.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/effects/highlight/ShadowHighlight.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/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.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/DrawGraphicTool.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/LegacyDrawManipulator.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/input/handlers/LatestPointer.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
- package/views/interactive/Tooltip.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/layers/FeatureLayerView.js +1 -1
- package/views/support/AnalysisViewManager.js +5 -0
- package/views/support/PropertiesPool.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLine.d.ts +2 -2
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.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/14c6ae4feb4859cfa7c5.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/2b75212c31145cc07d16.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/38f84294fb2fb4663ba5.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/4c6862ad3af947c704f7.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/781b59ba0cabe78bc122.js +0 -1
- package/assets/esri/core/workers/chunks/8e0559cc6295008fcdf7.js +0 -1
- package/assets/esri/core/workers/chunks/944fa8261aad94ae0542.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/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/b877142a275188a16e17.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/cc0cb4906e4419f7c4a9.js +0 -1
- package/assets/esri/core/workers/chunks/cda27c0fafd687dfa72e.js +0 -1
- package/assets/esri/core/workers/chunks/ddd6597a66ec6b972f9c.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/f75ddd79be506423be09.js +0 -1
- package/assets/esri/core/workers/chunks/f8505bf69795f5293a79.js +0 -1
- package/assets/esri/core/workers/chunks/f92e608931b1c168cb45.js +0 -1
- package/assets/esri/core/workers/chunks/fb4950995f6780f6c22a.js +0 -1
- package/views/3d/analysis/AnalysisViewManager3D.js +0 -5
- 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/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/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 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};
|
|
@@ -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 t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as s}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as r,maxHighlightReasons as a}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as n}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as o}from"../../../engine/webgl/Utils.js";import{nanMagicNumber as l}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as h,DEBUG_ATTR_UPDATES as d}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as c}from"./DisplayIdGenerator.js";import u from"./FeatureFilterEvaluator.js";import{PixelType as p}from"../../../../webgl/enums.js";function g(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}const _=()=>e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),y=h(d,_()),
|
|
5
|
+
import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as s}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as r,maxHighlightReasons as a}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as n}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as o}from"../../../engine/webgl/Utils.js";import{nanMagicNumber as l}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as h,DEBUG_ATTR_UPDATES as d}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as c}from"./DisplayIdGenerator.js";import u from"./FeatureFilterEvaluator.js";import{PixelType as p}from"../../../../webgl/enums.js";function g(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}const _=()=>e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),y=h(d,_()),m={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};class f{constructor(t,e,i){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:r,textureOnly:a}=e;this.textureOnly=a||!1,this.pixelType=s,this.layout=r,this._resetRange(),this.size=t,this.isLocal=i,a||(this.data=this._initData(s,t))}get usedMemory(){return this.data?.byteLength??0}get buffer(){return this.data?.buffer}unsetComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=this.data;for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){this.data[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){this.data[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=n(t);return this.data[i*this.texelSize+e]}setData(t,e,i){const s=n(t),r=1<<e;0!==(this.layout&r)?null!=this.data&&(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):_().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t),i=this.data;e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!this.isLocal,r=this.pixelType,a=this.layout,n=this.data;return{start:t,end:e,data:s&&n.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e){const i=ArrayBuffer,s=o(t),r=new s(new i(e*e*4*s.BYTES_PER_ELEMENT));for(let a=0;a<r.length;a+=4)r[a+1]=255;return r}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class b{constructor(t){this._client=t,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=r,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new c,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const t=p.FLOAT;y(`Creating AttributeStore ${m.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:p.UNSIGNED_BYTE,layout:1},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:p.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}get usedMemory(){let t=0;for(const e of this._blocks)e&&(t+=e.usedMemory);return t+=this._idGenerator.usedMemory,t}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(t){return this._idGenerator.createIdForObjectId(t)}releaseDisplayIdForObjectId(t){return this._idGenerator.releaseIdForObjectId(t)}getDisplayIdForObjectId(t){return this._idGenerator.getDisplayIdForObjectId(t)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}releaseAllIds(){this._idGenerator.releaseAll()}async update(t,e,s,r=0){const a=i(this._schema,t);if(this.version=r,a&&(has("esri-2d-update-debug")&&console.debug(`Version[${r}] AttributeStore.update`,{changed:a}),this._schema=t,this._attributeComputeInfo=null,this._initialize(),null!=t))if(s&&(this._filters=await Promise.all(t.filters.map(t=>t?u.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:t}):null))),"multi"!==t.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(t.bindings.map(async t=>{const i=await this._bind(e,t);this._updateReferences(i)}));else{this._attributeComputeInfo={type:"multi",keyField:t.keyField,map:new Map};for(const i in t.bindings){const s=t.bindings[i];await Promise.all(s.map(async t=>{const s=await this._bind(e,t,parseInt(i,10));this._updateReferences(s)}))}}}setHighlight(t,e){let i=null;0===t.length&&0===e.length&&(i=this._getBlock(0),i.unsetComponentAllTexels(0,(1<<a)-1));for(const{displayId:s,highlightFlags:r}of t){if(null==s||-1===s)continue;i||(i=this._getBlock(0),i.unsetComponentAllTexels(0,(1<<a)-1));const t=n(s);i.setComponent(0,r,[t])}this._idsToHighlight.clear();for(const{objectId:s,highlightFlags:r}of t)this._idsToHighlight.set(s,r);for(const{objectId:s,highlightFlags:r}of e)this._idsToHighlight.set(s,r)}setData(t,e,i,s){const r=n(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlags(t){return this._idsToHighlight.get(t)||0}unsetAttributeData(t){const e=n(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e,i,s){const r=n(t);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(e,s));const a=this._attributeComputeInfo,o=1,h=4;let d=null;a&&(d="multi"===a.type?a.map.get(e.readAttribute(a.keyField)):a.map,d?.size&&d.forEach((t,s)=>{const a=s*o%h,n=Math.floor(s*o/h),d=this._getBlock(n+3);let c=t.field?.read(e,i);t.valueRepresentation&&(c=g(c,t.valueRepresentation));(null===c||isNaN(c)||c===1/0||c===-1/0)&&(c=l),d.setData(r,a,c)}))}get epoch(){return this._epoch}sendUpdates(){const t=this._blocks.map(t=>null!=t?t.toMessage():null),e=this._getInitArgs();has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:e,blockData:t,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}async _bind(t,e,i){const s=await t.createComputedField(e),{valueRepresentation:r}=e,a=this._attributeComputeInfo;if("multi"===a.type){const t=a.map.get(i)??new Map;t.set(e.binding,{field:s,valueRepresentation:r}),a.map.set(i,t)}else a.map.set(e.binding,{field:s,valueRepresentation:r});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(1),this._getBlock(2),this._getBlock(7),{blockSize:this._size,blockDescriptors:this._blocks.map(t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null)})}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;y(`Initializing AttributeBlock at index ${t}`);const i=new f(this._size,this._blockDescriptors[t],this._client.isLocal);return this._blocks[t]=i,this._initialized=!1,i}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const t=this._size<<=1;y("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._initialized=!1,this._size=t,0}return _().error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(t){s(this._arcadeDependencies,t)}isVisible(t){return!!(this._getBlock(0).getData(t,0)&1<<a)}getFilterFlags(t,e){let i=0;for(let r=0;r<this._filters.length;r++){const s=!!(1<<r),a=this._filters[r];i|=(!s||null==a||a.check(t,e)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlags(e)}return i<<a|s}}export{b as AttributeStore,g as getVisualVariableSizeValueRepresentationRatio};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{estimateNumberArrayMemory as e}from"../../../../../core/memoryEstimations.js";import{createDisplayId as t}from"../../../engine/webgl/DisplayId.js";class s{constructor(e){this.data=e,this._referenceCount=0}static{this.estimatedMemory=20}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return 0===this._referenceCount}}class r{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}get usedMemory(){let t=0;return t+=e(this._freeIdsGenerationA),t+=e(this._freeIdsGenerationB),t+=this._objectIdToDisplayId.size*(s.estimatedMemory+8),t}createIdForObjectId(e){let r=this._objectIdToDisplayId.get(e);return r?r.increment():(r=new s(t(this._getFreeId(),!1)),r.increment(),this._objectIdToDisplayId.set(e,r)),r.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return null!=t?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}export{r as DisplayIdGenerator};
|
|
@@ -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{estimateNumberMemory as t}from"../../../../../core/memoryEstimations.js";import{StaticBitSet as s}from"./StaticBitSet.js";class a{constructor(t){this._valid=s.create(t),this._data=new Array(t)}get usedMemory(){let s=this._valid.usedMemory;if(this._data.length>0){const a="string"==typeof this._data[0]?64:t;s+=this._data.length*a}return s}has(t){return this._valid.has(t)}set(t,s){this._valid.set(t),this._data[t]=s}get(t){return this._data[t]}}export{a as FeatureSetCache};
|
|
@@ -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{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{DateOnly as t}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as r}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as s}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as i}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as o}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as n,quantizeY as d}from"../../../../../geometry/support/quantizationUtils.js";import{getCentroidOptimizedGeometry as u}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as h,generalizeOptimizedGeometry as c,quantizeForDisplay as l,unquantizeOptimizedGeometry as m}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as y}from"../../../../../layers/graphics/OptimizedFeature.js";import f from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as p,unknown as g}from"../../../../../time/constants.js";import{FeatureSetCache as _}from"./FeatureSetCache.js";const b=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],x=b[0],D=b[1],T=b[2],F=b[3],A=has("featurelayer-simplify-payload-size-factors")??[1,2,4],S=A[0],I=A[1],B=A[2],j=has("featurelayer-simplify-mobile-factor")??2,G=has("esri-mobile"),M=4294967295;function C(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class v{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=G?j:1;t>4e6?r=B*s:t>1e6?r=I*s:t>5e5?r=S*s:t>1e5&&(r=s);let i=0;return e>4e3?i=F*r:e>2e3?i=T*r:e>100?i=D:e>15&&(i=x),i}getBounds(e){C(this._boundsBuffer,4*this.getIndex()+4,0);const t=this.getBoundsXMin();if(t===M||!isFinite(t))return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(t?.isPoint&&0===t.coords[0]&&0===t.coords[1])return i(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(M),!1;let r=1/0,s=1/0,a=-1/0,o=-1/0;return t.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),a=Math.max(a,e),o=Math.max(o,t)}),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(a),this.setBoundsYMax(o),i(e,r,s,a,o),!0}const r=this.getBoundsXMin(),s=this.getBoundsYMin(),a=this.getBoundsXMax(),o=this.getBoundsYMax();return i(e,r,s,a,o),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new y(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return h(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&"esriGeometryPolyline"===this.metadata.geometryType&&(t=c(new f,t,this.hasZ,this.hasM,this.metadata.geometryType,e.scale[0])),t&&(t=l(t,e,this.metadata.geometryType,this.hasZ,this.hasM)),!t){const t=this.readCentroidForDisplay();if(!t)return null;const r=n(e,t.coords[0]),s=d(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(r,s).deltaDecode()}return t}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&m(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&m(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new _(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=h(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??p):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===g}field(s){let i=this.fields.get(s);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return t.fromReader(this.readAttribute(s,!1));case"time-only":case"esriFieldTypeTimeOnly":return r.fromReader(this.readAttribute(s,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(s,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(s,this.readAttribute(s,!0));default:return this.readAttribute(s,!1)}for(const a of this._joined)if(a.setIndex(this.getIndex()),i=a.fields.get(s),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return t.fromReader(a._readAttribute(s,!1));case"time-only":case"esriFieldTypeTimeOnly":return r.fromReader(a._readAttribute(s,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(a._readAttribute(s,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(s,a._readAttribute(s,!0));default:return this.readAttribute(s,!1)}throw new Error(`Field ${s} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!0}_computeDisplayCentroid(e){if(null==this.getInTransform())return u(new f,e,this.hasM,this.hasZ);const t=s.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=o(t);return r?(r[1]*=-1,new f([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return h(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new f([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new f([2],[e-1,t+1,1,-1])}}export{v as FeatureSetReader};
|
|
5
|
+
import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as t}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as d,quantizeY as u}from"../../../../../geometry/support/quantizationUtils.js";import{getCentroidOptimizedGeometry as h}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as c,generalizeOptimizedGeometry as l,quantizeForDisplay as m,unquantizeOptimizedGeometry as y}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as f}from"../../../../../layers/graphics/OptimizedFeature.js";import p from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as g,unknown as _}from"../../../../../time/constants.js";import{FeatureSetCache as b}from"./FeatureSetCache.js";const x=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],D=x[0],T=x[1],F=x[2],A=x[3],S=has("featurelayer-simplify-payload-size-factors")??[1,2,4],I=S[0],B=S[1],j=S[2],M=has("featurelayer-simplify-mobile-factor")??2,G=has("esri-mobile"),C=4294967295;function v(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class O{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=G?M:1;t>4e6?r=j*s:t>1e6?r=B*s:t>5e5?r=I*s:t>1e5&&(r=s);let i=0;return e>4e3?i=A*r:e>2e3?i=F*r:e>100?i=T:e>15&&(i=D),i}getBounds(e){v(this._boundsBuffer,4*this.getIndex()+4,0);const t=this.getBoundsXMin();if(t===C||!isFinite(t))return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(t?.isPoint&&0===t.coords[0]&&0===t.coords[1])return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(C),!1;let r=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,r,s,i,a),!0}const r=this.getBoundsXMin(),s=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,r,s,i,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new f(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return c(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&"esriGeometryPolyline"===this.metadata.geometryType&&(t=l(new p,t,this.hasZ,this.hasM,this.metadata.geometryType,e.scale[0])),t&&(t=m(t,e,this.metadata.geometryType,this.hasZ,this.hasM)),!t){const t=this.readCentroidForDisplay();if(!t)return null;const r=d(e,t.coords[0]),s=u(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(r,s).deltaDecode()}return t}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&y(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&y(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new b(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}get underlyingMemory(){let e=0;e+=t(this._boundsBuffer);for(const t of this._caches.values())e+=t.usedMemory;return e}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=c(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??g):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===_}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!0}_computeDisplayCentroid(e){if(null==this.getInTransform())return h(new p,e,this.hasM,this.hasZ);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?(r[1]*=-1,new p([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return c(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new p([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new p([2],[e-1,t+1,1,-1])}}export{O as FeatureSetReader};
|
|
@@ -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"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{assertIsSome as r}from"../../../../../core/maybe.js";import{baseObjectMemory as s}from"../../../../../core/memoryEstimations.js";import n from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as i}from"./FeatureSetCache.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";import{parseHeader as o}from"./FeatureSetReaderPBFHeader.js";const d=268435455,u=128,c=128e3,l={small:{delta:new Int32Array(u),decoded:new Int32Array(u)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(c),decoded:new Int32Array(c)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function g(e,t){return t?e<=l.small64.delta.length?l.small64:(e<=l.large64.delta.length||(l.large64.delta=new Float64Array(Math.round(1.25*e)),l.large64.decoded=new Float64Array(Math.round(1.25*e))),l.large64):e<=l.small.delta.length?l.small:(e<=l.large.delta.length||(l.large.delta=new Int32Array(Math.round(1.25*e)),l.large.decoded=new Int32Array(Math.round(1.25*e))),l.large)}function _(r){try{const e=2,t=new n(new Uint8Array(r),new DataView(r));for(;t.next();){if(t.tag()===e)return f(t.getMessage());t.skip()}}catch(s){const r=new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:s});t.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(r)}return null}function f(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function y(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function m(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class I extends h{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=o(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new I(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new I(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return s+(this._cache.geometry?.usedMemory??0)}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===d?null:new a([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===d)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new a([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new i(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=y(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=g(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),n=s.getLength(),i=s.pos()+n,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new a(o,h)}_parseGeometryForDisplay(e){const t=2,s=3,n=e.asUnsafe(),i=n.getLength(),h=n.pos()+i,o=[],d=[];let u=0,c=0,l=null,_=0;const f="esriGeometryPolygon"===this.geometryType,y="esriGeometryPolyline"===this.geometryType,I=f?3:y?2:1,p=f||y;for(;n.pos()<h&&n.next();)switch(n.tag()){case t:{const e=n.getUInt32(),t=n.pos()+e;for(;n.pos()<t;){const e=n.getUInt32();o.push(e),u+=e}l=g(2*u,this._use64Bit).delta;break}case s:{n.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);r(l);for(const t of o){if(c+e*t>l.length){for(let e=0;e<t;e++)n.getSInt64(),n.getSInt64(),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();continue}let r=0,s=n.getSInt64(),a=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),l[c++]=s,l[c++]=a,r+=1;for(let e=1;e<t;e++){const e=n.getSInt64(),t=n.getSInt64(),i=s+e,h=a+t;_+=-.5*(i-s)*(h+a),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),0===e&&0===t||m(p,l[c-2],l[c-1],e,t)?(l[c-2]+=e,l[c-1]+=t):(l[c++]=e,l[c++]=t,r+=1),s=i,a=h}r>=I?d.push(r):c-=r*e}break}default:n.skip()}return this._cache.area=_,d.length?new a(d,l):null!=l?this._createDeltaQuantizedExtrudedGeometry(l[0],l[1]):null}}export{I as FeatureSetReaderPBF};
|
|
5
|
+
import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{assertIsSome as r}from"../../../../../core/maybe.js";import{baseObjectMemory as s}from"../../../../../core/memoryEstimations.js";import n from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as i}from"./FeatureSetCache.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";import{parseHeader as o}from"./FeatureSetReaderPBFHeader.js";const d=268435455,u=128,c=128e3,l={small:{delta:new Int32Array(u),decoded:new Int32Array(u)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(c),decoded:new Int32Array(c)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function g(e,t){return t?e<=l.small64.delta.length?l.small64:(e<=l.large64.delta.length||(l.large64.delta=new Float64Array(Math.round(1.25*e)),l.large64.decoded=new Float64Array(Math.round(1.25*e))),l.large64):e<=l.small.delta.length?l.small:(e<=l.large.delta.length||(l.large.delta=new Int32Array(Math.round(1.25*e)),l.large.decoded=new Int32Array(Math.round(1.25*e))),l.large)}function _(r){try{const e=2,t=new n(new Uint8Array(r),new DataView(r));for(;t.next();){if(t.tag()===e)return f(t.getMessage());t.skip()}}catch(s){const r=new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:s});t.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(r)}return null}function f(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function y(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function m(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class I extends h{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=o(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new I(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new I(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return s+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===d?null:new a([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===d)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new a([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new i(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=y(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=g(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),n=s.getLength(),i=s.pos()+n,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new a(o,h)}_parseGeometryForDisplay(e){const t=2,s=3,n=e.asUnsafe(),i=n.getLength(),h=n.pos()+i,o=[],d=[];let u=0,c=0,l=null,_=0;const f="esriGeometryPolygon"===this.geometryType,y="esriGeometryPolyline"===this.geometryType,I=f?3:y?2:1,p=f||y;for(;n.pos()<h&&n.next();)switch(n.tag()){case t:{const e=n.getUInt32(),t=n.pos()+e;for(;n.pos()<t;){const e=n.getUInt32();o.push(e),u+=e}l=g(2*u,this._use64Bit).delta;break}case s:{n.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);r(l);for(const t of o){if(c+e*t>l.length){for(let e=0;e<t;e++)n.getSInt64(),n.getSInt64(),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();continue}let r=0,s=n.getSInt64(),a=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),l[c++]=s,l[c++]=a,r+=1;for(let e=1;e<t;e++){const e=n.getSInt64(),t=n.getSInt64(),i=s+e,h=a+t;_+=-.5*(i-s)*(h+a),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),0===e&&0===t||m(p,l[c-2],l[c-1],e,t)?(l[c-2]+=e,l[c-1]+=t):(l[c++]=e,l[c++]=t,r+=1),s=i,a=h}r>=I?d.push(r):c-=r*e}break}default:n.skip()}return this._cache.area=_,d.length?new a(d,l):null!=l?this._createDeltaQuantizedExtrudedGeometry(l[0],l[1]):null}}export{I as FeatureSetReaderPBF};
|
|
@@ -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{estimateNumberArrayMemory as e}from"../../../../../core/memoryEstimations.js";import{getFeatureIdInfoFieldNames as t}from"../../../../../layers/graphics/data/FeatureIdInfo.js";import s from"../../../../../layers/support/FieldsIndex.js";import{parseField as r,parseTransform as o}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class i{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}get usedMemory(){let t=0;return t+=e(this.idFieldIndices),t+=e(this.offsets.attributes),t+=e(this.offsets.geometry),t+=e(this.centroid),this.displayIds&&(t+=e(this.displayIds)),this.groupIds&&(t+=e(this.groupIds)),t}}function a(e,a,c,f=!1){const d=9,u=12,p=13,g=15,h=e.asUnsafe(),l=h.pos(),m=new i;let y=0,I=0;const w=1,b=2,k=4,x=3;let A=null,L=!1;const F=[];for(;h.next();)switch(h.tag()){case u:A=h.processMessage(o);break;case d:if(m.exceededTransferLimit=h.getBool(),m.exceededTransferLimit){m.offsets.geometry=f?new Float64Array(8e3):new Int32Array(8e3),m.centroid=f?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<m.centroid.length;e++)m.centroid[e]=n}break;case p:{const e=h.processMessage(r);e.index=y++,F.push(e);break}case g:{const e=h.getLength(),t=h.pos()+e;if(!m.exceededTransferLimit){const e=m.offsets.geometry,t=m.centroid;e.push(0),t.push(n),t.push(n)}!L&&m.exceededTransferLimit&&(L=!0,m.offsets.attributes=f?new Float64Array(8e3*y):new Uint32Array(8e3*y));let s=I*y;for(;h.pos()<t&&h.next();)switch(h.tag()){case w:{if(L)m.offsets.attributes[s++]=h.pos();else{m.offsets.attributes.push(h.pos())}const e=h.getLength();h.skipLen(e);break}case b:if(a){const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case x:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*I]=e,m.centroid[2*I+1]=t;break}default:h.skip()}}else{m.offsets.geometry[I]=h.pos();const e=h.getLength();m.vertexCount+=e,h.skipLen(e)}break;case k:{const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case x:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*I]=e,m.centroid[2*I+1]=t;break}default:h.skip()}break}default:h.skip()}I++,m.hasFeatures=!0;break}default:h.skip()}m.fields=new s(F),m.featureCount=I,m.fieldCount=y;const C=t(c);return m.idFieldIndices=Array.from(C,e=>m.fields.get(e)?.index),m.transform=A,m.displayIds=new Uint32Array(m.featureCount),m.groupIds=new Uint16Array(m.featureCount),h.move(l),m}export{i as FeatureSetHeader,a as parseHeader};
|