@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{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{numericHash as i}from"../../../../../../../core/string.js";import{fromRotation as r,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as n,set as a,sub as l,normalize as h,add as c,scale as m}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as u}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{GeometryCursor as f}from"../../../../../../../geometry/GeometryCursor.js";import{generalizeOptimizedGeometry as g,convertToGeometry as _}from"../../../../../../../layers/graphics/featureConversionUtils.js";import p from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as b,minMaxZoomPrecisionFactor as x}from"../../../definitions.js";import M from"../../../collisions/BoundingBox.js";import{LabelMetric as v}from"../../../collisions/LabelMetric.js";import{smoothPaths as y,pathDivide as P}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as w,processColorInput as L}from"../fill/meshWriterUtils.js";import{TextMeshWriter as I,maxLabelZoom as B}from"../text/TextMeshWriter.js";const S=1,z=0,j=128;function A(e,t){return i(`${e}${t}`)}function D(e,t,r){return i(`${e}${t}${r}`)}function G(e,t,r,s){return i(`${e}${t}${r*2**(B-s)}`)}function Z(e,t,r,s,o){return i(`${e}${o}${t}${r*2**(B-s)}`)}const k=e(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class F extends I{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,r){if(this._zoomLevel=r||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,i,r,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":{const i=t.readCentroidForDisplay();if(!i)return;const[r,s]=i.coords;this._writePoint(e,r,s,0,t);break}case"esriGeometryMultipoint":{let i=0;const r=f.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,r,s,o){const[n,a]=this._getMetricDir(),l=this.evaluatedMeshParams.scaleInfo?.maxScale??0,h=this.evaluatedMeshParams.scaleInfo?.minScale??0,c=this.evaluatedMeshParams.labelClassId;return new v(e,c,t,i,r,s,n,a,l,h,o)}_writePoint(e,t,i,r,s){if(t<0||t>b||i<0||i>b)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=A(s.getObjectId(),r),h=D(s.getObjectId(),a,r),[c,m]=this._getMetricDir(),u=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0,f=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new v(n,a,l,h,t,i,c,m,u,d,f)),this._writeGlyphs(e,n,t,i,o,0,f,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:r}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,r)=>this._placeSubdivGlyphs(e,t,i,r),a=(o.bounds.width+s)/(1<<S);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:w(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===r?"above":"top"===r?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=new p;g(a,n,!1,!1,"esriGeometryPolyline",1);const l=C(new p,a,o),h=C(new p,a,-o),c=_(h,"esriGeometryPolyline",!1,!1),m=_(l,"esriGeometryPolyline",!1,!1),u=y(m.paths,s.bounds.width),d=y(c.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<u.length;f++)this._current.pathIndex=f,P(u[f],i,t,!!r);this._current.offsetDirection="below";for(let f=0;f<d.length;f++)this._current.pathIndex=f,P(d[f],i,t,!!r)}_writeCenterAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=y(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,P(o[n],i,t,!!r)}_placeSubdivGlyphs(e,t,i,r){const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n}=this.evaluatedMeshParams,a=this._current.zoomRange[0],l=k(t),h=this._current.shaping.bounds.width/(1<<S),c=Math.sqrt(n||j)/(1<<S),m=Math.min(i,r-i),u=this._current.shaping.isMultiline?B:Math.log2(m/(c+h/2)),d=0===t?u:Math.min(l,u),f=Math.max(a,this._zoomLevel+S-d),g=this._zoomLevel-f,_=this._current.shaping.bounds.width/2*2**g,p=G(this._current.objId,this._current.pathIndex,t,this._zoomLevel),b=Z(this._current.objId,this._current.pathIndex,t,this._zoomLevel,this.evaluatedMeshParams.labelClassId);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,f,p,b):s&&g<0?this._placeStraightAlong(e,a,p,b):"parallel"===o?this._placeStraightAlong(e,f,p,b):"curved"===o&&this._placeCurved(e,f,_,p,b)}_placeStraight(e,t,i,r){const{out:s,id:o,shaping:n,referenceBounds:a}=this._current,{x:l,y:h}=e;s.metricStart(this._createLineLabelMetric(o,i,r,l,h)),s.metricBoxWrite(n.boundsT);const c=e.angle*(180/Math.PI)%360,m=(e.angle*(180/Math.PI)+180)%360,u={clipAngle:c,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,h,n,0,a,u,!1);const d={clipAngle:m,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,h,n,0,a,d,!1),s.metricEnd()}_placeCurved(e,t,i,r,s){const{out:o,id:n}=this._current;o.metricStart(this._createLineLabelMetric(n,r,s,e.x,e.y));const a=e.clone(),l=e.angle*(180/Math.PI)%360,h=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,l),this._placeBack(e,a,t,i,1,l),this._placeForward(e,a,t,i,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,h),this._placeBack(e,a,t,i,0,h),this._placeForward(e,a,t,i,0,h)),o.metricEnd()}_placeStraightAlong(e,i,n,a){const{out:l,id:h,shaping:c,zoomRange:m,referenceBounds:d}=this._current,{boxBorderLineColor:f,boxBackgroundColor:g}=this.evaluatedMeshParams,_=e.clone(),p=e.angle*(180/Math.PI)%360,b=(e.angle*(180/Math.PI)+180)%360,x=c.glyphs.length>0&&!(!f&&!g);if(l.metricStart(this._createLineLabelMetric(h,n,a,e.x,e.y)),x){const n=Math.max(i,m[0],0),a=Math.min(B,m[1]),f=r(o(),-e.angle),g={minZoom:n,maxZoom:a,clipAngle:p,mapAligned:!0,isLineLabel:!0},_=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=u(_,-1*x),[i,r]=c.shapeBackground(s(o(),f,t));l.recordStart(this.instanceId,this.attributeLayout,c.glyphs[0].textureBinding),this._writeTextBox(l,h,e.x,e.y,r,d,g),l.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=u(_,x),[i,r]=c.shapeBackground(s(o(),f,t));g.clipAngle=b,l.recordStart(this.instanceId,this.attributeLayout,c.glyphs[0].textureBinding),this._writeTextBox(l,h,e.x,e.y,r,d,g),l.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(_,i,1,p,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(_,i,0,b,!0),l.metricEnd()}_placeBack(e,t,i,r,s,o){const n=e.clone();let a=e.backwardLength+z;for(;n.prev()&&!(a>=r);)this._placeOnSegment(n,t,a,i,-1,s,o),a+=n.length+z}_placeForward(e,t,i,r,s,o){const n=e.clone();let a=e.remainingLength+z;for(;n.next()&&!(a>=r);)this._placeOnSegment(n,t,a,i,1,s,o),a+=n.length+z}_placeFirst(e,i,s,a,l=!1){const{out:h,id:c,shaping:m,zoomRange:d,referenceBounds:f}=this._current,g=m.glyphs,_=t(this.evaluatedMeshParams.offsetX),p=t(this.evaluatedMeshParams.offsetY),b=u(_,p),x=r(o(),-e.angle);n(b,b,x);for(const t of g){const r=t.x>m.bounds.x?s:1-s,o=r*e.remainingLength+(1-r)*e.backwardLength,n=Math.abs(t.x+t.width/2-m.bounds.x),u=Math.max(0,this._zoomLevel+Math.log2(n/(o+z))),g=Math.max(i,l?0:u);if(t.maxZoom=Math.min(d[1],B),t.angle=e.angle+(1-s)*Math.PI,t.minZoom=Math.max(d[0],g),this._writeLineGlyph(h,c,e.x,e.y,t,a,f,!0),(s||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom)){const e=new M(t.bounds.x+b[0],t.bounds.y+b[1],t.bounds.width,t.bounds.height);h.metricBoxWrite(e)}}}_placeOnSegment(e,i,s,a,l,h,c){const{out:m,id:d,shaping:f,referenceBounds:g}=this._current,_=f.glyphs,p=e.dx/e.length,b=e.dy/e.length,x={x:e.x+s*-l*p,y:e.y+s*-l*b},v=t(this.evaluatedMeshParams.offsetX),y=t(this.evaluatedMeshParams.offsetY),P=u(v,y),w=r(o(),-e.angle);n(P,P,w);for(const t of _){const i=t.x>f.bounds.x?h:1-h;if(!(i&&1===l||!i&&-1===l))continue;const r=Math.abs(t.x+t.width/2-f.bounds.x),o=Math.max(0,this._zoomLevel+Math.log2(r/s)-.1),n=Math.max(a,this._zoomLevel+Math.log2(r/(s+e.length+z)));if(0!==o&&(t.angle=e.angle+(1-h)*Math.PI,t.minZoom=n,t.maxZoom=o,this._writeLineGlyph(m,d,x.x,x.y,t,c,g,!0),(h||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom))){const e=new M(t.bounds.x+P[0],t.bounds.y+P[1],t.bounds.width,t.bounds.height);m.metricBoxWrite(e)}}}_writeLineGlyph(e,t,i,r,s,o,n,a){if(i<0||i>b||r<0||r>b)return;e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:h}=s,{fontSize:c,haloSize:m,outlineSize:u}=this._textMeshTransformProps;this._writeQuad(e,t,i,r,{texcoords:l,offsets:h,fontSize:c,haloSize:m,outlineSize:u,color:L(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:n,minZoom:Math.max(this._current.zoomRange[0],s.minZoom),maxZoom:Math.min(this._current.zoomRange[1],s.maxZoom),clipAngle:o,mapAligned:a,isLineLabel:!0}),e.recordEnd()}_packedZoom(e){return Math.floor(e*x)/x}_isVisible(e,t){let i=Math.max(this._current.zoomRange[0],e),r=Math.min(this._current.zoomRange[1],t);i=this._packedZoom(i),r=this._packedZoom(r);const s=this._packedZoom(this._zoomLevel);return i<=s&&s<=r}}function C(e,t,i){const{coords:r,lengths:s}=t,o=d(),n=d(),u=d(),f=d(),g=d(),_=d(),p=2;let b=0;for(let d=0;d<s.length;d++){const t=s[d];for(let s=0;s<t;s++){const d=p*(s+b-1),x=p*(s+b),M=p*(s+b+1);s>0?a(o,r[d],r[d+1]):a(o,0,0),a(n,r[x],r[x+1]),s<t-1?a(u,r[M],r[M+1]):a(u,0,0),0===s?a(f,0,0):(l(f,n,o),h(f,f),a(f,f[1],-f[0])),s===t-1?a(g,0,0):(l(g,u,n),h(g,g),a(g,g[1],-g[0])),c(_,f,g),h(_,_);const v=_[0]*g[0]+_[1]*g[1];0!==v&&m(_,_,v),m(_,_,i),e.coords.push(n[0]+_[0],n[1]+_[1])}e.lengths.push(t),b+=t}return e}export{F as LabelMeshWriter,A as labelIdHash,D as labelMetricHash,G as lineLabelIdHash,Z as lineLabelMetricHash};
|
|
5
|
+
import{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{numericHash as i}from"../../../../../../../core/string.js";import{fromRotation as r,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as n,set as a,sub as l,normalize as c,add as h,scale as m}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as u}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{GeometryCursor as f}from"../../../../../../../geometry/GeometryCursor.js";import{generalizeOptimizedGeometry as g,convertToGeometry as _}from"../../../../../../../layers/graphics/featureConversionUtils.js";import p from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as b,minMaxZoomPrecisionFactor as x}from"../../../definitions.js";import v from"../../../collisions/BoundingBox.js";import{LabelMetric as M}from"../../../collisions/LabelMetric.js";import{smoothPaths as P,pathDivide as y}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as w,processColorInput as L}from"../fill/meshWriterUtils.js";import{TextMeshWriter as I,maxLabelZoom as B}from"../text/TextMeshWriter.js";const S=1,z=0,D=128;function A(e,t,r){return i(`${e}${t}${r}`)}function j(e,t,r,s,o){return i(`${e}${t}${r}${s*2**(B-o)}`)}function G(e,t,r){return i(`${e}${t}${r}`)}function Z(e,t,r,s,o){return i(`${e}${o}${t}${r*2**(B-s)}`)}const k=e(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class F extends I{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,r){if(this._zoomLevel=r||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,i,r,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":{const i=t.readCentroidForDisplay();if(!i)return;const[r,s]=i.coords;this._writePoint(e,r,s,0,t);break}case"esriGeometryMultipoint":{let i=0;const r=f.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,r,s,o){const[n,a]=this._getMetricDir(),l=this.evaluatedMeshParams.scaleInfo?.maxScale??0,c=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this.evaluatedMeshParams.labelClassId;return new M(e,h,t,i,r,s,n,a,l,c,o)}_writePoint(e,t,i,r,s){if(t<0||t>b||i<0||i>b)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=A(this.evaluatedMeshParams.layerId,s.getObjectId(),r),c=G(s.getObjectId(),a,r),[h,m]=this._getMetricDir(),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,u=this.evaluatedMeshParams.scaleInfo?.minScale??0,f=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new M(n,a,l,c,t,i,h,m,d,u,f)),this._writeGlyphs(e,n,t,i,o,0,f,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:r}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,r)=>this._placeSubdivGlyphs(e,t,i,r),a=(o.bounds.width+s)/(1<<S);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:w(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===r?"above":"top"===r?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=new p;g(a,n,!1,!1,"esriGeometryPolyline",1);const l=$(new p,a,o),c=$(new p,a,-o),h=_(c,"esriGeometryPolyline",!1,!1),m=_(l,"esriGeometryPolyline",!1,!1),d=P(m.paths,s.bounds.width),u=P(h.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<d.length;f++)this._current.pathIndex=f,y(d[f],i,t,!!r);this._current.offsetDirection="below";for(let f=0;f<u.length;f++)this._current.pathIndex=f,y(u[f],i,t,!!r)}_writeCenterAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=P(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,y(o[n],i,t,!!r)}_placeSubdivGlyphs(e,t,i,r){const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n,layerId:a,labelClassId:l}=this.evaluatedMeshParams,{objId:c,shaping:h,pathIndex:m}=this._current,d=this._current.zoomRange[0],u=k(t),f=this._current.shaping.bounds.width/(1<<S),g=Math.sqrt(n||D)/(1<<S),_=Math.min(i,r-i),p=h.isMultiline?B:Math.log2(_/(g+f/2)),b=0===t?p:Math.min(u,p),x=Math.max(d,this._zoomLevel+S-b),v=this._zoomLevel-x,M=h.bounds.width/2*2**v,P=j(a,c,m,t,this._zoomLevel),y=Z(c,m,t,this._zoomLevel,l);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,x,P,y):s&&v<0?this._placeStraightAlong(e,d,P,y):"parallel"===o?this._placeStraightAlong(e,x,P,y):"curved"===o&&this._placeCurved(e,x,M,P,y)}_placeStraight(e,t,i,r){const{out:s,id:o,shaping:n,referenceBounds:a}=this._current,{x:l,y:c}=e;s.metricStart(this._createLineLabelMetric(o,i,r,l,c)),s.metricBoxWrite(n.boundsT);const h=e.angle*(180/Math.PI)%360,m=(e.angle*(180/Math.PI)+180)%360;if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const e={clipAngle:h,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const e={clipAngle:m,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}s.metricEnd()}_placeCurved(e,t,i,r,s){const{out:o,id:n}=this._current;o.metricStart(this._createLineLabelMetric(n,r,s,e.x,e.y));const a=e.clone(),l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,l),this._placeBack(e,a,t,i,1,l),this._placeForward(e,a,t,i,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,c),this._placeBack(e,a,t,i,0,c),this._placeForward(e,a,t,i,0,c)),o.metricEnd()}_placeStraightAlong(e,i,n,a){const{out:l,id:c,shaping:h,zoomRange:m,referenceBounds:u}=this._current,{boxBorderLineColor:f,boxBackgroundColor:g}=this.evaluatedMeshParams,_=e.clone(),p=e.angle*(180/Math.PI)%360,b=(e.angle*(180/Math.PI)+180)%360,x=h.glyphs.length>0&&!(!f&&!g);if(l.metricStart(this._createLineLabelMetric(c,n,a,e.x,e.y)),x){const n=Math.max(i,m[0],0),a=Math.min(B,m[1]),f=r(o(),-e.angle),g={minZoom:n,maxZoom:a,clipAngle:p,mapAligned:!0,isLineLabel:!0},_=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=d(_,-1*x),[i,r]=h.shapeBackground(s(o(),f,t));l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,u,g),l.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=d(_,x),[i,r]=h.shapeBackground(s(o(),f,t));g.clipAngle=b,l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,u,g),l.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(_,i,1,p,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(_,i,0,b,!0),l.metricEnd()}_placeBack(e,t,i,r,s,o){const n=e.clone();let a=e.backwardLength+z;for(;n.prev()&&!(a>=r);)this._placeOnSegment(n,t,a,i,-1,s,o),a+=n.length+z}_placeForward(e,t,i,r,s,o){const n=e.clone();let a=e.remainingLength+z;for(;n.next()&&!(a>=r);)this._placeOnSegment(n,t,a,i,1,s,o),a+=n.length+z}_placeFirst(e,i,s,a,l=!1){const{out:c,id:h,shaping:m,zoomRange:u,referenceBounds:f}=this._current,g=m.glyphs,_=t(this.evaluatedMeshParams.offsetX),p=t(this.evaluatedMeshParams.offsetY),b=d(_,p),x=r(o(),-e.angle);n(b,b,x);for(const t of g){const r=t.x>m.bounds.x?s:1-s,o=r*e.remainingLength+(1-r)*e.backwardLength,n=Math.abs(t.x+t.width/2-m.bounds.x),d=Math.max(0,this._zoomLevel+Math.log2(n/(o+z))),g=Math.max(i,l?0:d);if(t.maxZoom=Math.min(u[1],B),t.angle=e.angle+(1-s)*Math.PI,t.minZoom=Math.max(u[0],g),this._writeLineGlyph(c,h,e.x,e.y,t,a,f,!0),(s||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom)){const e=new v(t.bounds.x+b[0],t.bounds.y+b[1],t.bounds.width,t.bounds.height);c.metricBoxWrite(e)}}}_placeOnSegment(e,i,s,a,l,c,h){const{out:m,id:u,shaping:f,referenceBounds:g}=this._current,_=f.glyphs,p=e.dx/e.length,b=e.dy/e.length,x={x:e.x+s*-l*p,y:e.y+s*-l*b},M=t(this.evaluatedMeshParams.offsetX),P=t(this.evaluatedMeshParams.offsetY),y=d(M,P),w=r(o(),-e.angle);n(y,y,w);for(const t of _){const i=t.x>f.bounds.x?c:1-c;if(!(i&&1===l||!i&&-1===l))continue;const r=Math.abs(t.x+t.width/2-f.bounds.x),o=Math.max(0,this._zoomLevel+Math.log2(r/s)-.1),n=Math.max(a,this._zoomLevel+Math.log2(r/(s+e.length+z)));if(0!==o&&(t.angle=e.angle+(1-c)*Math.PI,t.minZoom=n,t.maxZoom=o,this._writeLineGlyph(m,u,x.x,x.y,t,h,g,!0),(c||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom))){const e=new v(t.bounds.x+y[0],t.bounds.y+y[1],t.bounds.width,t.bounds.height);m.metricBoxWrite(e)}}}_writeLineGlyph(e,t,i,r,s,o,n,a){if(i<0||i>b||r<0||r>b)return;e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:c}=s,{fontSize:h,haloSize:m,outlineSize:d}=this._textMeshTransformProps;this._writeQuad(e,t,i,r,{texcoords:l,offsets:c,fontSize:h,haloSize:m,outlineSize:d,color:L(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:n,minZoom:Math.max(this._current.zoomRange[0],s.minZoom),maxZoom:Math.min(this._current.zoomRange[1],s.maxZoom),clipAngle:o,mapAligned:a,isLineLabel:!0}),e.recordEnd()}_packedZoom(e){return Math.floor(e*x)/x}_isVisible(e,t){let i=Math.max(this._current.zoomRange[0],e),r=Math.min(this._current.zoomRange[1],t);i=this._packedZoom(i),r=this._packedZoom(r);const s=this._packedZoom(this._zoomLevel);return i<=s&&s<=r}}function $(e,t,i){const{coords:r,lengths:s}=t,o=u(),n=u(),d=u(),f=u(),g=u(),_=u(),p=2;let b=0;for(let u=0;u<s.length;u++){const t=s[u];for(let s=0;s<t;s++){const u=p*(s+b-1),x=p*(s+b),v=p*(s+b+1);s>0?a(o,r[u],r[u+1]):a(o,0,0),a(n,r[x],r[x+1]),s<t-1?a(d,r[v],r[v+1]):a(d,0,0),0===s?a(f,0,0):(l(f,n,o),c(f,f),a(f,f[1],-f[0])),s===t-1?a(g,0,0):(l(g,d,n),c(g,g),a(g,g[1],-g[0])),h(_,f,g),c(_,_);const M=_[0]*g[0]+_[1]*g[1];0!==M&&m(_,_,M),m(_,_,i),e.coords.push(n[0]+_[0],n[1]+_[1])}e.lengths.push(t),b+=t}return e}export{F as LabelMeshWriter,A as labelIdHash,G as labelMetricHash,j as lineLabelIdHash,Z as lineLabelMetricHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as r,watch as i,initial as n,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as r,watch as i,initial as n,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as p}from"./handlers/DoubleClickZoom.js";import{DoubleTapDragZoom as m}from"./handlers/DoubleTapDragZoom.js";import{DragPan as h}from"./handlers/DragPan.js";import{DragRotate as l}from"./handlers/DragRotate.js";import{GamepadNavigation as u}from"./handlers/GamepadNavigation.js";import{KeyPan as w}from"./handlers/KeyPan.js";import{KeyRotate as d}from"./handlers/KeyRotate.js";import{KeyZoom as v}from"./handlers/KeyZoom.js";import{MouseWheelZoom as f}from"./handlers/MouseWheelZoom.js";import{PinchRotateAndZoom as g}from"./handlers/PinchAction.js";import{BrowserEventSource as j}from"../../input/BrowserEventSource.js";import{InputManager as A,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as D}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as _}from"../../input/handlers/support.js";import{DoubleTapDrag as M}from"../../input/recognizers/DoubleTapDrag.js";import{Drag as b}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as z}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as P}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as I}from"../../input/recognizers/SingleAndDoubleClick.js";const T={counter:"Control",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwise:["a","A"],counterClockwise:["d","D"],reset:["n","N"]}},C=Symbol("handles");let E=class extends t{initialize(){const e=()=>this.view?.ready;this.addHandles([r(()=>!e(),()=>this._disconnect()),r(e,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this.removeHandles(C),this._inputManager=o(this._inputManager)}_connect(){const e=this.view.surface,t=new j(e,this.view.input),o=[new z,new P,new I,new b(this.view.navigation),new M],r=new A({eventSource:t,recognizers:o}),a=new h(this.view,["primary"]),c=new l(this.view,["secondary"]);r.installHandlers("prevent-context-menu",[new D],y.INTERNAL),r.installHandlers("navigation",[new g(this.view),new u(this.view),new f(this.view),new p(this.view),new p(this.view,[T.counter]),a,new w(this.view,T.pan),new v(this.view,T.zoom),new d(this.view,T.rotate),c,new m(this.view,"touch")],y.INTERNAL),this.view.viewEvents.connect(r),this._source=t,this._inputManager=r,this.addHandles([i(()=>this.view?.navigation?.browserTouchPanEnabled,e=>{this._source&&(this._source.browserTouchPanningEnabled=!e)},n),i(()=>{const{actionMap:e}=this.view.navigation;return{panActions:_("pan",e),rotateActions:_("rotate",e)}},({panActions:e,rotateActions:t})=>{a.pointerActions=e,c.pointerActions=t},s)],C)}get test(){}};e([a()],E.prototype,"view",void 0),e([a()],E.prototype,"latestPointerInfo",null),e([a()],E.prototype,"multiTouchActive",null),E=e([c("esri.views.2d.input.MapViewInputManager")],E);const k=E;export{k as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import{getContrast as i}from"../../../../core/colorUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../core/unitUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{subtract as h,normalize as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,UNIT_X as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{g as d,l as _,n as m,f as u,m as y,d as g}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../../../geometry/Point.js";import G from"../../../../geometry/Polygon.js";import{project as w,initializeProjection as R}from"../../../../geometry/projectionUtils.js";import{a as b,c as C}from"../../../../chunks/boundedPlane.js";import{equals as j}from"../../../../geometry/support/spatialReferenceUtils.js";import k from"../../../../layers/GraphicsLayer.js";import T from"../../../../symbols/SimpleFillSymbol.js";import S from"../../../../symbols/SimpleMarkerSymbol.js";import{DragManipulation as A}from"./manipulations/DragManipulation.js";import{RotateManipulation as P}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as M}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as x,SnapRotation as O}from"./manipulations/utils.js";import{InteractiveToolBase as D}from"../../../interactive/InteractiveToolBase.js";import{KeyBindings as U,mediaKeys as L}from"../../../interactive/keybindings.js";import{EditGeometry as B}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as E}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{calculateOrientedBounds as H}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as I}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as z}from"../../../support/screenUtils.js";const V=80,q=10,F=30,N=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],J=1,K=10;let Q=class extends D{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=b(),this._displayPlaneCache=b(),this._mainAxisCache=l(),this._rotationHandleCache=f(),this._cornerA=f(),this._cornerB=f(),this._cornerC=f(),this._cornerD=f(),this._avgAB=f(),this._avgBC=f(),this._avgCD=f(),this._avgDA=f(),this._preserveAspectRatio=new x,this._snapRotation=new O,this._graphicsLayer=new k({internal:!0,listMode:"hide",visible:!1,title:"TransformTool layer"}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._factor=J,this.preserveAspectRatio=null,this.snapRotation=null,this.type="transform"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach(e=>e.destroy()),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=s(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(null==e)return null;const t=this._editGeometryOperations.data,i=t.parts[0].segments[0],s=h(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);c(s,s);let o=V*this.view.resolution;const a=this.view.spatialReference;return j(a,e.spatialReference)&&(o*=r(a)/r(e.spatialReference)),H(s,t,o,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;C(e,t);const i=q*this.view.resolution;return d(t.basis1,t.basis1,1+i/_(t.basis1)),d(t.basis2,t.basis2,1+i/_(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new G({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return m(t,e.basis1),d(t,t,F*this.view.resolution),u(t,t,e.origin),u(t,t,e.basis1),new v({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=y(this._avgAB,i,s,.5),n=y(this._avgBC,s,o,.5),h=y(this._avgCD,o,r,.5),c=y(this._avgDA,r,i,.5);return[new v({x:i[0],y:i[1],spatialReference:t}),new v({x:s[0],y:s[1],spatialReference:t}),new v({x:o[0],y:o[1],spatialReference:t}),new v({x:r[0],y:r[1],spatialReference:t}),new v({x:a[0],y:a[1],spatialReference:t}),new v({x:n[0],y:n[1],spatialReference:t}),new v({x:h[0],y:h[1],spatialReference:t}),new v({x:c[0],y:c[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,s=this._editGeometryOperations,o=s.data.parts[0].vertices,r=B.fromGeometry(w(i,e.spatialReference),2).parts[0].vertices;o.forEach((e,t)=>{s.setVertexPosition(e,r[t].pos)}),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;"control-points"===t.type&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;if("georeference"in this.target){this.target.georeference.coords=e}this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach((e,t)=>{this._scaleGraphics[t].geometry=e})}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:s}=this;if("georeference"in s){const e=s.georeference;this._graphic=new t({geometry:e.coords}),this._initialControlPoints="control-points"===e.type?e.controlPoints:null}else this._graphic=s,this._initialGeometry=s.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=E.fromGeometry(w(this._graphic.geometry,e.spatialReference),2),this._backgroundGraphic=new t({symbol:new T({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new t({symbol:new S({color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map(s=>new t({symbol:new S({size:6,style:"square",color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s})),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new A({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new P({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map((t,i)=>new M({tool:this,view:e,graphic:t,direction:N[i],preserveAspectRatio:this._preserveAspectRatio})),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map(e=>e.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this))),o(()=>this.view.scale,()=>this.active?this.updateGraphics():null),e.on("click",async t=>{if(null!=e.activeTool&&e.activeTool!==this)return;const i=z(t),o=[];e.map.allLayers.forEach(e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)});const r=await this.view.hitTest(i,{exclude:o}),a=r.results;if(0===a.length)e.activeTool=null;else{const t=I(r.results),i="georeference"in s,o=a.map(e=>"media"===e.type?e.element:null).filter(Boolean),n=new Set([...this._graphicsLayer.graphics,i?null:s].filter(Boolean));i&&o.includes(s)||null!=t&&n.has(t.graphic)?null==e.activeTool&&(e.activeTool=this):e.activeTool=null}})]);const r=e=>{this.addHandles(e.events.on("grab-changed",e=>{"georeference"in s&&("start"===e.action?s.opacity*=.5:"end"===e.action&&(s.opacity*=2))}))};this._dragManipulation.forEachManipulator(r),this._rotateManipulation.forEachManipulator(r),this._scaleManipulations.forEach(e=>e.forEachManipulator(r));const a=new U;a.addToggle(L.preserveAspectRatio,()=>{null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled)}),a.addToggle(L.rotateIncrements,()=>{null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled)}),a.add(L.toggleOpacity,()=>{"georeference"in s&&(s.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),a.addToggle(L.factorModifier,e=>this._factor="key-down"===e.type?K:J),a.add(L.scaleUp,()=>this._scale(this._factor)),a.add(L.scaleDown,()=>this._scale(-this._factor)),a.add(L.moveUp,()=>this._move(0,this._factor)),a.add(L.moveDown,()=>this._move(0,-this._factor)),a.add(L.moveLeft,()=>this._move(-this._factor,0)),a.add(L.moveRight,()=>this._move(this._factor,0)),this.addHandles([e.on("key-down",t=>{e.activeTool===this&&a.dispatch(e.inputManager,t)}),e.on("key-up",t=>{e.activeTool===this&&a.dispatch(e.inputManager,t)})])}async _loadProjectionEngine(){const e=this._graphic.geometry;return R(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:s}=e,o=this._cornerA;u(o,s,t),u(o,o,i);const r=this._cornerB;u(r,s,t),g(r,r,i);const a=this._cornerC;g(a,s,t),g(a,a,i);const n=this._cornerD;g(n,s,t),u(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){"start"===e.action&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=t.data.geometry.extent?.width,s=(i+e*this.view.resolution)/i,o=t.scale(this._plane.origin,p,s,s,0,1);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations.move(e*this.view.resolution,t*this.view.resolution,0,0);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};e([a()],Q.prototype,"_plane",null),e([a()],Q.prototype,"_backgroundGraphicGeometry",null),e([a()],Q.prototype,"_rotateGraphicGeometry",null),e([a()],Q.prototype,"_scaleGraphicGeometries",null),e([a()],Q.prototype,"preserveAspectRatio",void 0),e([a()],Q.prototype,"snapRotation",void 0),e([a({constructOnly:!0,nonNullable:!0})],Q.prototype,"target",void 0),e([a({readOnly:!0})],Q.prototype,"type",void 0),e([a({constructOnly:!0})],Q.prototype,"view",void 0),Q=e([n("esri.views.2d.interactive.editingTools.TransformTool")],Q);export{Q as TransformTool};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import{getContrast as i}from"../../../../core/colorUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../core/unitUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{subtract as h,normalize as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,UNIT_X as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{g as d,l as _,n as m,f as u,m as y,d as g}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../../../geometry/Point.js";import G from"../../../../geometry/Polygon.js";import{project as w,initializeProjection as R}from"../../../../geometry/projectionUtils.js";import{c as b,a as C}from"../../../../chunks/boundedPlane.js";import{equals as j}from"../../../../geometry/support/spatialReferenceUtils.js";import k from"../../../../layers/GraphicsLayer.js";import T from"../../../../symbols/SimpleFillSymbol.js";import S from"../../../../symbols/SimpleMarkerSymbol.js";import{DragManipulation as A}from"./manipulations/DragManipulation.js";import{RotateManipulation as P}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as M}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as x,SnapRotation as O}from"./manipulations/utils.js";import{InteractiveToolBase as D}from"../../../interactive/InteractiveToolBase.js";import{KeyBindings as U,mediaKeys as L}from"../../../interactive/keybindings.js";import{EditGeometry as B}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as E}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{calculateOrientedBounds as H}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as I}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as z}from"../../../support/screenUtils.js";const V=80,q=10,F=30,N=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],J=1,K=10;let Q=class extends D{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=b(),this._displayPlaneCache=b(),this._mainAxisCache=l(),this._rotationHandleCache=f(),this._cornerA=f(),this._cornerB=f(),this._cornerC=f(),this._cornerD=f(),this._avgAB=f(),this._avgBC=f(),this._avgCD=f(),this._avgDA=f(),this._preserveAspectRatio=new x,this._snapRotation=new O,this._graphicsLayer=new k({internal:!0,listMode:"hide",visible:!1,title:"TransformTool layer"}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._factor=J,this.preserveAspectRatio=null,this.snapRotation=null,this.type="transform"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach(e=>e.destroy()),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=s(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(null==e)return null;const t=this._editGeometryOperations.data,i=t.parts[0].segments[0],s=h(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);c(s,s);let o=V*this.view.resolution;const a=this.view.spatialReference;return j(a,e.spatialReference)&&(o*=r(a)/r(e.spatialReference)),H(s,t,o,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;C(e,t);const i=q*this.view.resolution;return d(t.basis1,t.basis1,1+i/_(t.basis1)),d(t.basis2,t.basis2,1+i/_(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new G({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return m(t,e.basis1),d(t,t,F*this.view.resolution),u(t,t,e.origin),u(t,t,e.basis1),new v({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=y(this._avgAB,i,s,.5),n=y(this._avgBC,s,o,.5),h=y(this._avgCD,o,r,.5),c=y(this._avgDA,r,i,.5);return[new v({x:i[0],y:i[1],spatialReference:t}),new v({x:s[0],y:s[1],spatialReference:t}),new v({x:o[0],y:o[1],spatialReference:t}),new v({x:r[0],y:r[1],spatialReference:t}),new v({x:a[0],y:a[1],spatialReference:t}),new v({x:n[0],y:n[1],spatialReference:t}),new v({x:h[0],y:h[1],spatialReference:t}),new v({x:c[0],y:c[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,s=this._editGeometryOperations,o=s.data.parts[0].vertices,r=B.fromGeometry(w(i,e.spatialReference),2).parts[0].vertices;o.forEach((e,t)=>{s.setVertexPosition(e,r[t].pos)}),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;"control-points"===t.type&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;if("georeference"in this.target){this.target.georeference.coords=e}this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach((e,t)=>{this._scaleGraphics[t].geometry=e})}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:s}=this;if("georeference"in s){const e=s.georeference;this._graphic=new t({geometry:e.coords}),this._initialControlPoints="control-points"===e.type?e.controlPoints:null}else this._graphic=s,this._initialGeometry=s.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=E.fromGeometry(w(this._graphic.geometry,e.spatialReference),2),this._backgroundGraphic=new t({symbol:new T({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new t({symbol:new S({color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map(s=>new t({symbol:new S({size:6,style:"square",color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s})),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new A({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new P({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map((t,i)=>new M({tool:this,view:e,graphic:t,direction:N[i],preserveAspectRatio:this._preserveAspectRatio})),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map(e=>e.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this))),o(()=>this.view.scale,()=>this.active?this.updateGraphics():null),e.on("click",async t=>{if(null!=e.activeTool&&e.activeTool!==this)return;const i=z(t),o=[];e.map.allLayers.forEach(e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)});const r=await this.view.hitTest(i,{exclude:o}),a=r.results;if(0===a.length)e.activeTool=null;else{const t=I(r.results),i="georeference"in s,o=a.map(e=>"media"===e.type?e.element:null).filter(Boolean),n=new Set([...this._graphicsLayer.graphics,i?null:s].filter(Boolean));i&&o.includes(s)||null!=t&&n.has(t.graphic)?null==e.activeTool&&(e.activeTool=this):e.activeTool=null}})]);const r=e=>{this.addHandles(e.events.on("grab-changed",e=>{"georeference"in s&&("start"===e.action?s.opacity*=.5:"end"===e.action&&(s.opacity*=2))}))};this._dragManipulation.forEachManipulator(r),this._rotateManipulation.forEachManipulator(r),this._scaleManipulations.forEach(e=>e.forEachManipulator(r));const a=new U;a.addToggle(L.preserveAspectRatio,()=>{null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled)}),a.addToggle(L.rotateIncrements,()=>{null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled)}),a.add(L.toggleOpacity,()=>{"georeference"in s&&(s.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),a.addToggle(L.factorModifier,e=>this._factor="key-down"===e.type?K:J),a.add(L.scaleUp,()=>this._scale(this._factor)),a.add(L.scaleDown,()=>this._scale(-this._factor)),a.add(L.moveUp,()=>this._move(0,this._factor)),a.add(L.moveDown,()=>this._move(0,-this._factor)),a.add(L.moveLeft,()=>this._move(-this._factor,0)),a.add(L.moveRight,()=>this._move(this._factor,0)),this.addHandles([e.on("key-down",t=>{e.activeTool===this&&a.dispatch(e.inputManager,t)}),e.on("key-up",t=>{e.activeTool===this&&a.dispatch(e.inputManager,t)})])}async _loadProjectionEngine(){const e=this._graphic.geometry;return R(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:s}=e,o=this._cornerA;u(o,s,t),u(o,o,i);const r=this._cornerB;u(r,s,t),g(r,r,i);const a=this._cornerC;g(a,s,t),g(a,a,i);const n=this._cornerD;g(n,s,t),u(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){"start"===e.action&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=t.data.geometry.extent?.width,s=(i+e*this.view.resolution)/i,o=t.scale(this._plane.origin,p,s,s,0,1);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations.move(e*this.view.resolution,t*this.view.resolution,0,0);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};e([a()],Q.prototype,"_plane",null),e([a()],Q.prototype,"_backgroundGraphicGeometry",null),e([a()],Q.prototype,"_rotateGraphicGeometry",null),e([a()],Q.prototype,"_scaleGraphicGeometries",null),e([a()],Q.prototype,"preserveAspectRatio",void 0),e([a()],Q.prototype,"snapRotation",void 0),e([a({constructOnly:!0,nonNullable:!0})],Q.prototype,"target",void 0),e([a({readOnly:!0})],Q.prototype,"type",void 0),e([a({constructOnly:!0})],Q.prototype,"view",void 0),Q=e([n("esri.views.2d.interactive.editingTools.TransformTool")],Q);export{Q as TransformTool};
|
|
@@ -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/Handles.js";import{set as i,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{c as a,b as s,d as n,l as o,e as l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{
|
|
5
|
+
import t from"../../../../../core/Handles.js";import{set as i,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{c as a,b as s,d as n,l as o,e as l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as h,a as p}from"../../../../../chunks/boundedPlane.js";import{getInfo as u}from"../../../../../geometry/support/spatialReferenceUtils.js";import{Manipulation as _}from"./Manipulation.js";import{onGrabChangedHandle as d}from"./utils.js";import{createManipulatorDragEventPipeline as m,screenToMap as f}from"../../../../interactive/dragEventPipeline.js";import{GraphicManipulator as g}from"../../../../interactive/GraphicManipulator.js";import{apply as v}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";const b=10,x=1e-6,C=.3;function y(t){const i=o(t.basis1),e=o(t.basis2);return C*Math.min(i,e)}class j extends _{constructor(i){super(),this._handles=new t,this._planeStart=h(),this._displayPlaneStart=h(),this._originCache=c(),this._axisCache=r(),this._renderStartCache=c(),this._renderEndCache=c(),this._resizeOriginCache=c(),this._view=i.view,this._tool=i.tool,this._graphic=i.graphic,this._direction=i.direction,this._preserveAspectRatio=i.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",t=>d(t,this._manipulator))]),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,1)}createDragPipeline(t,r){let c=null,h=null,_=null,d=0,g=null,C=null;const j=this._planeStart,w=this._displayPlaneStart,S=this._direction;return m(this._manipulator,(m,E)=>{E.next(i=>{if("start"===i.action){m.cursor="grabbing";const i=t();c=i.plane,h=i.displayPlane,_=i.editGeometryOperations,d=b*this._view.resolution,p(c,j),p(h,w);const e=u(_.data.spatialReference);g=e?e.valid[1]-e.valid[0]-3*b*this._view.resolution:null}return i}).next(f(this._view)).next(t=>{const i=a(this._renderStartCache,[t.mapStart.x,t.mapStart.y,0]),e=a(this._renderEndCache,[t.mapEnd.x,t.mapEnd.y,0]),r=a(this._resizeOriginCache,w.origin);s(r,r,w.basis1,-S[0]),s(r,r,w.basis2,-S[1]),n(e,e,r),n(i,i,r);const c=0!==S[0]&&0!==S[1],p=y(w),u=y(h)/p,_=(t,r)=>{if(0===t)return 1;let a=o(r),s=.5*t*l(r,e)/a;const n=s<0?-1:1;if(c){s+=(a-.5*t*l(r,i)/a)*n*u}const h=a<1.5*d?1:x;return a=Math.max(a-d,x),n>0&&(s-=b*this._view.resolution),n*Math.max(n*(s/a),h)},m=_(S[0],w.basis1),f=_(S[1],w.basis2);return{...t,direction:S,factor1:m,factor2:f}}).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(t=>{const n=a(this._originCache,j.origin);s(n,n,j.basis1,-S[0]),s(n,n,j.basis2,-S[1]);const o=i(this._axisCache,j.basis1[0],j.basis1[1]);e(o,o);const l=_.data.allVerticesUnordered,h="start"===t.action?0:1,u=_.scaleVertices(l,n,o,t.factor1,t.factor2,h,1);return g&&g<_.data.geometry.extent.width&&C?_.updateVertices(l,C):(p(j,c),v(u,c),C=u.operation,r(t,u)),t}).next(t=>("end"===t.action&&(m.cursor="grab"),t))})}_createManipulator(){return new g({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}export{j as ScaleManipulation,y as calculateDiagonalResizeHandleScale};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as f,throwIfNotAbortError as g,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import A from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as j}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as x}from"../../../layers/support/featureLayerUtils.js";import{packFields as I}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as E}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as k}from"../../../layers/support/timeSupport.js";import C from"../../../rest/support/AggregateFeatureSet.js";import V from"../../../rest/support/AttributeBinsFeatureSet.js";import q from"../../../rest/support/AttributeBinsQuery.js";import R from"../../../rest/support/FeatureSet.js";import Q from"../../../rest/support/Query.js";import{LayerView2DMixin as O}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as T}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as M}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as P}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as D}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as H}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as N}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as J}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as G}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as $}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as B}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Z}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as X}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ee}from"./support/util.js";import{FeatureTileSubscriptionManager as te}from"../tiling/FeatureTileSubscriptionManager.js";import{FeatureLayerView as re}from"../../layers/FeatureLayerView.js";import se from"../../layers/LayerView.js";import{RefreshableLayerView as ie}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ae}from"../../support/highlightOptionsUtils.js";function oe(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ne=4294967294;function ue(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let le=class extends(re(ie(O(se)))){constructor(){super(...arguments),this._commandsQueue=new X({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new A,this._lastUpdate=0}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),f(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===E(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await T(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),g(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:s,labelingInfo:i})=>({labelingInfo:i,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:s,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new H(this.layer):new P(this.layer);case"geojson":case"csv":case"wfs":return new H(this.layer);case"parquet":return new $(this.layer);case"subtype-group":return new z(this.layer);case"ogc-feature":return new J(this.layer);case"stream":return new B(this.layer);case"oriented-imagery":return new G(this.layer);case"knowledge-graph-sublayer":return new N(this.layer);case"catalog-footprint":return new M(this.layer);default:o(this.layer)}return null}get timeExtent(){return k(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return u();const n=ae(t);return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,i){const a=await this.featureContainer.hitTest(i);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map(r=>this._createGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createGraphicHit(e,s.fromJSON(t))),...n.map(t=>this._createGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return Y(a,{})}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return Y(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=R.fromJSON(e);return t.features.forEach(e=>this._setLayersForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await Y(r,{features:[]}),i=R.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await Y(r,{features:[]}),i=C.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await Y(r,{count:0,extent:null});return{count:s.count,extent:F.fromJSON(s.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await Y(r,{features:[]});return V.fromJSON(s)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),s=new Set(this.subscriptionManager.coverage?.target.keys());for(const i of this.featureContainer.tiles||[])i.isCoverage=s.has(i.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),f(this._updatingHandles.addPromise(this._workerAttached.promise)),f(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new te({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),f(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ue([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.view.labelManager.removeContainer(this.featureContainer),this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),f(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updatingHandles.updating,i=this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${i}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return i}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=ee(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Z({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=Q.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=Q.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ne+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ne+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=ee(this.layer.geometryType),i=D(this.layer),a=[];for(const o of e.added){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),x(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const s=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.mutable,o.source.mutable)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=s);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=s,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const c=o.processor.mesh.strategy,d="cluster"===c.type||"binning"===c.type,y="heatmap"===o.processor.mesh.factory.symbology.type,f=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(f),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new K;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new K;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=oe(this._lastAvailableFields,e);return this._lastAvailableFields=t,I(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[he(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||h.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function he(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new U,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new U,i.where=v(i.where,a));let u=i?.toJSON()??null;return s.size&&(u??=(new U).toJSON(),u.hiddenIds=Array.from(s)),u}e([_()],le.prototype,"_commandsQueue",void 0),e([_()],le.prototype,"_sourceRefreshVersion",void 0),e([_()],le.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],le.prototype,"_pipelineUpdating",void 0),e([_()],le.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],le.prototype,"dataUpdating",null),e([_({readOnly:!0})],le.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],le.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],le.prototype,"hasFullGeometries",null),e([_()],le.prototype,"featureEffectView",void 0),e([_()],le.prototype,"labelingCollisionInfos",null),e([_()],le.prototype,"layerAdapter",null),e([_({readOnly:!0})],le.prototype,"timeExtent",null),le=e([b("esri.views.2d.layers.FeatureLayerView2D")],le);export{le as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as f,throwIfNotAbortError as g,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import A from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as j}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as x}from"../../../layers/support/featureLayerUtils.js";import{packFields as I}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as E}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as k}from"../../../layers/support/timeSupport.js";import C from"../../../rest/support/AggregateFeatureSet.js";import V from"../../../rest/support/AttributeBinsFeatureSet.js";import q from"../../../rest/support/AttributeBinsQuery.js";import R from"../../../rest/support/FeatureSet.js";import Q from"../../../rest/support/Query.js";import{LayerView2DMixin as O}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as T}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as M}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as W}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as P}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as D}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as H}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as N}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as J}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as G}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as $}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as B}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Z}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as X}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ee}from"./support/util.js";import{FeatureTileSubscriptionManager as te}from"../tiling/FeatureTileSubscriptionManager.js";import{FeatureLayerView as re}from"../../layers/FeatureLayerView.js";import se from"../../layers/LayerView.js";import{RefreshableLayerView as ie}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ae}from"../../support/highlightOptionsUtils.js";function oe(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ne=4294967294;function ue(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let le=class extends(re(ie(O(se)))){constructor(){super(...arguments),this._commandsQueue=new X({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new M,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new A,this._lastUpdate=0}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),f(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===E(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await T(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),g(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:s,labelingInfo:i})=>({labelingInfo:i,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:s,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new H(this.layer):new P(this.layer);case"geojson":case"csv":case"wfs":return new H(this.layer);case"parquet":return new $(this.layer);case"subtype-group":return new z(this.layer);case"ogc-feature":return new J(this.layer);case"stream":return new B(this.layer);case"oriented-imagery":return new G(this.layer);case"knowledge-graph-sublayer":return new N(this.layer);case"catalog-footprint":return new W(this.layer);default:o(this.layer)}return null}get timeExtent(){return k(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return u();const n=ae(t);return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,i){const a=await this.featureContainer.hitTest(i);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map(r=>this._createGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createGraphicHit(e,s.fromJSON(t))),...n.map(t=>this._createGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return Y(a,{})}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return Y(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=R.fromJSON(e);return t.features.forEach(e=>this._setLayersForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await Y(r,{features:[]}),i=R.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await Y(r,{features:[]}),i=C.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await Y(r,{count:0,extent:null});return{count:s.count,extent:F.fromJSON(s.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await Y(r,{features:[]});return V.fromJSON(s)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),s=new Set(this.subscriptionManager.coverage?.target.keys());for(const i of this.featureContainer.tiles||[])i.isCoverage=s.has(i.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),f(this._updatingHandles.addPromise(this._workerAttached.promise)),f(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new te({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),f(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ue([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.view.labelManager.removeContainer(this.featureContainer),this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),f(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updatingHandles.updating,i=this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${i}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return i}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=ee(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Z({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=Q.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=Q.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ne+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ne+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=ee(this.layer.geometryType),i=D(this.layer),a=[];for(const o of e.added){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),x(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const s=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.mutable,o.source.mutable)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=s);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=s,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const c=o.processor.mesh.strategy,d="cluster"===c.type||"binning"===c.type,y="heatmap"===o.processor.mesh.factory.symbology.type,f=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(f),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new K;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new K;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=oe(this._lastAvailableFields,e);return this._lastAvailableFields=t,I(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[he(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||h.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function he(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new U,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new U,i.where=v(i.where,a));let u=i?.toJSON()??null;return s.size&&(u??=(new U).toJSON(),u.hiddenIds=Array.from(s)),u}e([_()],le.prototype,"_commandsQueue",void 0),e([_()],le.prototype,"_sourceRefreshVersion",void 0),e([_()],le.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],le.prototype,"_pipelineUpdating",void 0),e([_()],le.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],le.prototype,"dataUpdating",null),e([_({readOnly:!0})],le.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],le.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],le.prototype,"hasFullGeometries",null),e([_()],le.prototype,"featureEffectView",void 0),e([_()],le.prototype,"labelingCollisionInfos",null),e([_()],le.prototype,"layerAdapter",null),e([_({readOnly:!0})],le.prototype,"timeExtent",null),le=e([b("esri.views.2d.layers.FeatureLayerView2D")],le);export{le as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import s from"../../../core/Error.js";import{watch as
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import{deprecatedFunction as s}from"../../../core/deprecate.js";import r from"../../../core/Error.js";import h from"../../../core/Logger.js";import{watch as o,on as a,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{isLinkChartView as c}from"../../../linkChart/utils.js";import{Container as d}from"../engine/Container.js";import{HighlightCounter as g}from"./support/HighlightCounter.js";import{createOrReuseHighlightGradient as u}from"./support/util.js";import{getDefaultHighlightOptions as m,setDefaultHighlightOptions as f}from"../support/highlightOptionsUtils.js";import y from"../../layers/support/ClipRect.js";import v from"../../layers/support/Geometry.js";import w from"../../layers/support/Path.js";import R from"../../support/HighlightOptions.js";import{isInEffectiveScaleRange as _}from"../../support/layerViewUtils.js";const S=e.ofType({key:"type",base:null,typeMap:{rect:y,path:w,geometry:v}}),H=new(e.ofType(R)),b=y=>{const v=y;let w=class extends v{constructor(){super(...arguments),this._highlightCounter=new g,this.attached=!1,this.clips=new S,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const t=this.view?.spatialReferenceLocked??!0,e=this.view?.spatialReference;e&&t&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new d),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,t=>{this.container&&(this.container.visible=!t)},n),o(()=>this.updateSuspended,t=>{this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},n),o(()=>this.layer?.opacity??1,t=>{this.container&&(this.container.opacity=t)},n),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},n),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},n),o(()=>this._mergedHighlights.items.map(t=>({name:t.name,options:{fillColor:t.color,haloColor:t.haloColor,fillOpacity:t.fillOpacity,haloOpacity:t.haloOpacity,haloWidth:t.haloWidth,haloBlur:t.haloBlur}})),()=>{this.container.highlightGradient=u(this.container.highlightGradient,this._mergedHighlights.items)},n),o(()=>this._mergedHighlights.items.map(t=>t.name),()=>{this._processHighlight()}),a(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},n),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:t,scaleRange:e})=>{const i=_(e,t);i!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=i)},n)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get highlightOptions(){return this._logHighlightOptionsDeprecation(),m(this)}set highlightOptions(t){this._logHighlightOptionsDeprecation(),f(this,t)}_logHighlightOptionsDeprecation(){s(h.getLogger(this),"`LayerView.highlightOptions` is deprecated in favor of View.highlights",{replacement:"View.highlights",version:"4.33",see:"https://arcg.is/inbTa1#highlights",warnOnce:!0})}get hasHighlight(){return this._highlightCounter.size>0}get _mergedHighlights(){if(!this.view)return H;if(!this.highlights)return this.view.highlights;const t=this.view.highlights.clone();for(const e of this.highlights){const i=t.find(t=>t.name===e.name);i&&i.assignFrom(e)}return t}get highlightIds(){return Array.from(this._highlightCounter.objectIds)}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const t=this.view?.spatialReference;return null==t||this.supportsSpatialReference(t)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating||this.container.transitioning)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(t){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",t),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(t))):this.updateRequested=!1}hitTest(t,e){return Promise.resolve(null)}supportsSpatialReference(t){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":case"graphics":break;default:if(c(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const t=super.getSuspendInfo(),e=!this.spatialReferenceSupported;return e&&(t.spatialReferenceNotSupported=e),t}addAttachHandles(t){this.addHandles(t,"attach")}_addHighlights(t,e){this._highlightCounter.add(t,e)&&this._processHighlight()}_removeHighlights(t,e){this._highlightCounter.delete(t,e)&&this._processHighlight()}_processHighlight(){}_getHighlights(){const t=[];for(const[e,i]of this._highlightCounter.highlightNamesByObjectId){const s=this._getHighlightBits(i);t.push({objectId:e,highlightFlags:s})}return t}_getHighlightBits(t){const e=new Set(t);let i=1,s=0;if(!this.view)return 0;const r=this._mergedHighlights;for(const{name:h}of r)e.delete(h)&&(s=i),i<<=1;return s}};return t([l()],w.prototype,"attached",void 0),t([l({type:S,set(t){const e=i(t,this._get("clips"),S);this._set("clips",e)}})],w.prototype,"clips",void 0),t([l()],w.prototype,"container",void 0),t([l({type:R})],w.prototype,"highlightOptions",null),t([l({type:e.ofType(R)})],w.prototype,"highlights",void 0),t([l()],w.prototype,"_mergedHighlights",null),t([l()],w.prototype,"moving",void 0),t([l({readOnly:!0})],w.prototype,"spatialReferenceSupported",null),t([l({readOnly:!0})],w.prototype,"updateParameters",void 0),t([l()],w.prototype,"updateRequested",void 0),t([l()],w.prototype,"updating",null),t([l()],w.prototype,"view",void 0),t([l()],w.prototype,"_visibleAtCurrentScale",void 0),t([l({readOnly:!0})],w.prototype,"visibleAtCurrentScale",null),w=t([p("esri.views.2d.layers.LayerView2D")],w),w};export{b as LayerView2DMixin};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t,createResolver as s}from"../../../../core/promiseUtils.js";import{UpdatingHandles as r}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import n from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as a}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{RenderState as o}from"./RenderState.js";import{renderHighlight as h}from"../support/util.js";class d{constructor(e,t){this.id=e,this.version=t,this._resolver=s(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class l extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new r,this._hitTestsRequests=[],this._store=new n,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){super.destroy(),this._renderState=e(this._renderState),this._renderStateNext=e(this._renderStateNext)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._layerView.requestUpdate(),this._renderState){const e=Array.from(this._renderState.tiles()).filter(e=>e.needsUpload);if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter(),this.requestRender())}const t=this._layerView.subscriptionManager.updateVisibility();this.setVisibleTiles(t);for(const s of this.children)s.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 16:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get
|
|
5
|
+
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t,createResolver as s}from"../../../../core/promiseUtils.js";import{UpdatingHandles as r}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import n from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as a}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{RenderState as o}from"./RenderState.js";import{renderHighlight as h}from"../support/util.js";class d{constructor(e,t){this.id=e,this.version=t,this._resolver=s(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class l extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new r,this._hitTestsRequests=[],this._store=new n,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){super.destroy(),this._renderState=e(this._renderState),this._renderStateNext=e(this._renderStateNext)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._layerView.requestUpdate(),this._renderState){const e=Array.from(this._renderState.tiles()).filter(e=>e.needsUpload);if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter(),this.requestRender())}const t=this._layerView.subscriptionManager.updateVisibility();this.setVisibleTiles(t);for(const s of this.children)s.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 16:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}get usedMemory(){let e=0;return this._renderState&&(e+=this._renderState.usedMemory),this._renderStateNext&&(e+=this._renderStateNext.usedMemory),e+=this.attributeView.usedMemory,e}get instanceStore(){return this._store}get layerView(){return this._layerView}get tiles(){return this._renderState?.tiles()}get _instanceStore(){return this._store}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&a.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(u(t))return t;return null}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&(this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter())}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe){if(!this._subscriptions.has(t)){const e=new d(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise);continue}this._subscriptions.get(t).version=s}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new o(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.layerView.view.labelManager.symbolFader,this,this.tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const r of t)s.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}lockForOverrides(){this._renderState?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState?.unlockUploads(),this._shouldUnlockAttributeView&&(this.attributeView.unlockTextureUploads(),this._shouldUnlockAttributeView=!1),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState?.flush(),this.requestRender()}trySwapRenderState(){if(this._renderStateNext){has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`);const e=new Map;for(const t of this._renderState?.tiles()||[])e.set(t.id,t.metricsVisibility);this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderState.flush();for(const t of this._renderState.tiles())t.copyMetricsVisibility(e.get(t.id)||new Set);this._renderStateNext=null}this.requestRender()}setVisibleTiles(e){this._visibleTiles=e;for(const t of this.tiles??[])t.rendering=e.has(t.key.id)}async onMessage(e,s){t(s);const r=e.inner;if(!this._subscriptions.has(r.id))return;const i=this._subscriptions.get(r.id);if(i.version!==r.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${r.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${r.id}] FeatureContainer - Dropping message, outdated version]`,r)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==r.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${r.version}]`),n.enqueueUpdate(e),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:t,y:s})=>t===e.x&&s===e.y);const r=s();return t?t.resolvers.push(r):(t={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(t)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((e,t)=>s.set(t,e)),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=a.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&h(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),i=t.getViewport(),n=e.passOptions,a=e.drawPhase;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),e.drawPhase=8;const{distance:o,smallSymbolDistance:h}=e.passOptions,d=Math.max(o,h);for(const l of this.children)l.visible&&l.containsScreenPoint(e.state,e.passOptions.position,2*d)&&this._renderTile(l,e,0);s.draw(e),s.unbind(),t.bindFramebuffer(r),t.restoreViewport(i),e.passOptions=n,e.drawPhase=a}_renderFeatures(e,t){const s=this._getHeatmapInstance(e);null!=s?this._renderHeatmapFeatures(e,t,s):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const s of this.children)s.visible&&this._renderTile(s,e,t)}_renderHeatmapFeatures(e,t,s){for(const r of this.children)r.visible&&this._renderTile(r,e,t,13);s.techniqueRef.renderResolvePass(e,s)}_renderTile(e,t,s,r){const i=has("featurelayer-strict-draw-order")?1:has("featurelayer-force-marker-text-draw-order")?2:0,n=e.getDisplayList(this._instanceStore,i);t.selection=s,n?.render(t,r)}}function u(e){return 13===e.techniqueRef.type}export{l as FeatureContainer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import{tileSize as p}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import l from"./Processor.js";import{FeatureSource as g}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";import b from"../../tiling/TileInfoView.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new b(i),this._source=new g(e.service,this._aggregateAdapter,this._subscriptions,s,this._cachedObjectIds),this._processor=new l(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),u(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),o(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new h(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),h=2*t,l=Math.ceil(p/h);for(const a of n){const t=a.tile,n=new Float64Array(l*l);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/h,i=u.readYForDisplay()/h,a=Math.floor(s),p=Math.floor(i);if(a<0||p<0||a>=l||p>=l)continue;const g=((.5+a-s)*h)**2+((.5+p-i)*h)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[p+a*l]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new _(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{schema:s,version:i}=e.inner;t=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const r=this._source.cleanup();this._processor.removeChunks(r);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e)}catch(o){has("esri-2d-update-debug")&&console.debug("InternalError",o)}await this._connection.container.unlockForOverrides(),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(o){i(o)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),null==e&&t&&await this._connection.container.trySwapRenderState(),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{y as default};
|
|
5
|
+
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import{tileSize as p}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import l from"./Processor.js";import{FeatureSource as g}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";import b from"../../tiling/TileInfoView.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new b(i),this._source=new g(e.service,this._aggregateAdapter,this._subscriptions,s,this._cachedObjectIds),this._processor=new l(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),u(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),o(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new h(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),h=2*t,l=Math.ceil(p/h);for(const a of n){const t=a.tile,n=new Float64Array(l*l);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/h,i=u.readYForDisplay()/h,a=Math.floor(s),p=Math.floor(i);if(a<0||p<0||a>=l||p>=l)continue;const g=((.5+a-s)*h)**2+((.5+p-i)*h)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[p+a*l]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new _(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{schema:s,version:i}=e.inner;t=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const r=this._source.cleanup();this._processor.removeChunks(r);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e)}catch(o){has("esri-2d-update-debug")&&console.debug("InternalError",o)}await this._connection.container.unlockForOverrides(),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(o){i(o)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),null==e&&t&&await this._connection.container.trySwapRenderState(),this._connection.onEvent({type:"performance",usedMemory:this.getUsedMemory()}),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import s from"../../../../core/CircularArray.js";import{EventEmitter as r}from"../../../../core/Evented.js";import
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import s from"../../../../core/CircularArray.js";import{EventEmitter as r}from"../../../../core/Evented.js";import i from"../../../../core/ReactiveMap.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";const n=10;let l=class extends e{constructor(){super(...arguments),this.events=new r,this._updatingStrategy=!0,this._tileToEvent=new i,this._fetchStatus={outstanding:0,done:0},this._pipelineStatistics={type:"performance",usedMemory:0}}get hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}get pipelineStatistics(){return this._pipelineStatistics}get willQueryAllFeatures(){return this._strategyInfo?.willQueryAllFeatures??!1}get willQueryFullResolutionGeometry(){return this._strategyInfo?.willQueryAllFeatures??!1}onEvent(t){switch(t.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(t);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=t.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",t);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),t.done&&(this._fetchStatus={done:0,outstanding:0});break;case"performance":this._pipelineStatistics=t}}_hasAllTileData(){for(const t of this._tileToEvent.values()){const e=t.peekLast();if("loaded"!==e?.type)return!1}return!0}_handleTileEvent(t){switch(t.type){case"subscribe":{const e=new s(n);e.enqueue(t),this._tileToEvent.set(t.tile,e);break}case"unsubscribe":this._tileToEvent.delete(t.tile);break;case"loaded":{const e=this._tileToEvent.get(t.tile);if(!e)return;e.enqueue(t),this._tileToEvent.set(t.tile,e);break}case"error":{const e=this._tileToEvent.get(t.tile);if(!e)return;e.enqueue(t),this._tileToEvent.set(t.tile,e),this.events.emit("error",t);break}}}};t([a({readOnly:!0})],l.prototype,"hasAllData",null),t([a()],l.prototype,"pipelineStatistics",null),t([a()],l.prototype,"willQueryAllFeatures",null),t([a()],l.prototype,"willQueryFullResolutionGeometry",null),t([a()],l.prototype,"_updatingStrategy",void 0),t([a()],l.prototype,"_strategyInfo",void 0),t([a()],l.prototype,"_tileToEvent",void 0),t([a()],l.prototype,"_pipelineStatistics",void 0),l=t([o("esri.views.2d.layers.features.FeatureSourceEventLog")],l);export{l as FeatureSourceEventLog};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{r as
|
|
5
|
+
import{estimateNumberMemory as s}from"../../../../core/memoryEstimations.js";import{r as t}from"../../../../chunks/rbush.js";import{create as e}from"../../../../geometry/support/aaBoundingBox.js";class n{static fromReader(s){const o=[],r=s.copy(),i=e();for(;r.next();){r.getBounds(i)&&o.push(r.getIndex())}const m=t(9,s=>(r.setIndex(s),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return m.load(o),new n(m,o.length)}constructor(s,t){this._index=s,this._size=t}get usedMemory(){return this._size*s}search(s){const t={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3]};return this._index.search(t)}}export{n as FeatureSpatialIndex};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import n from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as c}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as h}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as u}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as
|
|
5
|
+
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import n from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as c}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as h}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as u}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as g}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as p}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as y}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as d}from"./processor/BinningStrategy.js";import{ClusterStrategy as _}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as l}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as m}from"./processor/TrackStrategy.js";import{AttributeStore as f}from"./support/AttributeStore.js";import{ComputedAttributeStorage as b}from"./support/ComputedAttributeStorage.js";class w{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new g,this._proxy=new u({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t)}),this._attributeStore=new f({isLocal:!1,update:e=>o(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(){return this._strategy?.requiresInvalidation()??!1}async update(e,s,r,i,o){const c=e.processor,u=t(this._schema?.storage,c.storage),g=t(this._schema?.mesh.properties,c.mesh.properties),y=t(this._schema?.mesh.factory,c.mesh.factory),d=t(this._schema?.mesh.strategy,c.mesh.strategy),_=S(this._schema?.expressionProperties,c.expressionProperties),l=_.some(e=>this._attributeStore.hasArcadeDependency(e)),m=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&l,w=m||f,I=g||y||d;if(!(u||I||(m||l||f))&&!i)return!1;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a(this._schema,c),schema:c}),this._schema=c;const x=n.fromJSON(this._source.service.outSpatialReference),v=new b({fields:this._source.metadata.fieldsIndex,spatialReference:x}),M={currentUser:c.mesh.properties.currentUser};if((u||I||l)&&(await this._attributeStore.update(c.storage,v,this._source.metadata,s),this._strategy?.invalidateAttributeData(j(c))),!i&&!I&&!w)return!1;(d||g||w)&&await this._updateStrategy(c.mesh.strategy,x,o,j(c),M),this._updateSortKey(v,"sortKey"in c.mesh.properties?c.mesh.properties.sortKey:null);const k="dictionary"===c.mesh.factory.symbology.type?c.mesh.factory.symbology.fieldMap:null,U=new p(v,this._proxy,r,this._registry,k);return(y||"dictionary"===c.mesh.factory.symbology.type)&&(this._factory=await h.create(U,c.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e){if(!this._strategy)return;const t=this._strategy.applyOverrideUpdate(e);for await(const r of t)try{await this._process(r)}catch(s){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const a of e){let e=r.get(a.id);null==e&&(e=new y({concurrency:16,process:e=>this._process(e)}),r.set(a.id,e));const i=e.push(a).catch(e=>s(e));t.push(i)}try{await Promise.all(t)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r,i){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new l(this._source,this._attributeStore,r,i);break;case"binning":this._strategy=await d.create(e,t,this._source,this._attributeStore,r,i);break;case"cluster":this._strategy=await _.create(this._connection,e,t,this._source,this._attributeStore,r,i);break;case"track":this._strategy=await m.create(e,t,this._source,this._attributeStore,r,i)}for(const a of s)this._strategy.onSubscribe(a)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e){const t=e.subscription;if(has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process`)}const s={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(e,s),r(t.signal);const i=await this._write(e,t.tile.createArcadeEvaluationOptions(j(this._schema)),s),a=t.tile.tileInfoView.getLODInfoAt(t.tile.key);r(t.signal);const{message:o,transferList:n}=i.serialize(a),c={objectIdMap:null,inner:e.createMessage(o,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){c.objectIdMap={};const t=e.reader?.getCursor();if(t)for(;t.next();)c.objectIdMap[t.getDisplayId()]=t.getObjectId()}if(r(t.signal),await this._connection.container.onMessage(c,{signal:t.signal,transferList:n}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(j(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t);await this._proxy.fetchEnqueuedResources()}async _write(e,t,s){const a=e.subscription.tile,o=e.reader?.getCursor(),n=o?.getSize()??0,h=a.tileInfoView.tileInfo.isWrappable,u=a.tileInfoView.tileInfo.spatialReference.isWGS84,g=new c(a.key,this._strategy.enablePixelBuffering,h,u,n);if(!o)return g;const p=a.createArcadeEvaluationOptions(j(this._schema));let y=0;for(;o.next();){++y%1e3||(await i(0),r(e.subscription));const n=this._getSortKeyValue(o,t);g.entityStart(o.getDisplayId(),n),this._factory.write(g,this._proxy,o,p,s,a.level),g.entityEnd()}return g}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function S(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function j(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}export{w as default};
|