@arcgis/core 6.0.0-next.54 → 6.0.0-next.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WebScene.js +2 -2
- package/applications/Components/OrientedImageryViewer/shared/constants.js +1 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/validation/arcadeValidator.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +1 -0
- package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
- package/assets/esri/core/workers/chunks/{6602310c3fcd91fb6a2f.js → 07c8ac092e4b9e8d5b3c.js} +1 -1
- package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
- package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +1 -0
- package/assets/esri/core/workers/chunks/{db0a7671ab5cbe8afd72.js → 123661019bb69c53f2d3.js} +1 -1
- package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{1b41ba050cde068d2860.js → 193a73a2c7f4f8482c21.js} +1 -1
- package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
- package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +1 -0
- package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
- package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
- package/assets/esri/core/workers/chunks/{afb4dfb89fbc8a342cc5.js → 3354f1fa90f8ce4c8fde.js} +1 -1
- package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
- package/assets/esri/core/workers/chunks/{9b458b0d1627f22fdd93.js → 3b11e4d2e69b7aea1d65.js} +1 -1
- package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
- package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
- package/assets/esri/core/workers/chunks/41694ee8990e799da225.js +1 -0
- package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
- package/assets/esri/core/workers/chunks/{12add2003631fa314f25.js → 5060be52a380fc4920f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{2aa6be0b047a1b25a520.js → 53bbb9aa6e4e4a0a8121.js} +1 -1
- package/assets/esri/core/workers/chunks/{c6d82397044e403a1f61.js → 5954f02c3901b28d8e73.js} +1 -1
- package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
- package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
- package/assets/esri/core/workers/chunks/{4707aedcc1b3bdf5e987.js → 5c34d49a6c9cc34b7626.js} +1 -1
- package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
- package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
- package/assets/esri/core/workers/chunks/{976303f47c342b9d1cc0.js → 62ddd3a82864e26f009a.js} +1 -1
- package/assets/esri/core/workers/chunks/69a09c6acb5ae03c67f6.js +1 -0
- package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
- package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
- package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
- package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +1 -0
- package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
- package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
- package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
- package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
- package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
- package/assets/esri/core/workers/chunks/{d14732a57c8e63948c60.js → 9117c9b720c9ba6e7a6e.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7e33d37dd11fb08f3f8.js → 97107e64407fa6825620.js} +1 -1
- package/assets/esri/core/workers/chunks/{5118c7269b706089c88e.js → a05a2c2aaf0c288f9681.js} +1 -1
- package/assets/esri/core/workers/chunks/{944f17e9c9f681b971fb.js → a12e2a345005189c64be.js} +1 -1
- package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
- package/assets/esri/core/workers/chunks/{15b3386ad92a0b4149b8.js → a24dc5350af001db417a.js} +1 -1
- package/assets/esri/core/workers/chunks/{10967a36c77c5188690d.js → a66d6298236d59a615db.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
- package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
- package/assets/esri/core/workers/chunks/{ac8d38016e4bee37a77c.js → ab784764ddf9d7f693a1.js} +1 -1
- package/assets/esri/core/workers/chunks/{255f5b45c4d32f97f86c.js → ac0861014b3d2f1a1de2.js} +1 -1
- package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +1 -0
- package/assets/esri/core/workers/chunks/ae48ee283cfa5b3c14b0.js +1 -0
- package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
- package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
- package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
- package/assets/esri/core/workers/chunks/bbd8fcb0bbba7bde3d9b.js +1 -0
- package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
- package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
- package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
- package/assets/esri/core/workers/chunks/d0659f1b0495734be4b3.js +1 -0
- package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
- package/assets/esri/core/workers/chunks/{b9a2b05ede02c305e865.js → d8ffb1502def5c85740b.js} +1 -1
- package/assets/esri/core/workers/chunks/{7dfe1e78d2e66de6be22.js → d9ef244019954d5a8a27.js} +1 -1
- package/assets/esri/core/workers/chunks/{95403bb27a4ea0a4b7b1.js → ddbfa664e69612295785.js} +1 -1
- package/assets/esri/core/workers/chunks/dfa1b0308e5e82d1ddfe.js +1120 -0
- package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
- package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
- package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
- package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
- package/assets/esri/core/workers/chunks/{55d28d3f5b8ced061e39.js → eaf73ce60f39a48ddd2a.js} +1 -1
- package/assets/esri/core/workers/chunks/ed2f2a5da830d058e339.js +1 -0
- package/assets/esri/core/workers/chunks/{e592f2483db71230e8e5.js → efd6ea0966f60ab19520.js} +1 -1
- package/assets/esri/core/workers/chunks/{944cb751c85d3a127f49.js → f52d081bbde5c95265cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{1de9be7b65109c207bd5.js → fbd5f3b81cd9f061824d.js} +1 -1
- package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
- package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
- package/assets/esri/layers/raster/formats/blosc-wasm.wasm +0 -0
- package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
- package/basemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/chunks/BlendLayers.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +14 -14
- package/chunks/Component.glsl.js +37 -37
- package/chunks/CypherParser.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +15 -15
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/HUDMaterial.glsl.js +3 -3
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/Path.glsl.js +15 -15
- package/chunks/Pattern.glsl.js +20 -20
- package/chunks/RasterColorizer.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +24 -24
- package/chunks/UnitFactory.js +1 -1
- package/chunks/Water.glsl.js +29 -20
- package/chunks/blosc-wasm.js +2 -0
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/parquet.js +1 -1
- package/chunks/pdf.js +57 -0
- package/chunks/text.js +1 -1
- package/config.js +1 -1
- package/core/accessorSupport/write.js +1 -1
- package/core/scheduling.js +1 -1
- package/core/sql/SqlInterval.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/geometryEngine.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/support/Ellipsoid.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/geodesicConstants.js +1 -1
- package/geometry/support/meshUtils/primitives.js +1 -1
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/effects/parser.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/parserUtils.js +2 -0
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/parquet.js +1 -1
- package/layers/raster/datasets/ZarrRaster.js +1 -1
- package/layers/raster/datasets/wcsCoverageParser.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/blosc.js +2 -0
- package/layers/support/BuildingFilter.js +1 -1
- package/layers/support/ControlPoint.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/IntegratedMeshSemantics.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/fieldUtils.d.ts +23 -87
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/geospatialPDFUtils.d.ts +63 -0
- package/layers/support/geospatialPDFUtils.js +2 -0
- package/layers/support/layersMapping.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/legend/ActiveLayerInfo.js +1 -1
- package/libs/ajv/ajv.bundle-wrapper.js +1 -1
- package/package.json +6 -6
- package/renderers/types.d.ts +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
- package/smartMapping/statistics/support/attributeDensity.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/support/tests/serviceMockDependencies.js +1 -1
- package/symbols/CIMSymbol.d.ts +9 -9
- package/symbols/PathSymbol3DLayer.d.ts +1 -1
- package/symbols/WaterSymbol3DLayer.d.ts +13 -1
- package/symbols/WaterSymbol3DLayer.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/rasterizingUtils.js +1 -1
- package/views/2d/PaddedViewState.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
- package/views/2d/engine/vectorTiles/constants.js +1 -1
- package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
- package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/ParquetLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/EnvironmentView.js +1 -1
- package/views/3d/focusAreaUtils.js +1 -1
- package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/Manipulator3DBase.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/config.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolFactory.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/LabelInfo.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/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/Tiles3DBVH.js +1 -1
- package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
- package/views/3d/layers/support/createTileBVHForLayer.js +1 -1
- package/views/3d/layers/support/selectTiles3DSpatialReference.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/state/Constraints.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/NearFarHeuristic.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/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/RenderCoordsHelper.js +1 -1
- package/views/3d/support/SweptSphereVolume.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/engineContent/marker.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
- package/views/3d/support/hitTest.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/PointsOfInterest.js +1 -1
- package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
- package/views/3d/terrain/ExtentHelper.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/RasterColorizerTechniqueConfiguration.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/TilingSchemeLogic.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
- package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.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/edgeRendering/strokes.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/Attribution.js +5 -5
- package/views/DOMContainer.d.ts +2 -1
- package/views/MapView.d.ts +1 -0
- package/views/SceneView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/ViewingMode.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/helpMessageUtils.js +1 -1
- package/views/draw/support/managers/EditSessionManager.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/AddOrUpdatePart.js +1 -1
- package/views/layers/support/editableLayerViews.js +1 -1
- package/views/overlay/TextOverlayItem.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/support/spatialReferenceSupport.js +1 -1
- package/views/webgl/Program.js +3 -3
- package/views/webgl/ShaderBuilder.js +23 -23
- package/views/webgl/ShaderTranspiler.js +2 -2
- package/webscene/Slide.js +1 -1
- package/webscene/VirtualLighting.d.ts +2 -4
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/widgets/support/forms/types.d.ts +23 -1
- package/assets/esri/core/workers/chunks/021bd07b9a3e70598840.js +0 -1
- package/assets/esri/core/workers/chunks/032733b863426c5bde00.js +0 -1121
- package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
- package/assets/esri/core/workers/chunks/170e68624b71ac96de4a.js +0 -1
- package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
- package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
- package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
- package/assets/esri/core/workers/chunks/2d3e977f3b75474d7ebc.js +0 -1
- package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
- package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
- package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
- package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
- package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
- package/assets/esri/core/workers/chunks/817bf487df056da1e6ec.js +0 -1
- package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
- package/assets/esri/core/workers/chunks/8a820e303941b351de81.js +0 -1
- package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
- package/assets/esri/core/workers/chunks/90d567e920b6982b402d.js +0 -1
- package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
- package/assets/esri/core/workers/chunks/97cdcedfe853280f6258.js +0 -1
- package/assets/esri/core/workers/chunks/9ebc6026934400fc1e1f.js +0 -1
- package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
- package/assets/esri/core/workers/chunks/b4a325dcf50e276751d7.js +0 -1
- package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
- package/assets/esri/core/workers/chunks/be5857b0d1b00faf430b.js +0 -1
- package/assets/esri/core/workers/chunks/cd9100a7c8309dfa7569.js +0 -1
- package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
- package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
- package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
- package/assets/esri/core/workers/chunks/e507dfc4788295d9c244.js +0 -1
- package/assets/esri/core/workers/chunks/e58f51618251f74aaafd.js +0 -1
- package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
- package/assets/esri/core/workers/chunks/e83806797979138fd22a.js +0 -1
- package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
- package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
- package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
- package/chunks/NativeLine.glsl.js +0 -8
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
- /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
package/views/SceneView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a,ensureClass as o}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as s}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as c}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ee}from"../core/accessorSupport/trackingUtils.js";import l from"../core/Collection.js";import{byId as te}from"../core/domUtils.js";import u from"../core/Error.js";import{on as ne}from"../core/events.js";import{destroyHandle as re,makeHandle as d}from"../core/handleUtils.js";import has from"../core/has.js";import{create as ie}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ae}from"../core/libs/rbush/PooledRBush.js";import f from"../core/Logger.js";import{mapCollectionAsync as oe}from"../core/mapCollectionUtils.js";import{destroyMaybe as p,maybeProperty as se}from"../core/maybe.js";import{throwIfDestroyed as ce,throwIfAborted as m,createAbortError as le}from"../core/promiseUtils.js";import ue from"../core/ReactiveSet.js";import{on as h,watch as g,initial as _,sync as v,whenOnce as y,syncAndInitial as b}from"../core/reactiveUtils.js";import{setFrameDuration as de,cleanupScheduling as fe}from"../core/scheduling.js";import{createScreenPoint as pe,createScreenPointArray as me}from"../core/screenUtils.js";import{cleanupWhereClauseCache as he}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as ge,getMetersPerUnitForSR as x}from"../core/units.js";import{initialize as _e}from"../core/workers/workers.js";import S from"../geometry/Extent.js";import ve from"../geometry/HeightModelInfo.js";import ye from"../geometry/Point.js";import{projectBoundingRect as be}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as xe}from"../geometry/projection/projectPointToVector.js";import{project as Se,canProjectWithoutEngine as Ce}from"../geometry/projectionUtils.js";import C from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as we}from"../geometry/spatialReferenceEllipsoidUtils.js";import{toExtent as Te,create as Ee}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as De}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Oe}from"../geometry/support/scaleUtils.js";import{wgs84 as ke,webMercator as Ae}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as je}from"../layers/graphics/dehydratedPoint.js";import{IntegratedMeshSemantics as w}from"../layers/support/IntegratedMeshSemantics.js";import{isImageryTileLayer as T,isTiledLayer as E,isVoxelLayer as D,isIntegratedMeshLayer as O,isGaussianSplatLayer as Me}from"../layers/support/layerUtils.js";import{TilemapCache as Ne}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Pe}from"../portal/portalDefault.js";import{WebSceneTag as Fe}from"../support/tagSymbols.js";import Ie from"../Viewpoint.js";import Le from"../webscene/Environment.js";import{clearVNodeCache as Re}from"../widgets/support/vnodeCache.js";import{importAnalysisViewModule as ze}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Be}from"./3d/camera/intersectionUtils.js";import k from"./3d/constraints/Constraints.js";import A from"./3d/environment/Environment.js";import{EnvironmentView as Ve}from"./3d/environment/EnvironmentView.js";import{GroundView3D as He}from"./3d/GroundView3D.js";import Ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as We}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ge}from"./3d/layers/graphics/Labeler.js";import Ke from"./3d/layers/i3s/I3SLodHandling.js";import{layerView3DImporter as j}from"./3d/layerViewModuleImportUtils.js";import{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{cleanupPointToPointAnimationController as Je}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{ScreenSizePerspective as Xe}from"./3d/state/ScreenSizePerspective.js";import{cleanupNavigationUtils as Ze}from"./3d/state/utils/navigationUtils.js";import M from"./3d/state/ViewState.js";import{ViewStateManager as Qe,cleanupViewStateManager as $e}from"./3d/state/ViewStateManager.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as N}from"./3d/support/debugFlags.js";import{getElevationAtPoint as nt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as rt}from"./3d/support/GroundAndIMSurface.js";import{toMap as it,hitTest as at}from"./3d/support/hitTest.js";import{PointsOfInterest as P}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as F}from"./3d/support/QualityProfile.js";import I from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as ct}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as lt}from"./3d/support/ResourceController.js";import ut from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as dt}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ft}from"./3d/support/ViewSlice.js";import L from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as pt,getTiledLayerInfo as mt,checkIfTileInfoSupportedForView as ht}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as gt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as _t}from"./3d/terrain/TileRenderer.js";import{createWebGLContext as vt}from"./3d/webgl-engine/createWebGLContext.js";import{olidEnabled as yt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as bt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{cleanupEdgeProcessing as xt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import{defaultTolerance as R}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as St}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as z}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{Stage as Ct}from"./3d/webgl-engine/Stage.js";import{BreakpointsOwner as wt}from"./BreakpointsOwner.js";import{DOMContainer as Tt}from"./DOMContainer.js";import B from"./interactive/options/ViewOptions.js";import{PopupView as Et}from"./PopupView.js";import Dt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as Ot}from"./support/drapedUtils.js";import{occludeesSupported as kt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as V,createScreenPointFromSupportedEvent as H}from"./support/screenUtils.js";import{isSpatialReferenceSupported as U}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as At,destroyTextureCompressionWorker as jt}from"./support/TextureCompressionHelper.js";import W from"./ui/3d/DefaultUI3D.js";import Mt from"./ui/DefaultUI.js";import G from"./View.js";import Nt from"./ViewAnimation.js";import{stringFromViewingMode as K,viewingModeFromString as q}from"./ViewingMode.js";var J;const Pt=Symbol(),Y=Symbol();function Ft(e){let t=o(B,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let X=class extends wt(Et(Tt(G))){static{J=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new B({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=lt(this),this.deconflictor=new We({view:this}),this.attribution3D=new et({view:this}),this.labeler=new Ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new qe({view:this}),this.basemapTerrain=null,this.elevationProvider=new tt({view:this}),this._canvas=null,this.constraints=new k,this._environment=new A,this.environmentView=new Ve,this.floors=new l,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Dt({importAnalysisViewModule:e=>ze(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ue,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new M({view:this}),this.slice=new ft,this.renderCoordsHelper=new ct,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new W,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,_e();let t=()=>this._updatingChanged();this.addHandles(re(oe(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([h(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),g(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ue({view:this}),this.stateManager=new Qe({view:this}),this.screenSizePerspective=new Xe({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=At(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new He({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>de(e>0?1e3/Math.ceil(e):0),_),this.addHandles([g(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),v),g(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),v)])}destroy(){this.destroyed||(jt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set(`labeler`,p(this.labeler)),this._set(`deconflictor`,p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set(`stateManager`,p(this.stateManager)),this._set(`inputManager`,p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,p(this.environmentView)),this._set(`environment`,p(this.environment)),this.groundView=p(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=a(ye,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||se(e,`clippingArea`);return!(this._userClippingArea||se(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof S?this.spatialReference&&(t=Z(t,this.spatialReference),t==null)?(f.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(f.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?f.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.isGlobal)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:Z(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||C.WGS84,n=Z(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||C.WGS84,t,n=n=>{let r=Z(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new S({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent==null||e.type===`graphics`&&e.internal||n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof A?e:e instanceof Le?this.environment?.cloneWithWebsceneEnvironment(e)??A.fromWebsceneEnvironment(e):a(A,e):new A}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return J._layerToLayerview}static{this._layerToLayerview=G._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Fe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=F(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new I(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||st()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?c(()=>Oe(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=ge(this.spatialReference);if(t&&e.heightUnit!==t)return new ve({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&f.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||pt(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return N.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this.groundView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return N.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedViewingMode;if(e!=null)return K(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?K(this.defaultsFromMap.viewingMode):U(t,1)?`global`:`local`:`global`}set viewingMode(e){this.ready?f.getLogger(this).error(`#viewingMode`,`viewingMode cannot be set once view is ready`):this._overrideIfSome(`viewingMode`,e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ut(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return f.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return f.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Lt,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),xe(t,Q,this.renderSpatialReference),this.state.camera.projectToScreen(Q,$),pe($[0],$[1])}pixelSizeAt(e,t){if(!this.ready)return f.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;xe(e,Q,n);let r=this.state.camera.computeScreenPixelSizeAt(Q);return t&&n!==t?r*x(n)/x(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return f.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return at(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return ot(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new u(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!yt())throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),a=await this._completeSettings(e);return a.format=`png`,[i,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return j.importLayerView(e)}hasLayerViewModule(e){return j.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedViewingMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:q(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n?r(n):[...r(1)??[],...r(2)??[]];return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return U(e,n)?t==null||T(t)?!0:!(E(t)&&mt(t,e,n)==null||D(t)&&n===1):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,viewingMode:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?C.WGS84:C.WebMercator:new C({...i?ke:Ae,vcsWkid:o,latestVcsWkid:s});return T(t)&&(i||a)?!(a&&r!==2)||ht(t.tileInfo,t.fullExtent,e,1)===null?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:[{spatialReference:c(),viewingMode:n}]:!E(t)&&!D(t)&&(i||a)?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:E(t)&&i&&n!==1?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:2}]:[{spatialReference:e,viewingMode:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedViewingMode;return t||(n==null?e.isGeographic&&f.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):f.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${K(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return f.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return f.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&kt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await y(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),d(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await Rt[e]();if(t&&(ce(this),m(n.signal),await t(n.signal)),this.destroyed)throw le();return m(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new L({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new P({view:this})),this.addHandles([this.updatingHandles.add(()=>N.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&N.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},b),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?Se(Te(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},b),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},v)],Pt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Y),this.removeHandles(Pt),this._featureTiles=p(this.featureTiles),this._set(`pointsOfInterest`,p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=De(t,e);n!==this.renderSpatialReference&&(this.renderCoordsHelper.viewingMode=this.state.viewingMode,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(g(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&be(e,this.groundView.spatialReference,It,t)&&(this.renderCoordsHelper.extent=It)},v),Y),this.sceneIntersectionHelper?.setTolerance(R/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(Y)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(g(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),v),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(e){let t={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,context:e,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},n=new Ye(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,n);let r=te(this.surface);this._stage=new Ct({view:this,options:t,container:r}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),ne(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new u(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(R/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=p(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface();let e=vt(this.renderCanvas,{alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled});this._initStage(e),this._initGlobe(),this.sharedSymbolResources=new dt({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>y(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){q(this.viewingMode)===1&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(h(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?s(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(z);for(let t of this.allLayerViews)(O(t.layer)&&w.shouldIntersectAsGround(t.layer)||Me(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(z);for(let t of this.allLayerViews)O(t.layer)&&w.shouldIntersectAsGround(t.layer)&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Re(),ee(),he(),xt(),$e(),Be(),we(),Ot(),Pe(),_t(),St(),Je(),Ze(),ae(),fe(),bt(),gt(),Ke.cleanupI3SLodHandling(),Ne.cleanupTilemapCache(),M.cleanupViewstate(),L.cleanupTerrainSurface()}};e([n({nonNullable:!0}),r(Ft)],X.prototype,`options`,void 0),e([n()],X.prototype,`_userClippingArea`,void 0),e([n()],X.prototype,`_resourceController`,void 0),e([n()],X.prototype,`stage`,null),e([n({readOnly:!0})],X.prototype,`deconflictor`,void 0),e([n({readOnly:!0})],X.prototype,`labeler`,void 0),e([n()],X.prototype,`navigation`,void 0),e([n({type:Nt,readOnly:!0})],X.prototype,`animation`,null),e([n({readOnly:!0})],X.prototype,`basemapTerrain`,void 0),e([n({readOnly:!0})],X.prototype,`overlayManager`,null),e([n({readOnly:!0})],X.prototype,`elevationProvider`,void 0),e([n()],X.prototype,`camera`,null),e([n({type:t})],X.prototype,`contentCamera`,null),e([n({readOnly:!0})],X.prototype,`canvas`,null),e([n({type:ye,useTypeForAutocast:!1})],X.prototype,`center`,null),e([n({type:S})],X.prototype,`clippingArea`,null),e([n({type:k,nonNullable:!0})],X.prototype,`constraints`,void 0),e([n({type:S,readOnly:!0})],X.prototype,`renderDataExtent`,null),e([n({readOnly:!0})],X.prototype,`tileInfo`,null),e([n({type:S,readOnly:!0})],X.prototype,`dataExtent`,null),e([n({type:S,readOnly:!0})],X.prototype,`_groundAndLayersExtent`,null),e([n({type:A})],X.prototype,`environment`,null),e([r(`environment`)],X.prototype,`castEnvironment`,null),e([n({readOnly:!0})],X.prototype,`environmentView`,void 0),e([n({type:S})],X.prototype,`extent`,null),e([n({type:l})],X.prototype,`floors`,void 0),e([n()],X.prototype,`screenCenter`,null),e([n()],X.prototype,`frustum`,null),e([n({type:Number,readOnly:!0})],X.prototype,`fullOpacity`,void 0),e([n({readOnly:!0})],X.prototype,`graphicsView`,void 0),e([n()],X.prototype,`analysisViewManager`,void 0),e([n()],X.prototype,`groundView`,void 0),e([n({readOnly:!0})],X.prototype,`layerviewCollections`,null),e([n({type:Boolean})],X.prototype,`initialExtentRequired`,null),e([n()],X.prototype,`defaultsFromMapSettings`,null),e([n()],X.prototype,`interacting`,null),e([n()],X.prototype,`stationary`,null),e([n()],X.prototype,`navigating`,null),e([n()],X.prototype,`map`,void 0),e([n()],X.prototype,`padding`,null),e([n({type:P,readOnly:!0})],X.prototype,`pointsOfInterest`,void 0),e([n()],X.prototype,`_featureTiles`,void 0),e([n()],X.prototype,`featureTiles`,null),e([n()],X.prototype,`_featureTreeDebugger`,void 0),e([n({constructOnly:!0})],X.prototype,`deactivatedWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`debugWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`renderCanvas`,void 0),e([n({constructOnly:!0})],X.prototype,`state`,void 0),e([n()],X.prototype,`screenSizePerspective`,void 0),e([n({readOnly:!0})],X.prototype,`inputManager`,void 0),e([n({readOnly:!0})],X.prototype,`stateManager`,void 0),e([n({type:[`low`,`medium`,`high`]})],X.prototype,`qualityProfile`,null),e([n({type:I,get(){let e=this._get(`qualitySettings`);if(!e){let t=F(this.qualityProfile);e=new I(t)}return e}})],X.prototype,`qualitySettings`,void 0),e([n()],X.prototype,`slice`,void 0),e([n({readOnly:!0})],X.prototype,`typeSpecificPreconditionsReady`,null),e([n({readOnly:!0})],X.prototype,`sceneIntersectionHelper`,void 0),e([n({type:Number,readOnly:!0})],X.prototype,`resolution`,null),e([n({type:Number})],X.prototype,`scale`,null),e([n({readOnly:!0,type:Number})],X.prototype,`terrainLevel`,null),e([n()],X.prototype,`heightModelInfo`,null),e([n({type:C})],X.prototype,`spatialReference`,void 0),e([n({type:Boolean,value:!1})],X.prototype,`alphaCompositingEnabled`,null),e([n({constructOnly:!0})],X.prototype,`preserveDrawingBufferEnabled`,void 0),e([n({type:Boolean})],X.prototype,`supersampleScreenshotsEnabled`,void 0),e([n({readOnly:!0})],X.prototype,`type`,void 0),e([n(),r(e=>e instanceof Mt?e:o(W,e))],X.prototype,`ui`,void 0),e([n({type:Boolean,readOnly:!0})],X.prototype,`updating`,null),e([n()],X.prototype,`_updatingObjects`,null),e([n()],X.prototype,`_updatingObjectsWithProgress`,null),e([n()],X.prototype,`_updatingObjectsToDebug`,null),e([n({type:Number,readOnly:!0})],X.prototype,`updatingProgress`,void 0),e([n({type:[`global`,`local`]})],X.prototype,`viewingMode`,null),e([n({type:Ie})],X.prototype,`viewpoint`,null),e([n({readOnly:!0})],X.prototype,`visibleArea`,null),e([n({type:Number})],X.prototype,`zoom`,null),e([n({readOnly:!0})],X.prototype,`quality`,null),e([n({readOnly:!0})],X.prototype,`resolutionScale`,null),e([n()],X.prototype,`focusAreasView`,void 0),e([n()],X.prototype,`_defaultToMapOptions`,null),e([n()],X.prototype,`_defaultHitTestOptions`,null),X=J=e([i(`esri.views.SceneView`)],X);function Z(e,t){return e!=null&&Ce(e.spatialReference,t)?Se(e,t):null}const Q=ie(),$=me(),It=Ee(),Lt=je(0,0,0,C.WebMercator),Rt={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},zt=X;export{zt as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a,ensureClass as o}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as s}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as c}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ee}from"../core/accessorSupport/trackingUtils.js";import l from"../core/Collection.js";import{byId as te}from"../core/domUtils.js";import u from"../core/Error.js";import{on as ne}from"../core/events.js";import{destroyHandle as re,makeHandle as d}from"../core/handleUtils.js";import has from"../core/has.js";import{create as ie}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ae}from"../core/libs/rbush/PooledRBush.js";import f from"../core/Logger.js";import{mapCollectionAsync as oe}from"../core/mapCollectionUtils.js";import{destroyMaybe as p,maybeProperty as se}from"../core/maybe.js";import{throwIfDestroyed as ce,throwIfAborted as le,createAbortError as ue}from"../core/promiseUtils.js";import de from"../core/ReactiveSet.js";import{on as fe,watch as m,initial as pe,sync as h,whenOnce as g,syncAndInitial as _}from"../core/reactiveUtils.js";import{cleanupScheduling as me}from"../core/scheduling.js";import{createScreenPoint as he,createScreenPointArray as ge}from"../core/screenUtils.js";import{cleanupWhereClauseCache as _e}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as ve,getMetersPerUnitForSR as v}from"../core/units.js";import{initialize as ye}from"../core/workers/workers.js";import y from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import b from"../geometry/Point.js";import{projectBoundingRect as xe}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as x}from"../geometry/projection/projectPointToVector.js";import{project as S,canProjectWithoutEngine as Se}from"../geometry/projectionUtils.js";import C from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Ce}from"../geometry/spatialReferenceEllipsoidUtils.js";import{toExtent as we,create as Te}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Ee}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as De}from"../geometry/support/scaleUtils.js";import{wgs84 as Oe,webMercator as ke}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as Ae}from"../layers/graphics/dehydratedPoint.js";import{IntegratedMeshSemantics as w}from"../layers/support/IntegratedMeshSemantics.js";import{isImageryTileLayer as T,isTiledLayer as E,isVoxelLayer as D,isIntegratedMeshLayer as O,isGaussianSplatLayer as je}from"../layers/support/layerUtils.js";import{TilemapCache as Me}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Ne}from"../portal/portalDefault.js";import{WebSceneTag as Pe}from"../support/tagSymbols.js";import Fe from"../Viewpoint.js";import Ie from"../webscene/Environment.js";import{clearVNodeCache as Le}from"../widgets/support/vnodeCache.js";import{importAnalysisViewModule as Re}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ze}from"./3d/camera/intersectionUtils.js";import k from"./3d/constraints/Constraints.js";import A from"./3d/environment/Environment.js";import{EnvironmentView as Be}from"./3d/environment/EnvironmentView.js";import{GroundView3D as Ve}from"./3d/GroundView3D.js";import He from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as Ue}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as We}from"./3d/layers/graphics/Labeler.js";import Ge from"./3d/layers/i3s/I3SLodHandling.js";import{layerView3DImporter as j}from"./3d/layerViewModuleImportUtils.js";import{Navigation3D as Ke}from"./3d/navigation/Navigation3D.js";import{cleanupPointToPointAnimationController as qe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Je}from"./3d/state/helpers/SceneIntersectionHelper.js";import{ScreenSizePerspective as Ye}from"./3d/state/ScreenSizePerspective.js";import{cleanupNavigationUtils as Xe}from"./3d/state/utils/navigationUtils.js";import M from"./3d/state/ViewState.js";import{ViewStateManager as Ze,cleanupViewStateManager as Qe}from"./3d/state/ViewStateManager.js";import $e from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as et}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as N}from"./3d/support/debugFlags.js";import{getElevationAtPoint as tt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as nt}from"./3d/support/GroundAndIMSurface.js";import{toMap as rt,hitTest as it}from"./3d/support/hitTest.js";import{PointsOfInterest as P}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import{popupHitTest as at}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as ot,getQualityProfileSettings as F}from"./3d/support/QualityProfile.js";import I from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as st}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as ct}from"./3d/support/ResourceController.js";import lt from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as ut}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as dt}from"./3d/support/ViewSlice.js";import L from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as ft,getTiledLayerInfo as pt,checkIfTileInfoSupportedForView as mt}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as ht}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as gt}from"./3d/terrain/TileRenderer.js";import{createWebGLContext as _t}from"./3d/webgl-engine/createWebGLContext.js";import{olidEnabled as vt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as yt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{cleanupEdgeProcessing as bt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import{defaultTolerance as R}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as z}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{Stage as St}from"./3d/webgl-engine/Stage.js";import{BreakpointsOwner as Ct}from"./BreakpointsOwner.js";import{DOMContainer as wt}from"./DOMContainer.js";import B from"./interactive/options/ViewOptions.js";import{PopupView as Tt}from"./PopupView.js";import Et from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as Dt}from"./support/drapedUtils.js";import{occludeesSupported as Ot}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as V,createScreenPointFromSupportedEvent as H}from"./support/screenUtils.js";import{isSpatialReferenceSupported as U}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as kt,destroyTextureCompressionWorker as At}from"./support/TextureCompressionHelper.js";import W from"./ui/3d/DefaultUI3D.js";import jt from"./ui/DefaultUI.js";import G from"./View.js";import Mt from"./ViewAnimation.js";import{stringFromIsGlobal as K,isGlobalFromString as q}from"./ViewingMode.js";var J;const Nt=Symbol(),Y=Symbol();function Pt(e){let t=o(B,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let X=class extends Ct(Tt(wt(G))){static{J=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new B({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=ct(this),this.deconflictor=new Ue({view:this}),this.attribution3D=new $e({view:this}),this.labeler=new We({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new Ke({view:this}),this.basemapTerrain=null,this.elevationProvider=new et({view:this}),this._canvas=null,this.constraints=new k,this._environment=new A,this.environmentView=new Be,this.floors=new l,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Et({importAnalysisViewModule:e=>Re(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new de,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new M({view:this}),this.slice=new dt,this.renderCoordsHelper=new st,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new W,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(re(oe(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([fe(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),m(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new He({view:this}),this.stateManager=new Ze({view:this}),this.screenSizePerspective=new Ye({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=kt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new Ve({view:this}),this.groundAndIMSurface=new nt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},pe),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},pe),this.addHandles([m(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),m(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(At(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set(`labeler`,p(this.labeler)),this._set(`deconflictor`,p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set(`stateManager`,p(this.stateManager)),this._set(`inputManager`,p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,p(this.environmentView)),this._set(`environment`,p(this.environment)),this.groundView=p(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=a(b,e))}get clippingArea(){if(this.state.isGlobal)return null;let e=this.map,t=this._userClippingArea||se(e,`clippingArea`);return!(this._userClippingArea||se(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof y?this.spatialReference&&(t=Z(t,this.spatialReference),t==null)?(f.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(f.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.state.isGlobal&&e!=null?f.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.isGlobal)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:Z(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||C.WGS84,n=Z(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||C.WGS84,t,n=n=>{let r=Z(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new y({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent==null||e.type===`graphics`&&e.internal||n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof A?e:e instanceof Ie?this.environment?.cloneWithWebsceneEnvironment(e)??A.fromWebsceneEnvironment(e):a(A,e):new A}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return J._layerToLayerview}static{this._layerToLayerview=G._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=F(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new I(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||ot()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?c(()=>De(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=ve(this.spatialReference);if(t&&e.heightUnit!==t)return new be({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&f.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||ft(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return N.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this.groundView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return N.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedGlobalMode;if(e!=null)return K(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?K(this.defaultsFromMap.viewingMode===1):U(t,!0)?`global`:`local`:`global`}set viewingMode(e){this.ready?f.getLogger(this).error(`#viewingMode`,`viewingMode cannot be set once view is ready`):this._overrideIfSome(`viewingMode`,e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new lt(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return f.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return rt(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return f.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=It,t.x=e.x,t.y=e.y,t.z=tt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),x(t,Q,this.renderSpatialReference),this.state.camera.projectToScreen(Q,$),he($[0],$[1])}pixelSizeAt(e,t){if(!this.ready)return f.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;x(e,Q,n);let r=this.state.camera.computeScreenPixelSizeAt(Q);return t&&n!==t?r*v(n)/v(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return f.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return it(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return at(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new u(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!vt())throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),a=await this._completeSettings(e);return a.format=`png`,[i,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return j.importLayerView(e)}hasLayerViewModule(e){return j.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedGlobalMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:q(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedGlobalMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n==null?[...r(!0)??[],...r(!1)??[]]:r(n);return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return U(e,n)?t==null||T(t)?!0:!(E(t)&&pt(t,e,n)==null||D(t)&&n):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,isGlobal:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?C.WGS84:C.WebMercator:new C({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return T(t)&&(i||a)?!(a&&r!==!1)||mt(t.tileInfo,t.fullExtent,e,!0)===null?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:[{spatialReference:c(),isGlobal:n}]:!E(t)&&!D(t)&&(i||a)?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:E(t)&&i&&!n?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:!1}]:[{spatialReference:e,isGlobal:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedGlobalMode;return t||(n==null?e.isGeographic&&f.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):f.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${K(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return f.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return f.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&Ot(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await g(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),d(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await Lt[e]();if(t&&(ce(this),le(n.signal),await t(n.signal)),this.destroyed)throw ue();return le(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new L({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new P({view:this})),this.addHandles([this.updatingHandles.add(()=>N.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&N.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?S(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},h)],Nt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Y),this.removeHandles(Nt),this._featureTiles=p(this.featureTiles),this._set(`pointsOfInterest`,p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Ee(t,e);n!==this.renderSpatialReference&&(this.renderCoordsHelper.isGlobal=this.state.isGlobal,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(m(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&xe(e,this.groundView.spatialReference,Ft,t)&&(this.renderCoordsHelper.extent=Ft)},h),Y),this.sceneIntersectionHelper?.setTolerance(R/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(Y)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(m(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),h),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(e){let t={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,context:e,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},n=new Je(this.state.isGlobal,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,n);let r=te(this.surface);this._stage=new St({view:this,options:t,container:r}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),ne(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new u(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(R/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=p(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface();let e=_t(this.renderCanvas,{alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled});this._initStage(e),this._initGlobe(),this.sharedSymbolResources=new ut({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>g(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){q(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(fe(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?s(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(z);for(let t of this.allLayerViews)(O(t.layer)&&w.shouldIntersectAsGround(t.layer)||je(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(z);for(let t of this.allLayerViews)O(t.layer)&&w.shouldIntersectAsGround(t.layer)&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Le(),ee(),_e(),bt(),Qe(),ze(),Ce(),Dt(),Ne(),gt(),xt(),qe(),Xe(),ae(),me(),yt(),ht(),Ge.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),M.cleanupViewstate(),L.cleanupTerrainSurface()}};e([n({nonNullable:!0}),r(Pt)],X.prototype,`options`,void 0),e([n()],X.prototype,`_userClippingArea`,void 0),e([n()],X.prototype,`_resourceController`,void 0),e([n()],X.prototype,`stage`,null),e([n({readOnly:!0})],X.prototype,`deconflictor`,void 0),e([n({readOnly:!0})],X.prototype,`labeler`,void 0),e([n()],X.prototype,`navigation`,void 0),e([n({type:Mt,readOnly:!0})],X.prototype,`animation`,null),e([n({readOnly:!0})],X.prototype,`basemapTerrain`,void 0),e([n({readOnly:!0})],X.prototype,`overlayManager`,null),e([n({readOnly:!0})],X.prototype,`elevationProvider`,void 0),e([n()],X.prototype,`camera`,null),e([n({type:t})],X.prototype,`contentCamera`,null),e([n({readOnly:!0})],X.prototype,`canvas`,null),e([n({type:b,useTypeForAutocast:!1})],X.prototype,`center`,null),e([n({type:y})],X.prototype,`clippingArea`,null),e([n({type:k,nonNullable:!0})],X.prototype,`constraints`,void 0),e([n({type:y,readOnly:!0})],X.prototype,`renderDataExtent`,null),e([n({readOnly:!0})],X.prototype,`tileInfo`,null),e([n({type:y,readOnly:!0})],X.prototype,`dataExtent`,null),e([n({type:y,readOnly:!0})],X.prototype,`_groundAndLayersExtent`,null),e([n({type:A})],X.prototype,`environment`,null),e([r(`environment`)],X.prototype,`castEnvironment`,null),e([n({readOnly:!0})],X.prototype,`environmentView`,void 0),e([n({type:y})],X.prototype,`extent`,null),e([n({type:l})],X.prototype,`floors`,void 0),e([n()],X.prototype,`screenCenter`,null),e([n()],X.prototype,`frustum`,null),e([n({type:Number,readOnly:!0})],X.prototype,`fullOpacity`,void 0),e([n({readOnly:!0})],X.prototype,`graphicsView`,void 0),e([n()],X.prototype,`analysisViewManager`,void 0),e([n()],X.prototype,`groundView`,void 0),e([n({readOnly:!0})],X.prototype,`layerviewCollections`,null),e([n({type:Boolean})],X.prototype,`initialExtentRequired`,null),e([n()],X.prototype,`defaultsFromMapSettings`,null),e([n()],X.prototype,`interacting`,null),e([n()],X.prototype,`stationary`,null),e([n()],X.prototype,`navigating`,null),e([n()],X.prototype,`map`,void 0),e([n()],X.prototype,`padding`,null),e([n({type:P,readOnly:!0})],X.prototype,`pointsOfInterest`,void 0),e([n()],X.prototype,`_featureTiles`,void 0),e([n()],X.prototype,`featureTiles`,null),e([n()],X.prototype,`_featureTreeDebugger`,void 0),e([n({constructOnly:!0})],X.prototype,`deactivatedWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`debugWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`renderCanvas`,void 0),e([n({constructOnly:!0})],X.prototype,`state`,void 0),e([n()],X.prototype,`screenSizePerspective`,void 0),e([n({readOnly:!0})],X.prototype,`inputManager`,void 0),e([n({readOnly:!0})],X.prototype,`stateManager`,void 0),e([n({type:[`low`,`medium`,`high`]})],X.prototype,`qualityProfile`,null),e([n({type:I,get(){let e=this._get(`qualitySettings`);if(!e){let t=F(this.qualityProfile);e=new I(t)}return e}})],X.prototype,`qualitySettings`,void 0),e([n()],X.prototype,`slice`,void 0),e([n({readOnly:!0})],X.prototype,`typeSpecificPreconditionsReady`,null),e([n({readOnly:!0})],X.prototype,`sceneIntersectionHelper`,void 0),e([n({type:Number,readOnly:!0})],X.prototype,`resolution`,null),e([n({type:Number})],X.prototype,`scale`,null),e([n({readOnly:!0,type:Number})],X.prototype,`terrainLevel`,null),e([n()],X.prototype,`heightModelInfo`,null),e([n({type:C})],X.prototype,`spatialReference`,void 0),e([n({type:Boolean,value:!1})],X.prototype,`alphaCompositingEnabled`,null),e([n({constructOnly:!0})],X.prototype,`preserveDrawingBufferEnabled`,void 0),e([n({type:Boolean})],X.prototype,`supersampleScreenshotsEnabled`,void 0),e([n({readOnly:!0})],X.prototype,`type`,void 0),e([n(),r(e=>e instanceof jt?e:o(W,e))],X.prototype,`ui`,void 0),e([n({type:Boolean,readOnly:!0})],X.prototype,`updating`,null),e([n()],X.prototype,`_updatingObjects`,null),e([n()],X.prototype,`_updatingObjectsWithProgress`,null),e([n()],X.prototype,`_updatingObjectsToDebug`,null),e([n({type:Number,readOnly:!0})],X.prototype,`updatingProgress`,void 0),e([n({type:[`global`,`local`]})],X.prototype,`viewingMode`,null),e([n({type:Fe})],X.prototype,`viewpoint`,null),e([n({readOnly:!0})],X.prototype,`visibleArea`,null),e([n({type:Number})],X.prototype,`zoom`,null),e([n({readOnly:!0})],X.prototype,`quality`,null),e([n({readOnly:!0})],X.prototype,`resolutionScale`,null),e([n()],X.prototype,`focusAreasView`,void 0),e([n()],X.prototype,`_defaultToMapOptions`,null),e([n()],X.prototype,`_defaultHitTestOptions`,null),X=J=e([i(`esri.views.SceneView`)],X);function Z(e,t){return e!=null&&Se(e.spatialReference,t)?S(e,t):null}const Q=ie(),$=ge(),Ft=Te(),It=Ae(0,0,0,C.WebMercator),Lt={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Rt=X;export{Rt as default};
|
package/views/View2D.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,cast as n,subclass as r}from"../core/accessorSupport/decorators.js";import{ensureClass as i}from"../core/accessorSupport/ensureType.js";import a from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import s from"../core/Error.js";import"../core/has.js";import c from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{watch as u,syncAndInitial as d}from"../core/reactiveUtils.js";import{isScreenPoint as f,screenRectToPolygon as p,createScreenPoint as m}from"../core/screenUtils.js";import{initialize as h}from"../core/workers/workers.js";import g from"../geometry/Point.js";import _ from"../geometry/Polygon.js";import{isLoadedOrLoadFor as v}from"../geometry/projectionUtils.js";import y from"../layers/support/TileInfo.js";import b from"../Viewpoint.js";import x from"../webmap/background/ColorBackground.js";import{isWebMap as S}from"../webmap/utils.js";import{importAnalysisViewModule as C}from"./2d/analysis/analysisViewModuleImportUtils.js";import w from"./2d/AnimationManager.js";import T from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as E}from"./2d/layers/support/util.js";import{layerView2DImporter as D}from"./2d/layerViewModuleImportUtils.js";import{hitTest as O}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as k,takeScreenshot as A}from"./2d/support/screenshotUtils.js";import{Timeline as j}from"./2d/support/Timeline.js";import M from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as N}from"./2d/viewpointUtils.js";import{BreakpointsOwner as P}from"./BreakpointsOwner.js";import{DOMContainer as F}from"./DOMContainer.js";import I from"./navigation/Navigation.js";import L from"./navigation/NavigationActionMap.js";import{PopupView as R}from"./PopupView.js";import z from"./support/AnalysisViewManager.js";import B from"./ui/2d/DefaultUI2D.js";import V from"./ui/DefaultUI.js";import H from"./View.js";import{Viewport2DBaseMixin as U}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as W}from"./Viewport2DMixin.js";import{RenderingContextOptions as G}from"./webgl/RenderingContextOptions.js";let K,q,J,Y,X,Z;async function Q(){let[,{GraphicsView2D:e,GraphicContainer:t,MapViewNavigation:n,MagnifierView2D:r,GridView2D:i,Stage:a}]=await Promise.all([import(`./2d/webglDeps.js`),import(`./2d/mapViewDeps.js`)]);q=e,J=t,Y=n,X=r,Z=i,K=a}let $=class extends W(U(P(R(F(H))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new o({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.navigation=new I({actionMap:new L({dragTertiary:`none`})}),this.renderingOptions={samplingMode:`dynamic`,edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analysisViewManager=new z({importAnalysisViewModule:e=>C(e),view:this}),this.floors=new a,this.grid=null,this.map=null,this.timeline=new j,this.type=`2d`,this.view2dType=null,this.ui=new B,this.test={takeScreenshot:async e=>k(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},h()}destroy(){this.layerViewManager.clear(),this._set(`preconditionsReady`,!1),this.frameTask=l(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set(`inputManager`,null)}get graphicsTileStore(){return new T(this.featuresTilingScheme)}get constraintsInfo(){let e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;let{scale:e,constraints:t,center:n,viewpoint:r,extent:i}=this,a=this.zoom;return!(this.map&&`initialViewProperties`in this.map&&this.map.initialViewProperties?.viewpoint||i||(t?.effectiveLODs||(a=-1),n&&(e!==0||a!==-1))||r?.targetGeometry!=null&&(r.targetGeometry.type===`extent`||r.scale))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){let e=this._getDefaultViewpoint();if(!e)return!1;let t=e.targetGeometry,n=this.spatialReference;return v(t.spatialReference,n)}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get background(){return S(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override(`background`,e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get(`spatialReferenceLocked`)}set spatialReferenceLocked(e){this.stage&&c.getLogger(this).warn(`spatialReferenceLocked cannot be changed after the view has become ready`),this._set(`spatialReferenceLocked`,e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){if(this.destroying||this.destroyed)return!1;let{analysisViewManager:e,allLayerViews:t,frameTask:n,graphicsView:r,inputManager:i,layerViewManager:a,magnifier:o,map:s,ready:c,rendering:l,selectionManager:u,stationary:d,toolViewManager:f,updatingHandles:p,stage:m}=this,h=s?.basemap,g=s?.ground,_=h?.loadStatus===`loading`,v=g?.loadStatus===`loading`,y=_||v||!!s?.allLayers?.some(e=>e.parent!==g&&!e.isFulfilled()),b=!m||m.updating,x=!p||p.updating,S=!e||e.updating,C=!f||f.updating,w=!i||i.updating,T=!r||r.updating,E=!n||n.updating,D=!a||a.updating,O=!u||u.updating,k=!!(o.visible&&o.position!==null&&this._magnifierView?.updatingHandles.updating),A=t.some(e=>e.updating&&!e.destroyed);return!c||!d||l||y||A||k||x||S||E||C||w||D||T||O||b}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){let e=this.stateManager.visibleArea;return e&&new _({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference})}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return O(this,e,t)}async takeScreenshot(e){return A(this._getScreenshotView(e),e)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(e.parent==null)throw new s(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){this.graphicsView&&this.graphicsView.graphicUpdateHandler(e)}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}zoomIn(){return super.zoomIn()}zoomOut(){return super.zoomOut()}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.map&&`initialViewProperties`in this.map?this.map.initialViewProperties.spatialReference:null}getDefaultTimeZone(){return S(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return S(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return D.hasLayerViewModule(e)}importLayerView(e){return D.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(c.getLogger(this).error(`#pixelSizeAt()`,`Map view cannot be used before it is ready`),null)}async popupHitTest(e){let t=f(e)?this.toMap(e):p(this,e),n=f(e)?e:m(e.x+e.width/2,e.y+e.height/2),r=this.toMap(n),i=await this.hitTest(e),a=new Set(this.allLayerViews),o=this.allLayerViews.filter(e=>!e.suspended&&a.has(e)).reverse(),s=new globalThis.Map(o.map(e=>[e.layer.uid,e])),c=[],l=0,u=0;for(;l<i.results.length||u<o.length;){let e=i.results.at(l);if(e&&e.type!==`graphic`){++l;continue}let n=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||n)&&u<o.length&&o.at(u)!==n){let e=o.at(u);`fetchPopupFeaturesAtTarget`in e&&c.push({geometry:t,layerView:e}),++u}else e&&(c.push({graphic:e.graphic,layerView:n}),++l)}return{hits:c,location:r}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return Q()}_getDefaultViewpoint(){let{constraints:e,initialExtent:t,map:n,padding:r,size:i}=this;if(!e)return null;let a=n&&`initialViewProperties`in n?n.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),s=a?.viewpoint,c=s?.targetGeometry?.extent??t,l=c?.center,u=s?.rotation??0,d=s?.scale||c&&N(c,[i[0]-r.left-r.right,i[1]-r.top-r.bottom]),f=o.center??l,p=o.rotation??u,m=o.scale??d;return!f||!m?null:new b({targetGeometry:f,scale:m,rotation:p})}_startup(){this.timeline.begin(`MapView Startup`);let e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;let t=this._createFeaturesTilingScheme(),n=new K(this._getOrCreateRenderCanvas(),{contextOptions:new G(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),featuresTilingScheme:t,renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=n,this._magnifierView=new X,this._magnifierView.magnifier=this.magnifier,this._gridView=new Z;let r=new w({view:this});this._set(`animationManager`,r);let i=new Y({view:this,animationManager:r});this._set(`mapViewNavigation`,i),this._setupSpatialReferenceDependentProperties(t),this.addHandles([this.rootLayerViews.on(`change`,()=>this._updateStageChildren()),n.on(`webgl-error`,e=>this.fatalError=e.error),u(()=>this.stationary,e=>n.stationary=e,d),u(()=>this.background,e=>{n.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},d),u(()=>this.magnifier,e=>this._magnifierView.magnifier=e,d),u(()=>this.grid,e=>this._gridView.grid=e,d),u(()=>this.renderingOptions,e=>n.renderingOptions=e,d),u(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{n.highlightGradient=E(n.highlightGradient,this.highlights.items)},d),u(()=>this.state.id,()=>n.state=this.state,d),u(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,d)],`map-view`),this._updateStageChildren();let a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach(e=>e(this)),this.timeline.end(`MapView Startup`),this.frameTask.start(),this._set(`ready`,!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles(`map-view`),this.mapViewNavigation.destroy(),this._set(`mapViewNavigation`,null),this.animation=null,this.animationManager.destroy(),this._set(`animationManager`,null),this.layerViewManager.clear(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set(`graphicsView`,null),this._magnifierView=null,this._gridView=null,this._set(`mapViewNavigation`,null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set(`ready`,!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});let e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(e=this._createFeaturesTilingScheme()){this._set(`featuresTilingScheme`,e),this.stage.labelManager.featuresTilingScheme=e;let t=new q({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new J(e,!0)});this._set(`graphicsView`,t)}_createFeaturesTilingScheme(){return new M(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}))}_destroySpatialReferenceDependentProperties(){let e=this.graphicsView;this._set(`graphicsView`,null),e.destroy(),this._set(`featuresTilingScheme`,null)}_getScreenshotView(e){let{allLayerViews:t,padding:n,size:r,stage:i}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:n,size:r,stage:i}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(let e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(let e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type=`2d`}};e([t()],$.prototype,`_magnifierView`,void 0),e([t()],$.prototype,`_gridView`,void 0),e([t({constructOnly:!0})],$.prototype,`deactivatedWebGLExtensions`,void 0),e([t({constructOnly:!0})],$.prototype,`debugWebGLExtensions`,void 0),e([t({readOnly:!0})],$.prototype,`featuresTilingScheme`,void 0),e([t({readOnly:!0})],$.prototype,`graphicsTileStore`,null),e([t()],$.prototype,`graphicsView`,void 0),e([t()],$.prototype,`constraintsInfo`,null),e([t()],$.prototype,`initialExtentRequired`,null),e([t({type:I,nonNullable:!0})],$.prototype,`navigation`,void 0),e([t()],$.prototype,`renderingOptions`,void 0),e([t({constructOnly:!0})],$.prototype,`supersampleScreenshotsEnabled`,void 0),e([t()],$.prototype,`defaultsFromMapSettings`,null),e([t({readOnly:!0})],$.prototype,`typeSpecificPreconditionsReady`,null),e([t()],$.prototype,`analysisViewManager`,void 0),e([t({type:x})],$.prototype,`background`,null),e([t({type:g})],$.prototype,`center`,null),e([t({type:a})],$.prototype,`floors`,void 0),e([t()],$.prototype,`grid`,void 0),e([t()],$.prototype,`map`,void 0),e([t()],$.prototype,`padding`,null),e([t({readOnly:!0})],$.prototype,`rendering`,null),e([t({readOnly:!0})],$.prototype,`resolution`,null),e([t()],$.prototype,`scale`,null),e([t({type:Boolean,value:!1})],$.prototype,`spatialReferenceLocked`,null),e([t({readOnly:!0})],$.prototype,`tileInfo`,null),e([t({type:j,readOnly:!0})],$.prototype,`timeline`,void 0),e([t({readOnly:!0})],$.prototype,`type`,void 0),e([t({type:Boolean,readOnly:!0})],$.prototype,`updating`,null),e([t({readOnly:!0})],$.prototype,`view2dType`,void 0),e([t({readOnly:!0})],$.prototype,`visibleArea`,null),e([t()],$.prototype,`zoom`,null),e([t({readOnly:!0})],$.prototype,`navigating`,null),e([t(),n(e=>e instanceof V?e:i(B,e))],$.prototype,`ui`,void 0),$=e([r(`esri.views.View2D`)],$);const ee=$;export{ee as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,cast as n,subclass as r}from"../core/accessorSupport/decorators.js";import{ensureClass as i}from"../core/accessorSupport/ensureType.js";import a from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import s from"../core/Error.js";import"../core/has.js";import c from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{watch as u,syncAndInitial as d}from"../core/reactiveUtils.js";import{isScreenPoint as f,screenRectToPolygon as p,createScreenPoint as m}from"../core/screenUtils.js";import{initialize as h}from"../core/workers/workers.js";import g from"../geometry/Point.js";import _ from"../geometry/Polygon.js";import{isLoadedOrLoadFor as v}from"../geometry/projectionUtils.js";import y from"../layers/support/TileInfo.js";import b from"../Viewpoint.js";import x from"../webmap/background/ColorBackground.js";import{isWebMap as S}from"../webmap/utils.js";import{importAnalysisViewModule as C}from"./2d/analysis/analysisViewModuleImportUtils.js";import w from"./2d/AnimationManager.js";import T from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as E}from"./2d/layers/support/util.js";import{layerView2DImporter as D}from"./2d/layerViewModuleImportUtils.js";import{hitTest as O}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as k,takeScreenshot as A}from"./2d/support/screenshotUtils.js";import{Timeline as j}from"./2d/support/Timeline.js";import M from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as N}from"./2d/viewpointUtils.js";import{BreakpointsOwner as P}from"./BreakpointsOwner.js";import{DOMContainer as F}from"./DOMContainer.js";import I from"./navigation/Navigation.js";import L from"./navigation/NavigationActionMap.js";import{PopupView as R}from"./PopupView.js";import z from"./support/AnalysisViewManager.js";import B from"./ui/2d/DefaultUI2D.js";import V from"./ui/DefaultUI.js";import H from"./View.js";import{Viewport2DBaseMixin as U}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as W}from"./Viewport2DMixin.js";import{RenderingContextOptions as G}from"./webgl/RenderingContextOptions.js";let K,q,J,Y,X,Z;async function Q(){let[,{GraphicsView2D:e,GraphicContainer:t,MapViewNavigation:n,MagnifierView2D:r,GridView2D:i,Stage:a}]=await Promise.all([import(`./2d/webglDeps.js`),import(`./2d/mapViewDeps.js`)]);q=e,J=t,Y=n,X=r,Z=i,K=a}let $=class extends W(U(P(R(F(H))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new o({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.navigation=new I({actionMap:new L({dragTertiary:`none`})}),this.renderingOptions={samplingMode:`dynamic`,edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analysisViewManager=new z({importAnalysisViewModule:e=>C(e),view:this}),this.floors=new a,this.grid=null,this.map=null,this.timeline=new j,this.type=`2d`,this.viewingMode=`local`,this.view2dType=null,this.ui=new B,this.test={takeScreenshot:async e=>k(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},h()}destroy(){this.layerViewManager.clear(),this._set(`preconditionsReady`,!1),this.frameTask=l(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set(`inputManager`,null)}get graphicsTileStore(){return new T(this.featuresTilingScheme)}get constraintsInfo(){let e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;let{scale:e,constraints:t,center:n,viewpoint:r,extent:i}=this,a=this.zoom;return!(this.map&&`initialViewProperties`in this.map&&this.map.initialViewProperties?.viewpoint||i||(t?.effectiveLODs||(a=-1),n&&(e!==0||a!==-1))||r?.targetGeometry!=null&&(r.targetGeometry.type===`extent`||r.scale))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){let e=this._getDefaultViewpoint();if(!e)return!1;let t=e.targetGeometry,n=this.spatialReference;return v(t.spatialReference,n)}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get background(){return S(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override(`background`,e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get(`spatialReferenceLocked`)}set spatialReferenceLocked(e){this.stage&&c.getLogger(this).warn(`spatialReferenceLocked cannot be changed after the view has become ready`),this._set(`spatialReferenceLocked`,e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){if(this.destroying||this.destroyed)return!1;let{analysisViewManager:e,allLayerViews:t,frameTask:n,graphicsView:r,inputManager:i,layerViewManager:a,magnifier:o,map:s,ready:c,rendering:l,selectionManager:u,stationary:d,toolViewManager:f,updatingHandles:p,stage:m}=this,h=s?.basemap,g=s?.ground,_=h?.loadStatus===`loading`,v=g?.loadStatus===`loading`,y=_||v||!!s?.allLayers?.some(e=>e.parent!==g&&!e.isFulfilled()),b=!m||m.updating,x=!p||p.updating,S=!e||e.updating,C=!f||f.updating,w=!i||i.updating,T=!r||r.updating,E=!n||n.updating,D=!a||a.updating,O=!u||u.updating,k=!!(o.visible&&o.position!==null&&this._magnifierView?.updatingHandles.updating),A=t.some(e=>e.updating&&!e.destroyed);return!c||!d||l||y||A||k||x||S||E||C||w||D||T||O||b}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){let e=this.stateManager.visibleArea;return e&&new _({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference})}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return O(this,e,t)}async takeScreenshot(e){return A(this._getScreenshotView(e),e)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(e.parent==null)throw new s(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){this.graphicsView&&this.graphicsView.graphicUpdateHandler(e)}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}zoomIn(){return super.zoomIn()}zoomOut(){return super.zoomOut()}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.map&&`initialViewProperties`in this.map?this.map.initialViewProperties.spatialReference:null}getDefaultTimeZone(){return S(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return S(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return D.hasLayerViewModule(e)}importLayerView(e){return D.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(c.getLogger(this).error(`#pixelSizeAt()`,`Map view cannot be used before it is ready`),null)}async popupHitTest(e){let t=f(e)?this.toMap(e):p(this,e),n=f(e)?e:m(e.x+e.width/2,e.y+e.height/2),r=this.toMap(n),i=await this.hitTest(e),a=new Set(this.allLayerViews),o=this.allLayerViews.filter(e=>!e.suspended&&a.has(e)).reverse(),s=new globalThis.Map(o.map(e=>[e.layer.uid,e])),c=[],l=0,u=0;for(;l<i.results.length||u<o.length;){let e=i.results.at(l);if(e&&e.type!==`graphic`){++l;continue}let n=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||n)&&u<o.length&&o.at(u)!==n){let e=o.at(u);`fetchPopupFeaturesAtTarget`in e&&c.push({geometry:t,layerView:e}),++u}else e&&(c.push({graphic:e.graphic,layerView:n}),++l)}return{hits:c,location:r}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return Q()}_getDefaultViewpoint(){let{constraints:e,initialExtent:t,map:n,padding:r,size:i}=this;if(!e)return null;let a=n&&`initialViewProperties`in n?n.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),s=a?.viewpoint,c=s?.targetGeometry?.extent??t,l=c?.center,u=s?.rotation??0,d=s?.scale||c&&N(c,[i[0]-r.left-r.right,i[1]-r.top-r.bottom]),f=o.center??l,p=o.rotation??u,m=o.scale??d;return!f||!m?null:new b({targetGeometry:f,scale:m,rotation:p})}_startup(){this.timeline.begin(`MapView Startup`);let e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;let t=this._createFeaturesTilingScheme(),n=new K(this._getOrCreateRenderCanvas(),{contextOptions:new G(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),featuresTilingScheme:t,renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=n,this._magnifierView=new X,this._magnifierView.magnifier=this.magnifier,this._gridView=new Z;let r=new w({view:this});this._set(`animationManager`,r);let i=new Y({view:this,animationManager:r});this._set(`mapViewNavigation`,i),this._setupSpatialReferenceDependentProperties(t),this.addHandles([this.rootLayerViews.on(`change`,()=>this._updateStageChildren()),n.on(`webgl-error`,e=>this.fatalError=e.error),u(()=>this.stationary,e=>n.stationary=e,d),u(()=>this.background,e=>{n.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},d),u(()=>this.magnifier,e=>this._magnifierView.magnifier=e,d),u(()=>this.grid,e=>this._gridView.grid=e,d),u(()=>this.renderingOptions,e=>n.renderingOptions=e,d),u(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{n.highlightGradient=E(n.highlightGradient,this.highlights.items)},d),u(()=>this.state.id,()=>n.state=this.state,d),u(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,d)],`map-view`),this._updateStageChildren();let a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach(e=>e(this)),this.timeline.end(`MapView Startup`),this.frameTask.start(),this._set(`ready`,!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles(`map-view`),this.mapViewNavigation.destroy(),this._set(`mapViewNavigation`,null),this.animation=null,this.animationManager.destroy(),this._set(`animationManager`,null),this.layerViewManager.clear(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set(`graphicsView`,null),this._magnifierView=null,this._gridView=null,this._set(`mapViewNavigation`,null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set(`ready`,!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});let e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(e=this._createFeaturesTilingScheme()){this._set(`featuresTilingScheme`,e),this.stage.labelManager.featuresTilingScheme=e;let t=new q({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new J(e,!0)});this._set(`graphicsView`,t)}_createFeaturesTilingScheme(){return new M(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}))}_destroySpatialReferenceDependentProperties(){let e=this.graphicsView;this._set(`graphicsView`,null),e.destroy(),this._set(`featuresTilingScheme`,null)}_getScreenshotView(e){let{allLayerViews:t,padding:n,size:r,stage:i}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:n,size:r,stage:i}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(let e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(let e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type=`2d`}};e([t()],$.prototype,`_magnifierView`,void 0),e([t()],$.prototype,`_gridView`,void 0),e([t({constructOnly:!0})],$.prototype,`deactivatedWebGLExtensions`,void 0),e([t({constructOnly:!0})],$.prototype,`debugWebGLExtensions`,void 0),e([t({readOnly:!0})],$.prototype,`featuresTilingScheme`,void 0),e([t({readOnly:!0})],$.prototype,`graphicsTileStore`,null),e([t()],$.prototype,`graphicsView`,void 0),e([t()],$.prototype,`constraintsInfo`,null),e([t()],$.prototype,`initialExtentRequired`,null),e([t({type:I,nonNullable:!0})],$.prototype,`navigation`,void 0),e([t()],$.prototype,`renderingOptions`,void 0),e([t({constructOnly:!0})],$.prototype,`supersampleScreenshotsEnabled`,void 0),e([t()],$.prototype,`defaultsFromMapSettings`,null),e([t({readOnly:!0})],$.prototype,`typeSpecificPreconditionsReady`,null),e([t()],$.prototype,`analysisViewManager`,void 0),e([t({type:x})],$.prototype,`background`,null),e([t({type:g})],$.prototype,`center`,null),e([t({type:a})],$.prototype,`floors`,void 0),e([t()],$.prototype,`grid`,void 0),e([t()],$.prototype,`map`,void 0),e([t()],$.prototype,`padding`,null),e([t({readOnly:!0})],$.prototype,`rendering`,null),e([t({readOnly:!0})],$.prototype,`resolution`,null),e([t()],$.prototype,`scale`,null),e([t({type:Boolean,value:!1})],$.prototype,`spatialReferenceLocked`,null),e([t({readOnly:!0})],$.prototype,`tileInfo`,null),e([t({type:j,readOnly:!0})],$.prototype,`timeline`,void 0),e([t({readOnly:!0})],$.prototype,`type`,void 0),e([t({type:Boolean,readOnly:!0})],$.prototype,`updating`,null),e([t({readOnly:!0})],$.prototype,`view2dType`,void 0),e([t({readOnly:!0})],$.prototype,`visibleArea`,null),e([t()],$.prototype,`zoom`,null),e([t({readOnly:!0})],$.prototype,`navigating`,null),e([t(),n(e=>e instanceof V?e:i(B,e))],$.prototype,`ui`,void 0),$=e([r(`esri.views.View2D`)],$);const ee=$;export{ee as default};
|
package/views/ViewingMode.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
function e(e){return e===`global
|
|
2
|
+
function e(e){return e===`global`}function t(e){return e?`global`:`local`}export{e as isGlobalFromString,t as stringFromIsGlobal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{convertUnit as e}from"../../../core/units.js";import{getConfig as t}from"./constants.js";import{yAxisExtraFactorBottom as n,yAxisExtraFactorTop as r,minRange as i}from"./elevationProfileChartTheme.js";const a={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};function o({data:o,pixelWidth:l,pixelHeight:u}){if(!o)return a;let d=o.statistics,f=d?.maxDistance,p=d?.minElevation,m=d?.maxElevation;if(f==null||p==null||m==null)return a;let h=Math.max(f
|
|
2
|
+
import{convertUnit as e}from"../../../core/units.js";import{getConfig as t}from"./constants.js";import{yAxisExtraFactorBottom as n,yAxisExtraFactorTop as r,minRange as i}from"./elevationProfileChartTheme.js";const a={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};function o({data:o,pixelWidth:l,pixelHeight:u}){if(!o)return a;let d=o.statistics,f=d?.maxDistance,p=d?.minElevation,m=d?.maxElevation;if(f==null||p==null||m==null)return a;let h=Math.max(+f,i),g=Math.max(m-p,i),_=o.effectiveUnits;if(o.dynamicElevationRange){let n=e(h,_.distance,_.elevation);g=Math.max(g,n/t().maxChartRatio)}return p-=n*g,m=p+g+r*g,[p,m]=c(p,m,10),g=m-p,o.uniformScaling&&l>0&&u>0?s({data:o,bounds:{minX:0,maxX:f,minY:p,maxY:m},pixelWidth:l,pixelHeight:u,centered:!0}):{minX:0,maxX:0+h,minY:p,maxY:p+g}}function s({data:t,bounds:n,pixelWidth:r,pixelHeight:i,centered:o}){if(!t)return n;let{minX:s,maxX:c,minY:l,maxY:d}=n;if(s==null||c==null||l==null||d==null)return a;let f=c-s,p=d-l,m=t.effectiveUnits,h=e(p,m.elevation,m.distance),g=f/r,_=h/i/g;return _>=1?[s,c]=u([s,c],_):[l,d]=u([l,d],1/_),{minX:s,maxX:c,minY:l,maxY:d}}function c(e,t,n=10){let r=l(t-e,!1);if(r===0)return[e,t];let i=l(r/(n-1),!0);return[Math.floor(e/i)*i,Math.ceil(t/i)*i]}function l(e,t){let n=Math.floor(Math.log10(e)),r=e/10**n,i;return i=t?r<1.5?1:r<3?2:r<5?2.5:r<7?5:10:r<=1?1:r<=2?2:r<=3?2.5:r<=5?5:10,i*10**n}function u([e,t],n,r){let i=(t-e)*n;{let n=(e+t)/2-i/2;return[n,n+i]}}export{o as getAdjustedBounds};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{distance as e,lerp as t}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{lerp as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{floatEqualUlp as r,lerp as i}from"../../../core/mathUtils.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../../core/units.js";import{geodesicLengths as s,isSupported as c,inverseGeodeticSolver as l,directGeodeticSolver as u}from"../../../geometry/geodesicUtils.js";import d from"../../../geometry/Polyline.js";import{initializeProjection as f,project as p}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{getElevationOffset as h}from"../../../support/elevationInfoUtils.js";import{TooComplexError as g}from"./elevationProfileErrors.js";async function _(e,t,n,r,i,c,l){let u,d,h,_=e.spatialReference,b=_.isGeographic||_.isWebMercator,x=0;if(!b){let{lengthExecute:t}=await import(`../../../geometry/operators/lengthOperator.js`);a(l),x=t(e,{unit:`meters`}),a(l)}let S=1/o(r);if(b){await f([{source:_,dest:r},{source:_,dest:m.WGS84}],l);let a=z(e);u=s([a],`meters`)[0];let o=v(u,i);if(V(e,u,o)>c)throw new g;let b=y(a,t,n);({densifiedPath:d,distances:h}=M(b,o,S)),d=p(d,r)}else{await f([{source:_,dest:r}],l),u=x;let o=v(u,i);if(V(e,u,o)>c)throw new g;let s=y(e,t,n);({densifiedPath:d,distances:h}=j(s,o,S)),a(l),d=p(d,r)}return{densifiedPath:d,pathLength:u*S,distances:h}}function v(e,t){let n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function y(e,t,n){if(t==null)return S(e);let r=e.spatialReference,i=t.mode,a=h(t,r),o=null;switch(n.type){case`2d`:o=b(e,i,a);break;case`3d`:o=x(e,i,a,n)}return o==null?S(e):new d({hasZ:!0,hasM:!1,spatialReference:r,paths:C(e.paths,o)})}function b({hasZ:e},t,n){
|
|
2
|
+
import{distance as e,lerp as t}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{lerp as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{floatEqualUlp as r,lerp as i}from"../../../core/mathUtils.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../../core/units.js";import{geodesicLengths as s,isSupported as c,inverseGeodeticSolver as l,directGeodeticSolver as u}from"../../../geometry/geodesicUtils.js";import d from"../../../geometry/Polyline.js";import{initializeProjection as f,project as p}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{getElevationOffset as h}from"../../../support/elevationInfoUtils.js";import{TooComplexError as g}from"./elevationProfileErrors.js";async function _(e,t,n,r,i,c,l){let u,d,h,_=e.spatialReference,b=_.isGeographic||_.isWebMercator,x=0;if(!b){let{lengthExecute:t}=await import(`../../../geometry/operators/lengthOperator.js`);a(l),x=t(e,{unit:`meters`}),a(l)}let S=1/o(r);if(b){await f([{source:_,dest:r},{source:_,dest:m.WGS84}],l);let a=z(e);u=s([a],`meters`)[0];let o=v(u,i);if(V(e,u,o)>c)throw new g;let b=y(a,t,n);({densifiedPath:d,distances:h}=M(b,o,S)),d=p(d,r)}else{await f([{source:_,dest:r}],l),u=x;let o=v(u,i);if(V(e,u,o)>c)throw new g;let s=y(e,t,n);({densifiedPath:d,distances:h}=j(s,o,S)),a(l),d=p(d,r)}return{densifiedPath:d,pathLength:u*S,distances:h}}function v(e,t){let n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function y(e,t,n){if(t==null)return S(e);let r=e.spatialReference,i=t.mode,a=h(t,r),o=null;switch(n.type){case`2d`:o=b(e,i,a);break;case`3d`:o=x(e,i,a,n)}return o==null?S(e):new d({hasZ:!0,hasM:!1,spatialReference:r,paths:C(e.paths,o)})}function b({hasZ:e},t,n){return t===`absolute-height`?e?([e,t,r])=>[e,t,r+n]:([e,t])=>[e,t,n]:null}function x({spatialReference:e,hasZ:t},n,r,{elevationProvider:i}){let a=(t,n,r,a)=>i?.getElevation(t,n,r,e,a)??0;switch(n){case`on-the-ground`:return([e,t])=>[e,t,a(e,t,0,`ground`)];case`absolute-height`:return t?([e,t,n])=>[e,t,n+r]:([e,t])=>[e,t,r];case`relative-to-ground`:return t?([e,t,n])=>[e,t,n+a(e,t,n,`ground`)+r]:([e,t])=>[e,t,a(e,t,0,`ground`)+r];case`relative-to-scene`:return t?([e,t,n])=>[e,t,n+a(e,t,n,`scene`)+r]:([e,t])=>[e,t,a(e,t,0,`scene`)+r];default:return null}}function S(e){return e.hasZ?new d({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:C(e.paths,([e,t])=>[e,t])}):e}function C(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i){let n=e[i],a=n.length,o=Array(n.length);r[i]=o;for(let e=0;e<a;++e)o[e]=t(n[e])}return r}function w(e){return D(e)&&e.paths.some(e=>e.length>1)}function T(e){return E(e)&&w(e.geometry)}function E(e){return O(e)&&D(e?.geometry)}function D(e){return!O(e)&&e!=null&&e.type===`polyline`}function O(e){return e!=null&&`geometry`in e}function k(e){let t=e?.layer;return t!=null&&t.type===`graphics`&&t.internal}function A(e,t,n,i,a){let{spatialReference:s,hasZ:c}=e,l={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:s,metersPerSR:o(s)},u=[],f=[],p=0;for(let o=0;o<e.paths.length;++o){let s=e.paths[o],c=[],d=[],m=0;for(let e=1;e<s.length;++e){let o=s[e-1],u=s[e],f=i(l,o,u),h;for(h=m;h<f.distance&&!r(h,f.distance);h+=t)c.push(a(f,h)),d.push((p+h)*n);m=h-f.distance,p+=f.distance,c.push(u),d.push(p*n)}u[o]=c,f[o]=d}return{densifiedPath:new d({spatialReference:s,hasZ:c,paths:u}),distances:f}}function j(e,t,n){let{hasZ:r}=e;return A(e,t,n,P,r?R:L)}function M(e,t,n){let{hasZ:r}=e;return A(e,t,n,N,r?I:F)}function N(e,t,n){return e.distance=0,l(e,t,n,e.spatialReference),e.from=t,e.to=n,e}function P(t,n,r){return t.from=n,t.to=r,t.distance=e(r,n)*t.metersPerSR,t}function F({from:e,azimuth:t,spatialReference:n},r){return u([0,0],e,t,r,n)}function I({from:e,to:t,azimuth:n,distance:r,spatialReference:a},o){let s=o/r,c=[0,0,i(e[2],t[2],s)];return u(c,e,n,o,a),c}function L({from:e,to:n,distance:r},i){return t([0,0],e,n,i/r)}function R({from:e,to:t,distance:r},i){return n([0,0,0],e,t,i/r)}function z(e){return c(e.spatialReference)?e:p(e,m.WGS84)}function B(e){return e.paths.reduce((e,t)=>e+t.length,0)}function V(e,t,n){return B(e)+Math.floor(t/n)+Math.max(0,e.paths.reduce(e=>1+e,0)-1)}export{B as countPoints,_ as densifyPath,O as isGraphic,k as isInternalGraphic,D as isPolyline,E as isPolylineGraphic,T as isValidInputGraphic,w as isValidInputPath,y as toAbsoluteHeightElevation};
|
package/views/draw/DrawAction.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{destroyMaybe as a}from"../../core/maybe.js";import{EsriPromiseMixin as o}from"../../core/Promise.js";import{ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{createScreenPointArray as c}from"../../core/screenUtils.js";import{makeDehydratedPoint as l}from"../../layers/graphics/dehydratedPoint.js";import u from"../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as d}from"../2d/interactive/SnappingVisualizer2D.js";import{createCoordinateHelper as f}from"../interactive/coordinateHelper.js";import{EditGeometry as p,Part as m}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as h}from"../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as g}from"../interactive/snapping/SnappingContext.js";import{SnappingOperation as _}from"../interactive/snapping/SnappingOperation.js";var v;let y=class extends o(r){static{v=this}constructor(e={}){let{editGeometryType:t,snappingManager:n,...r}=e;super(r),this._hasZ=null,this._cursorScreenPoint=null,this._activePointerId=null,this._stagedVertexUnsnapped=null,this._lastVertexUnsnapped=null,this.interactiveUndoDisabled=!1,this.history=[],this.redoHistory=[],this.snapToScene=!1,this.view=null,this.elevationInfo=null,this.defaultZ=0,this._coordinateHelper=f(!!e.hasZ,!1,e.view.spatialReference),this._snappingManager=n
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{destroyMaybe as a}from"../../core/maybe.js";import{EsriPromiseMixin as o}from"../../core/Promise.js";import{ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{createScreenPointArray as c}from"../../core/screenUtils.js";import{makeDehydratedPoint as l}from"../../layers/graphics/dehydratedPoint.js";import u from"../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as d}from"../2d/interactive/SnappingVisualizer2D.js";import{createCoordinateHelper as f}from"../interactive/coordinateHelper.js";import{EditGeometry as p,Part as m}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as h}from"../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as g}from"../interactive/snapping/SnappingContext.js";import{SnappingOperation as _}from"../interactive/snapping/SnappingOperation.js";var v;let y=class extends o(r){static{v=this}constructor(e={}){let{editGeometryType:t,snappingManager:n,...r}=e;super(r),this._hasZ=null,this._cursorScreenPoint=null,this._activePointerId=null,this._stagedVertexUnsnapped=null,this._lastVertexUnsnapped=null,this.interactiveUndoDisabled=!1,this.history=[],this.redoHistory=[],this.snapToScene=!1,this.view=null,this.elevationInfo=null,this.defaultZ=0,this._coordinateHelper=f(!!e.hasZ,!1,e.view.spatialReference),this._snappingManager=n;let i=e.view?.state.isGlobal??!1;this._editGeometryOperations=new h(new p(t??`polygon`,this._coordinateHelper),i),this._snappingGraphicsLayer=new u({id:v.SNAPPING_GRAPHICS_LAYER_ID,listMode:`hide`,internal:!0,title:`Snapping graphics`}),this._snappingContext=new g({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:`on-the-ground`,offset:0},pointer:`mouse`,visualizer:new d(this._snappingGraphicsLayer)}),this._activeComponent=new m(e.view.spatialReference,i),this._editGeometryOperations.data.parts.push(this._activeComponent)}initialize(){this._snappingOperation=new _({view:this.view}),this.view.type===`2d`&&this.view.map.layers.add(this._snappingGraphicsLayer)}destroy(){this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy(),this._snappingManager!=null&&this._snappingManager.doneSnapping(),this._snappingOperation=a(this._snappingOperation),this._editGeometryOperations.destroy()}get _committedVertices(){return this._editGeometryOperations.data.parts[0].vertices.map(e=>e.pos)}get vertices(){return this._stagedVertex==null?this._committedVertices:[...this._committedVertices,this._coordinateHelper.pointToArray(this._stagedVertex)]}get hasZ(){return this._hasZ==null?this.view.type===`3d`:this._hasZ}set hasZ(e){this._hasZ=e,this.notifyChange(`hasZ`)}get _stagedVertex(){return this._snappingOperation?.stagedPoint}set _stagedVertex(e){this._snappingOperation&&(this._snappingOperation.stagedPoint=i(e))}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this.canUndo&&this._editGeometryOperations.undo()}redo(){this.canRedo&&this._editGeometryOperations.redo()}getCoordsFromScreenPoint(e){let t=e&&this.screenToMap(e);return t==null?null:t.hasZ?[t.x,t.y,t.z]:[t.x,t.y]}getCoordsAndPointFromScreenPoint(e){let t=this.screenToMap(e);return t==null?null:t.hasZ?{vertex:[t.x,t.y,t.z],mapPoint:t}:{vertex:[t.x,t.y],mapPoint:t}}screenToMap(e){let t=null;if(this.view.type===`3d`){if(this.hasZ){let n=this.elevationInfo??b;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(c(e.x,e.y),n,this._getGeometryZValue())}else{let n=this.elevationInfo??x;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(c(e.x,e.y),n,0),t!=null&&(t.z=void 0)}}else t=this.view.toMap(e),t!=null&&(t.z=this.hasZ?this._getGeometryZValue():void 0);return t}_pushCursorVertex(e,t){let n=l(e[0],e[1],void 0,this.view.spatialReference);this._stagedVertexUnsnapped=n;let r=this._snappingManager;r==null?(this._stagedVertex=n,t()):s(this._snappingOperation.snap({point:n},r,this._snappingContext)).then(()=>{t()})}_popCursorVertex(){this._stagedVertexUnsnapped=null,this._stagedVertex=null}_getGeometryZValue(){return this.defaultZ}_abortSnapping(){this._snappingOperation.abort()}_isDuplicateOfLastVertex(e){let t=this._editGeometryOperations.data.parts[0].getLastVertex()?.pos;if(t&&e[0]===t[0]&&e[1]===t[1])return!0;let{x:n,y:r}=this._coordinateHelper.vectorToDehydratedPoint(e);return this._lastVertexUnsnapped!=null&&n===this._lastVertexUnsnapped.x&&r===this._lastVertexUnsnapped.y}_shouldHandlePointerEvent(e){return S(e)&&(this._activePointerId==null||this._activePointerId===e.pointerId)}_vertexAddHandler(e){let t=this._stagedVertex==null?this.getCoordsFromScreenPoint(this._cursorScreenPoint):this._coordinateHelper.pointToArray(this._stagedVertex);t!=null&&this._addVertex(t,e.native)}_drawCompleteHandler(e){this._completeDrawing(e.native)}static{this.SNAPPING_GRAPHICS_LAYER_ID=`DrawAction-snapping-graphics-layer`}};e([t({readOnly:!0})],y.prototype,`vertices`,null),e([t({type:Boolean,nonNullable:!0})],y.prototype,`interactiveUndoDisabled`,void 0),e([t({readOnly:!0})],y.prototype,`history`,void 0),e([t({readOnly:!0})],y.prototype,`redoHistory`,void 0),e([t()],y.prototype,`snapToScene`,void 0),e([t()],y.prototype,`view`,void 0),e([t()],y.prototype,`elevationInfo`,void 0),e([t({nonNullable:!0})],y.prototype,`defaultZ`,void 0),e([t()],y.prototype,`hasZ`,null),e([t()],y.prototype,`_snappingOperation`,void 0),e([t()],y.prototype,`_stagedVertex`,null),y=v=e([n(`esri.views.draw.DrawAction`)],y);const b={mode:`absolute-height`,offset:0},x={mode:`on-the-ground`,offset:0};function S(e){return e.pointerType!==`mouse`||e.button===0}const C=y;export{C as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{createTask as r}from"../../core/asyncUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as o,syncAndInitial as s,sync as c}from"../../core/reactiveUtils.js";import{UpdatingHandles as l}from"../../core/support/UpdatingHandles.js";import{load as u}from"../../geometry/coordinateFormatter.js";import d from"../../Graphic.js";import{pointEquals as f}from"../../layers/graphics/dehydratedFeatureComparison.js";import p from"../../layers/GraphicsLayer.js";import{UndoRedo as m}from"../../UndoRedo.js";import{InteractiveToolBase as h}from"../interactive/InteractiveToolBase.js";import g from"../interactive/options/InteractiveToolOptions.js";import{makeTooltip as _,pasteLocation as v,enterInputModeIfAvailable as y}from"../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as b}from"../support/GeometryWorkerHandle.js";import{CreateOperationGeometry as x}from"./support/CreateOperationGeometry.js";import{createCircle as S,createEllipse as C,createSquare as w,createRectangle as T,createPolygon as E,createPolyline as D,createMultipoint as O}from"./support/createUtils.js";import{createViewAlignedCoordinateSystem as k}from"./support/surfaceCoordinateSystems.js";import{createTooltipInfos as A,initializeConstraints as j,updateTooltipInfo as M,getConstraintZ as N,unlockConstraintsOnVertexAddOrRemove as P,lockElevationOnVertexAdd as F,getActiveTooltipInfo as I}from"./support/tooltipUtils.js";import{autorun as L}from"../../core/accessorSupport/trackingUtils.js";let R=class extends h{constructor(e){super(e),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.elevationLockOnVertexAddDisabled=!1,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.toolOptions=new g,this._updatingHandles=new l,this._measurementWorker=new b({preloadGeodetic:!0})}initialize(){let{view:e}=this;this.internalGraphicsLayer=new p({listMode:`hide`,internal:!0,title:`DrawGraphicTool layer`}),this.view.map.layers.add(this.internalGraphicsLayer);let t=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=A(e.type,this.toolOptions);let n=_(()=>({view:e,options:this.toolOptions.tooltips}));this.tooltip=n,j(this._tooltipsContext),this._coordinateFormatterLoadTask=r(()=>u()),this.addHandles([t.on(`vertex-add`,e=>this.onVertexAdd(e)),t.on(`vertex-remove`,e=>this.onVertexRemove(e)),t.on(`vertex-update`,e=>this.onVertexUpdate(e)),t.on(`cursor-update`,e=>this.onCursorUpdate(e)),t.on(`cursor-remove`,()=>this._updateGraphic()),t.on(`complete`,e=>this.onComplete(e)),this._coordinateFormatterLoadTask,n.on(`paste`,e=>v(e,this.activeTooltipInfo)),o(()=>this.cursor,e=>{t.cursor=e},s),L(()=>{let{activeTooltipInfo:e,toolOptions:t}=this;M(e,this._tooltipsContext,this._updatingHandles),n.info=t.tooltips.effectiveEnabled?e:null}),L(()=>{t.constraintZ=N(this._tooltipsContext)},c)]),this.finishToolCreation(),t.initializePointer()}destroy(){this.drawOperation=a(this.drawOperation),this.tooltip=a(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=a(this.internalGraphicsLayer),this._updatingHandles.destroy(),this._measurementWorker.destroy(),this._set(`view`,null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){let{defaultZ:e,directionOptions:t,drawOperation:n,forceUniformSize:r,geometryType:i,graphic:a,toolOptions:o,tooltipInfos:s,view:c,_measurementWorker:l}=this;return{createOperationGeometry:this._createOperationGeometry,defaultZ:e,directionOptions:t,drawOperation:n,forceUniformSize:r,geometryType:i,graphic:a,toolOptions:o,tooltipInfos:s,view:c,measurementWorker:l}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set(`centered`,e),this._updateGraphic()}get cursor(){return this._get(`cursor`)}set cursor(e){this._set(`cursor`,e)}set enabled(e){this.drawOperation.interactive=e,this._set(`enabled`,e)}set forceUniformSize(e){this._set(`forceUniformSize`,e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set(`graphicSymbol`,e),this._graphic!=null&&(this._graphic.symbol=e)}set mode(e){let t=this.drawOperation;t&&(t.drawingMode=e),this._set(`mode`,e)}get updating(){return(this._updatingHandles.updating||this.drawOperation?.updating)??!1}get undoRedo(){let{view:{type:e,map:t}}=this;return e===`2d`&&t&&`undoRedo`in t&&t.undoRedo instanceof m?t.undoRedo:null}set undoRedo(e){this._override(`undoRedo`,e)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||y(e,this.tooltip)||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),this.drawOperation.numCommittedVertices===0&&j(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(B.outline),this.removeHandles(B.regularVertices),this.removeHandles(B.activeVertex),this.removeHandles(B.activeEdge),this.removeHandles(z)}_createOrUpdateGraphic(e){if(this._graphic!=null)return this.updateGraphicGeometry(e),this._graphic;let t=new d({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=t,this.updateGraphicGeometry(e),this.internalGraphicsLayer.add(t),this.addHandles(this.initializeGraphic(t)),this.notifyChange(`graphic`),this.addHandles(i(()=>{this.internalGraphicsLayer.remove(t),this._graphic===t&&(this._graphic=null)}),z),t}updateGraphicGeometry(e){this._graphic.geometry=e}_getCreateOperationGeometry(e={operationComplete:!1}){if(this.drawOperation==null)return;let{coordinateHelper:t,view:n,visualizationCursorVertex:r,lastVertex:i,committedVertices:a,geometryIncludingUncommittedVertices:o,numCommittedVertices:s}=this.drawOperation;if(!(s>0||r!=null))return;let c=e.operationComplete?a:o,l=c.length,u=r==null?null:t.pointToArray(r),d=this._drawSpatialReference,p=n.type===`3d`&&n.viewingMode===`global`,m=new x;m.committedVertices=a,m.cursorVertex=u;let{geometryType:h}=this;switch(h){case`point`:case`mesh`:m.full=t.arrayToPoint(c[0]);break;case`multipoint`:m.full=l>0?O(c,d):null;break;case`polyline`:case`polygon`:l>0&&(m.full=h===`polygon`?E([c],d,p,!0):D([c],d,p),m.cursorEdge=u!=null&&i&&!f(r,i)?D([[u,t.pointToArray(i)]],d,p):null,m.outline=l>1?m.full:null);break;case`circle`:case`rectangle`:{if(m.committedVertices=m.cursorVertex=null,!l)break;let t=k(n,c[0]),r=c[0],i=t.makeMapPoint(r[0]+H*n.resolution,r[1]);h===`circle`?l===1&&e.operationComplete?m.circle=S([r,i],t,!0):l===2&&(this.forceUniformSize?m.circle=S(c,t,this.centered):m.rectangle=C(c,t,this.centered)):l===1&&e.operationComplete?m.rectangle=w([r,i],t,!0):l===2&&(m.rectangle=this.forceUniformSize?w(c,t,this.centered):T(c,t,this.centered)),m.full=m.circle==null?m.rectangle?.geometry:m.circle.geometry,m.outline=m.full?.type===`polygon`?m.full:null;break}default:return null}return m}initializeGraphic(e){return i()}onComplete(e){if(!this.drawOperation)return;this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){let e=this._getCreateOperationGeometry({operationComplete:!0});e!=null&&(t=this._createOrUpdateGraphic(e.full))}this._createOperationGeometry=null,this.emit(`complete`,{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit(`cursor-update`,e)}onDeactivate(){let{drawOperation:e}=this;e&&(e.isCompleted||e.cancel())}onOutlineChanged(e){return i()}onCursorEdgeChanged(e){return i()}onVertexAdd(e){P(this._tooltipsContext),this._updateGraphic(),this.elevationLockOnVertexAddDisabled||F(e.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit(`vertex-add`,e)}onVertexRemove(e){P(this._tooltipsContext),this._updateGraphic(),this.emit(`vertex-remove`,e)}onVertexUpdate(e){this._updateGraphic(),this.emit(`vertex-update`,e)}_updateGraphic(){let e=this._getCreateOperationGeometry();this._createOperationGeometry=e,e==null?this._destroyAllVisualizations():(e.cursorEdge==null?this.removeHandles(B.activeEdge):this.addHandles(this.onCursorEdgeChanged(e.cursorEdge),B.activeEdge),e.outline==null?this.removeHandles(B.outline):this.addHandles(this.onOutlineChanged(e.outline),B.outline),e.committedVertices==null?this.removeHandles(B.regularVertices):this.addHandles(this.onRegularVerticesChanged(e.committedVertices),B.regularVertices),e.cursorVertex==null?this.removeHandles(B.activeVertex):this.addHandles(this.onActiveVertexChanged(e.cursorVertex),B.activeVertex),e.full==null?this.removeHandles(z):this._createOrUpdateGraphic(e.full))}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?I(this._tooltipsContext):null}};e([t()],R.prototype,`_coordinateFormatterLoadTask`,void 0),e([t()],R.prototype,`_createOperationGeometry`,void 0),e([t()],R.prototype,`_tooltipsContext`,null),e([t({value:!0})],R.prototype,`centered`,null),e([t()],R.prototype,`cursor`,null),e([t({nonNullable:!0})],R.prototype,`defaultZ`,void 0),e([t({constructOnly:!0})],R.prototype,`directionOptions`,void 0),e([t()],R.prototype,`drawOperation`,void 0),e([t()],R.prototype,`elevationLockOnVertexAddDisabled`,void 0),e([t({value:!0})],R.prototype,`enabled`,null),e([t({value:!0})],R.prototype,`forceUniformSize`,null),e([t({constructOnly:!0})],R.prototype,`geometryType`,void 0),e([t()],R.prototype,`graphic`,null),e([t({constructOnly:!0})],R.prototype,`graphicProperties`,void 0),e([t()],R.prototype,`graphicSymbol`,null),e([t({constructOnly:!0})],R.prototype,`hasZ`,void 0),e([t({constructOnly:!0})],R.prototype,`geometryToPlace`,void 0),e([t()],R.prototype,`mode`,null),e([t()],R.prototype,`snappingManager`,void 0),e([t()],R.prototype,`snapToScene`,void 0),e([t()],R.prototype,`tooltip`,void 0),e([t()],R.prototype,`tooltipInfos`,void 0),e([t({constructOnly:!0,type:g})],R.prototype,`toolOptions`,void 0),e([t()],R.prototype,`updating`,null),e([t({constructOnly:!0,nonNullable:!0})],R.prototype,`view`,void 0),e([t({constructOnly:!0})],R.prototype,`undoRedo`,null),e([t()],R.prototype,`activeTooltipInfo`,null),R=e([n(`esri.views.draw.DrawGraphicTool`)],R);const z=Symbol(`create-operation-graphic`),B={outline:Symbol(`outline-visual`),regularVertices:Symbol(`regular-vertices-visual`),activeVertex:Symbol(`active-vertex-visual`),activeEdge:Symbol(`active-edge-visual`)};function V(e){switch(e){case`point`:case`polyline`:case`polygon`:case`multipoint`:return e;case`circle`:case`rectangle`:return`segment`;case`mesh`:return`point`}}const H=48;export{R as DrawGraphicTool,V as geometryTypeToDrawOperationGeometryType};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{createTask as r}from"../../core/asyncUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as o,syncAndInitial as s,sync as c}from"../../core/reactiveUtils.js";import{UpdatingHandles as l}from"../../core/support/UpdatingHandles.js";import{load as u}from"../../geometry/coordinateFormatter.js";import d from"../../Graphic.js";import{pointEquals as f}from"../../layers/graphics/dehydratedFeatureComparison.js";import p from"../../layers/GraphicsLayer.js";import{UndoRedo as m}from"../../UndoRedo.js";import{InteractiveToolBase as h}from"../interactive/InteractiveToolBase.js";import g from"../interactive/options/InteractiveToolOptions.js";import{makeTooltip as _,pasteLocation as v,enterInputModeIfAvailable as y}from"../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as b}from"../support/GeometryWorkerHandle.js";import{CreateOperationGeometry as x}from"./support/CreateOperationGeometry.js";import{createCircle as S,createEllipse as C,createSquare as w,createRectangle as T,createPolygon as E,createPolyline as D,createMultipoint as O}from"./support/createUtils.js";import{createViewAlignedCoordinateSystem as k}from"./support/surfaceCoordinateSystems.js";import{createTooltipInfos as A,initializeConstraints as j,updateTooltipInfo as M,getConstraintZ as N,unlockConstraintsOnVertexAddOrRemove as P,lockElevationOnVertexAdd as F,getActiveTooltipInfo as I}from"./support/tooltipUtils.js";import{autorun as L}from"../../core/accessorSupport/trackingUtils.js";let R=class extends h{constructor(e){super(e),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.elevationLockOnVertexAddDisabled=!1,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.toolOptions=new g,this._updatingHandles=new l,this._measurementWorker=new b({preloadGeodetic:!0})}initialize(){let{view:e}=this;this.internalGraphicsLayer=new p({listMode:`hide`,internal:!0,title:`DrawGraphicTool layer`}),this.view.map.layers.add(this.internalGraphicsLayer);let t=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=A(e.type,this.toolOptions);let n=_(()=>({view:e,options:this.toolOptions.tooltips}));this.tooltip=n,j(this._tooltipsContext),this._coordinateFormatterLoadTask=r(()=>u()),this.addHandles([t.on(`vertex-add`,e=>this.onVertexAdd(e)),t.on(`vertex-remove`,e=>this.onVertexRemove(e)),t.on(`vertex-update`,e=>this.onVertexUpdate(e)),t.on(`cursor-update`,e=>this.onCursorUpdate(e)),t.on(`cursor-remove`,()=>this._updateGraphic()),t.on(`complete`,e=>this.onComplete(e)),this._coordinateFormatterLoadTask,n.on(`paste`,e=>v(e,this.activeTooltipInfo)),o(()=>this.cursor,e=>{t.cursor=e},s),L(()=>{let{activeTooltipInfo:e,toolOptions:t}=this;M(e,this._tooltipsContext,this._updatingHandles),n.info=t.tooltips.effectiveEnabled?e:null}),L(()=>{t.constraintZ=N(this._tooltipsContext)},c)]),this.finishToolCreation(),t.initializePointer()}destroy(){this.drawOperation=a(this.drawOperation),this.tooltip=a(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=a(this.internalGraphicsLayer),this._updatingHandles.destroy(),this._measurementWorker.destroy(),this._set(`view`,null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){let{defaultZ:e,directionOptions:t,drawOperation:n,forceUniformSize:r,geometryType:i,graphic:a,toolOptions:o,tooltipInfos:s,view:c,_measurementWorker:l}=this;return{createOperationGeometry:this._createOperationGeometry,defaultZ:e,directionOptions:t,drawOperation:n,forceUniformSize:r,geometryType:i,graphic:a,toolOptions:o,tooltipInfos:s,view:c,measurementWorker:l}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set(`centered`,e),this._updateGraphic()}get cursor(){return this._get(`cursor`)}set cursor(e){this._set(`cursor`,e)}set enabled(e){this.drawOperation.interactive=e,this._set(`enabled`,e)}set forceUniformSize(e){this._set(`forceUniformSize`,e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set(`graphicSymbol`,e),this._graphic!=null&&(this._graphic.symbol=e)}set mode(e){let t=this.drawOperation;t&&(t.drawingMode=e),this._set(`mode`,e)}get updating(){return(this._updatingHandles.updating||this.drawOperation?.updating)??!1}get undoRedo(){let{view:{type:e,map:t}}=this;return e===`2d`&&t&&`undoRedo`in t&&t.undoRedo instanceof m?t.undoRedo:null}set undoRedo(e){this._override(`undoRedo`,e)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||y(e,this.tooltip)||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),this.drawOperation.numCommittedVertices===0&&j(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(B.outline),this.removeHandles(B.regularVertices),this.removeHandles(B.activeVertex),this.removeHandles(B.activeEdge),this.removeHandles(z)}_createOrUpdateGraphic(e){if(this._graphic!=null)return this.updateGraphicGeometry(e),this._graphic;let t=new d({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=t,this.updateGraphicGeometry(e),this.internalGraphicsLayer.add(t),this.addHandles(this.initializeGraphic(t)),this.notifyChange(`graphic`),this.addHandles(i(()=>{this.internalGraphicsLayer.remove(t),this._graphic===t&&(this._graphic=null)}),z),t}updateGraphicGeometry(e){this._graphic.geometry=e}_getCreateOperationGeometry(e={operationComplete:!1}){if(this.drawOperation==null)return;let{coordinateHelper:t,view:n,visualizationCursorVertex:r,lastVertex:i,committedVertices:a,geometryIncludingUncommittedVertices:o,numCommittedVertices:s}=this.drawOperation;if(!(s>0||r!=null))return;let c=e.operationComplete?a:o,l=c.length,u=r==null?null:t.pointToArray(r),d=this._drawSpatialReference,p=n.type===`3d`&&n.state.isGlobal,m=new x;m.committedVertices=a,m.cursorVertex=u;let{geometryType:h}=this;switch(h){case`point`:case`mesh`:m.full=t.arrayToPoint(c[0]);break;case`multipoint`:m.full=l>0?O(c,d):null;break;case`polyline`:case`polygon`:l>0&&(m.full=h===`polygon`?E([c],d,p,!0):D([c],d,p),m.cursorEdge=u!=null&&i&&!f(r,i)?D([[u,t.pointToArray(i)]],d,p):null,m.outline=l>1?m.full:null);break;case`circle`:case`rectangle`:{if(m.committedVertices=m.cursorVertex=null,!l)break;let t=k(n,c[0]),r=c[0],i=t.makeMapPoint(r[0]+H*n.resolution,r[1]);h===`circle`?l===1&&e.operationComplete?m.circle=S([r,i],t,!0):l===2&&(this.forceUniformSize?m.circle=S(c,t,this.centered):m.rectangle=C(c,t,this.centered)):l===1&&e.operationComplete?m.rectangle=w([r,i],t,!0):l===2&&(m.rectangle=this.forceUniformSize?w(c,t,this.centered):T(c,t,this.centered)),m.full=m.circle==null?m.rectangle?.geometry:m.circle.geometry,m.outline=m.full?.type===`polygon`?m.full:null;break}default:return null}return m}initializeGraphic(e){return i()}onComplete(e){if(!this.drawOperation)return;this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){let e=this._getCreateOperationGeometry({operationComplete:!0});e!=null&&(t=this._createOrUpdateGraphic(e.full))}this._createOperationGeometry=null,this.emit(`complete`,{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit(`cursor-update`,e)}onDeactivate(){let{drawOperation:e}=this;e&&(e.isCompleted||e.cancel())}onOutlineChanged(e){return i()}onCursorEdgeChanged(e){return i()}onVertexAdd(e){P(this._tooltipsContext),this._updateGraphic(),this.elevationLockOnVertexAddDisabled||F(e.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit(`vertex-add`,e)}onVertexRemove(e){P(this._tooltipsContext),this._updateGraphic(),this.emit(`vertex-remove`,e)}onVertexUpdate(e){this._updateGraphic(),this.emit(`vertex-update`,e)}_updateGraphic(){let e=this._getCreateOperationGeometry();this._createOperationGeometry=e,e==null?this._destroyAllVisualizations():(e.cursorEdge==null?this.removeHandles(B.activeEdge):this.addHandles(this.onCursorEdgeChanged(e.cursorEdge),B.activeEdge),e.outline==null?this.removeHandles(B.outline):this.addHandles(this.onOutlineChanged(e.outline),B.outline),e.committedVertices==null?this.removeHandles(B.regularVertices):this.addHandles(this.onRegularVerticesChanged(e.committedVertices),B.regularVertices),e.cursorVertex==null?this.removeHandles(B.activeVertex):this.addHandles(this.onActiveVertexChanged(e.cursorVertex),B.activeVertex),e.full==null?this.removeHandles(z):this._createOrUpdateGraphic(e.full))}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?I(this._tooltipsContext):null}};e([t()],R.prototype,`_coordinateFormatterLoadTask`,void 0),e([t()],R.prototype,`_createOperationGeometry`,void 0),e([t()],R.prototype,`_tooltipsContext`,null),e([t({value:!0})],R.prototype,`centered`,null),e([t()],R.prototype,`cursor`,null),e([t({nonNullable:!0})],R.prototype,`defaultZ`,void 0),e([t({constructOnly:!0})],R.prototype,`directionOptions`,void 0),e([t()],R.prototype,`drawOperation`,void 0),e([t()],R.prototype,`elevationLockOnVertexAddDisabled`,void 0),e([t({value:!0})],R.prototype,`enabled`,null),e([t({value:!0})],R.prototype,`forceUniformSize`,null),e([t({constructOnly:!0})],R.prototype,`geometryType`,void 0),e([t()],R.prototype,`graphic`,null),e([t({constructOnly:!0})],R.prototype,`graphicProperties`,void 0),e([t()],R.prototype,`graphicSymbol`,null),e([t({constructOnly:!0})],R.prototype,`hasZ`,void 0),e([t({constructOnly:!0})],R.prototype,`geometryToPlace`,void 0),e([t()],R.prototype,`mode`,null),e([t()],R.prototype,`snappingManager`,void 0),e([t()],R.prototype,`snapToScene`,void 0),e([t()],R.prototype,`tooltip`,void 0),e([t()],R.prototype,`tooltipInfos`,void 0),e([t({constructOnly:!0,type:g})],R.prototype,`toolOptions`,void 0),e([t()],R.prototype,`updating`,null),e([t({constructOnly:!0,nonNullable:!0})],R.prototype,`view`,void 0),e([t({constructOnly:!0})],R.prototype,`undoRedo`,null),e([t()],R.prototype,`activeTooltipInfo`,null),R=e([n(`esri.views.draw.DrawGraphicTool`)],R);const z=Symbol(`create-operation-graphic`),B={outline:Symbol(`outline-visual`),regularVertices:Symbol(`regular-vertices-visual`),activeVertex:Symbol(`active-vertex-visual`),activeEdge:Symbol(`active-edge-visual`)};function V(e){switch(e){case`point`:case`polyline`:case`polygon`:case`multipoint`:return e;case`circle`:case`rectangle`:return`segment`;case`mesh`:return`point`}}const H=48;export{R as DrawGraphicTool,V as geometryTypeToDrawOperationGeometryType};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{diff as r}from"../../core/accessorSupport/diffUtils.js";import{EventedAccessor as i}from"../../core/Evented.js";import{clone as a}from"../../core/lang.js";import{destroyMaybe as o,equalsMaybe as s}from"../../core/maybe.js";import{memoize as c}from"../../core/memoize.js";import{ignoreAbortErrors as l}from"../../core/promiseUtils.js";import u from"../../core/ReactiveSet.js";import{watch as d,syncAndInitial as f}from"../../core/reactiveUtils.js";import{createScreenPoint as p}from"../../core/screenUtils.js";import{UpdatingHandles as m}from"../../core/support/UpdatingHandles.js";import{pointEquals as h,pointNear as g}from"../../layers/graphics/dehydratedFeatureComparison.js";import{getEffectiveElevationInfo as _}from"../../support/elevationInfoUtils.js";import{createCoordinateHelper as v}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,sceneSnappingAtLocation as b}from"../interactive/dragEventPipeline.js";import{EditGeometry as x,Part as S}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as C}from"../interactive/editGeometry/EditGeometryOperations.js";import w from"../interactive/options/LabelOptions.js";import{isPoint as T}from"../interactive/sketch/constraints.js";import{getPointConstraint as E,getPolylineOrPolygonConstraint as D,pointToConstraintSpace as O,constraintSpaceToPoint as k}from"../interactive/sketch/constraintUtils.js";import{SnappingContext as A}from"../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as j}from"../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as M}from"../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as N}from"../interactive/snapping/snappingUtils.js";import{defaultDrawingMode as P}from"./drawingModes.js";import{LegacyDrawManipulator as F}from"./LegacyDrawManipulator.js";const I=`crosshair`,L=`progress`,R=Symbol(),z=Symbol();let B=class extends i{constructor(e){super(e),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new u,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new m,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=c(E),this._getPolylineOrPolygonConstraint=c(D),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new w,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,e.elevationInfo??(this.elevationInfo=_(!!e.hasZ))}initializePointer(){let e=this.view.inputManager?.latestPointerInfo;e!=null&&e.type!==`touch`&&this._updatePointer(e.location,e.id,e.type)}initialize(){let{geometryType:e,view:t,spatialReference:n}=this,i=`viewingMode`in t.state?t.state.viewingMode:2,a=e===`segment`||e===`multipoint`?`polyline`:e;this.coordinateHelper=v(this.hasZ,this.hasM,n),this._editGeometryOperations=new C(new x(a,this.coordinateHelper),i),this._snappingOperation=new M({view:t}),this.addHandles([d(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:e,constraint:t},n)=>{let{snappingOptions:r}=this;if(r&&(r.forceDisabled=t!=null&&T(t)),n!=null&&e===n.stagedPoint&&t!==n.constraint)return this._onKeyboardBasedChange();this._processCursor(e??this._screenToMap(this._stagedScreenPoint))},{equals:(e,t)=>e.stagedPoint===t.stagedPoint&&s(e.constraint,t.constraint)}),d(()=>this.view.viewpoint,(e,t)=>{e&&t&&r(e,t)&&this._onKeyboardBasedChange()})]),this._activePart=new S(n,i),this._editGeometryOperations.data.parts.push(this._activePart);let o=this.segmentLabels;o!=null&&(o.context={view:t,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles(d(()=>this.labelOptions.enabled,e=>{o.visible=e},f))),this.addHandles(this._editGeometryOperations.on([`vertex-add`,`vertex-update`,`vertex-remove`],e=>{let t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),n=t.map(e=>e.coordinates),r=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getFirstVertex()?.pos)??null;h(r,this.firstVertex)||(this.firstVertex=r);let i=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getLastVertex()?.pos)??null;h(i,this.lastVertex)||(this.lastVertex=i);let a=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.segments.at(-1)?.leftVertex?.pos)??null;switch(h(a,this.secondToLastVertex)||(this.secondToLastVertex=a),this._processCursor(this.cursorVertex),e.type){case`vertex-add`:this.emit(e.type,{...e,added:n,vertices:t});break;case`vertex-update`:this.emit(e.type,{...e,updated:n,vertices:t});break;case`vertex-remove`:this.emit(e.type,{...e,removed:n,vertices:t})}}));let c=this._manipulator=new F({consumesClicks:!1,grabbableForEvent:e=>this.drawingMode!==`click`||e.pointerType===`touch`&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(c),c.grabbable=e!==`point`&&e!==`multipoint`,this.addHandles([c.events.on(`immediate-click`,e=>this._onImmediateClick(e)),c.events.on(`immediate-double-click`,e=>this._onImmediateDoubleClick(e)),d(()=>this.drawingMode,()=>{this.removeHandles(R),this.addHandles(this._createManipulatorDragPipeline(c),R)},f),d(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:e})=>{c.cursor=e},f)]),N(this,()=>{let e=this.view.inputManager.latestPointerInfo?.type??`mouse`,t=this._getSnappingContext(e);if(this.snappingManager!=null){let e=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,t);this._updatingHandles.consumePromise(l(e))}})}destroy(){o(this.segmentLabels),o(this._snappingOperation),this._editGeometryOperations=o(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){let{_stagedPointerId:e,_manipulator:t}=this;return e!=null&&this._pointerDownStates.has(e)||t.grabbing||!t.interactive}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){let e=this._updateAndGetEffectiveDrawSurface();return this.view.type===`3d`&&this.drawSurface!==e}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activePart.vertices.map(e=>this.coordinateHelper.vectorToArray(e.pos))}get _constraint(){let{constraints:e,constraintsEnabled:t}=this;if(e&&t)switch(this.geometryType){case`point`:case`multipoint`:return this._getPointConstraint(e);case`polygon`:case`polyline`:return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,e)}}set drawingMode(e){this._set(`drawingMode`,e??P)}get effectiveCursor(){return this.loading?L:this._hideDefaultCursor?null:this.cursor||I}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activePart.vertices.length}get snappingOptions(){return this.snappingManager==null?null:this.snappingManager.options}get spatialReference(){return this._get(`spatialReference`)??this.view.spatialReference}get cursorVertex(){return this._get(`cursorVertex`)}get visualizationCursorVertex(){return this._stagedPointerType===`mouse`?this.cursorVertex:null}get committableVertex(){let{cursorVertex:e,lastVertex:t,firstVertex:n,geometryType:r}=this;return r===`polygon`&&g(e,n)||g(e,t)?null:e}get updating(){return this.loading||this._updatingHandles.updating||!!this.segmentLabels?.updating}get geometryIncludingUncommittedVertices(){let{committedVertices:e,committableVertex:t,coordinateHelper:n}=this,r=e.slice();return t!=null&&r.push(n.pointToArray(t)),r}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();let{committableVertex:e}=this;e!=null&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e),this._activePart)}complete(e){let t=e?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();let{geometryType:n,numCommittedVertices:r}=this,i=n===`multipoint`&&r===0||n===`polyline`&&r<2||n===`polygon`&&r<3;(n===`segment`||n===`point`)&&this.commitStagedVertex(),this._createOperationCompleted=!i,(this.isCompleted||t)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit(`complete`,{vertices:this.committedVertices.map((e,t)=>({componentIndex:0,vertexIndex:t,coordinates:e})),aborted:t,type:`complete`}))}onInputEvent(e){switch(e.type){case`pointer-down`:this._pointerDownStates.add(e.pointerId);break;case`pointer-up`:this._pointerDownStates.delete(e.pointerId)}switch(e.type){case`pointer-move`:return this._onPointerMove(e);case`hold`:return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(e){let t=a(this.cursorVertex),n=a(e),r=n&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(n)??n),i=this._snapToClosingVertex(r),o=this._applyConstraints(i);g(t,o)||(this._set(`cursorVertex`,o),this.segmentLabels?.set(`stagedVertex`,o==null?null:this.coordinateHelper.pointToVector(o)),o==null||this._stagedPointerType!==`mouse`?this.emit(`cursor-remove`):this.emit(`cursor-update`,{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activePart.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:`apply`,type:`vertex-update`}))}_snapToClosingVertex(e){if(e==null||this._isDragging||this.geometryType!==`polygon`||this.numCommittedVertices<=2)return e;let t=this._mapToScreen(e);if(!t)return e;let n=this._activePart;return this._vertexWithinPointerDistance(n.vertices[0].pos,t)?this.firstVertex:this._vertexWithinPointerDistance(n.vertices.at(-1).pos,t)?this.lastVertex:e}_createManipulatorDragPipeline(e){switch(this.drawingMode){case`click`:return this._createManipulatorDragPipelineClick(e);case`freehand`:return this._createManipulatorDragPipelineFreehand(e);case`hybrid`:return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return y(e,(e,t,n,r)=>{let i=r===`touch`&&this._snappingEnabled;if(this.isCompleted||!i)return;let{snappingStep:a,cancelSnapping:o}=j({predicate:()=>i,snappingManager:this.snappingManager,snappingContext:new A({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:r,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n.next(e=>(i&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),e)).next(o),t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._processCursor(e.mapStart),(this.geometryType===`segment`||i&&!this.numCommittedVertices)&&this.commitStagedVertex()),e)).next(b(this.view,this.elevationInfo)).next(...a).next(e=>(i&&(this._processCursor(e.mapEnd),e.action===`end`&&this.commitStagedVertex()),e)).next(e=>(e.action===`end`&&(this._stagedPointerType!==`mouse`&&this._snappingOperation.abort(),(this.geometryType===`segment`||this.geometryType===`point`)&&this.complete()),e))})}_createManipulatorDragPipelineFreehand(e){return y(e,(e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._snappingOperation.abort(),this.committableVertex??this._processCursor(e.mapStart),this.geometryType===`segment`&&this.commitStagedVertex()),e)).next(e=>{switch(e.action){case`start`:case`update`:this._processCursor(e.mapEnd),(this.geometryType===`polygon`||this.geometryType===`polyline`)&&this.commitStagedVertex();break;case`end`:this.complete()}return e})})}_createManipulatorDragPipelineHybrid(e){return y(e,(e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),z),this._processCursor(e.mapStart),this.commitStagedVertex()),e)).next(e=>{switch(e.action){case`start`:case`update`:this._processCursor(e.mapEnd),(this.geometryType===`polygon`||this.geometryType===`polyline`)&&this.commitStagedVertex();break;case`end`:this._stagedPointerType!==`mouse`&&this._snappingOperation.abort(),this.removeHandles(z),(this.geometryType===`segment`||this.geometryType===`point`)&&this.complete()}return e})})}get _drawAtFixedElevation(){let{constraintsEnabled:e,constraintZ:t,geometryType:n,numCommittedVertices:r}=this;return e?t!=null||n===`segment`&&r>0:(n===`segment`||n===`polygon`)&&r>0}_updateAndGetEffectiveDrawSurface(){let{constraintsEnabled:e,coordinateHelper:t,drawSurface:n,elevationDrawSurface:r,snapToSceneEnabled:i}=this;if(r==null)return n;if(!this.hasZ)return r.defaultZ=null,r;let a=this.elevationInfo?.mode,o=this.defaultZ,s=e||a===`absolute-height`;return i!=null&&(s=i),a===`on-the-ground`&&(s=!1),this._drawAtFixedElevation&&(o=(e?this.constraintZ:null)??t.getZ(this._activePart.vertices[0].pos),s=!1),s?n:(r.defaultZ=o,r)}_mapToScreen(e){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(e)}_onHold(e){this._snappingOperation.abort(),this.drawingMode===`click`&&e.pointerType===`touch`&&this._snappingEnabled&&this._processCursor(e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if(!(e.pointerType===`mouse`&&e.button===2||this._manipulator.dragging))try{let{drawingMode:t,geometryType:n}=this;this._stagedPointerType=e.pointerType,this._stagedScreenPoint=e.screenPoint;let r=this._screenToMap(e.screenPoint);if(r==null||r==null||t===`freehand`&&n!==`point`&&n!==`multipoint`)return;if(this._snappingEnabled&&this.cursorVertex!=null||this._processCursor(r),this.committableVertex==null){this.complete();return}this.commitStagedVertex(),e.pointerType!==`mouse`&&this._processCursor(null),(t===`freehand`&&this.geometryType!==`multipoint`||n===`point`||n===`segment`&&this.numCommittedVertices===2||n===`segment`&&t===`hybrid`&&this.numCommittedVertices===1)&&this.complete()}finally{e.stopPropagation()}}_onImmediateDoubleClick(e){this._manipulator.dragging||this.geometryType===`point`||(this.complete(),e.stopPropagation())}_onPointerMove(e){let t=p(e.x,e.y);this._updatePointer(t,e.pointerId,e.pointerType)&&e.stopPropagation()}_updatePointer(e,t,n){return this._stagedScreenPoint=e,this._stagedPointerType=n,this._stagedPointerId=t,this._isDragging?(this._snappingOperation.abort(),!1):(this._processCursorMovementRelativeToSurface(e,n),!0)}_onKeyboardBasedChange(){this._stagedPointerType!==`mouse`||!this._stagedScreenPoint||this._stagedPointerId==null||this._isDragging?this._snappingOperation.abort():this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType)}_processCursorMovementRelativeToSurface(e,t){let n=this._snappingOperation,r=this._screenToMap(e),i=this._requiresScenePoint?this.drawSurface?.screenToMap(e):null;if(r==null){this._hideDefaultCursor=!0,this._processCursor(null),n.abort();return}this._hideDefaultCursor=!1;let a=this.snappingManager;if(a==null){this._processCursor(r),n.abort();return}let o=this._getSnappingContext(t);this._updatingHandles.consumePromise(l(n.snap({point:r,scenePoint:i},a,o)))}_applyConstraints(e){let{_constraint:t,constraints:n}=this;if(!e||!n||!t)return e;let{context:r}=n,i=O(e,r),a=i?t.closestTo(i):void 0;if(!a)return e;let o=k(a,e,r),s=this.view.type===`2d`||r.elevationInfo.mode!==`absolute-height`;return o!=null&&s&&this.constraintZ!=null&&this.hasZ&&(o.z=this.constraintZ),o}_screenToMap(e){return e?this._updateAndGetEffectiveDrawSurface()?.screenToMap(e):null}_screenToMapDragEventStep(){let e=null;return t=>{if(t.action===`start`&&(e=this._screenToMap(t.screenStart)),e==null)return null;let n=this._screenToMap(t.screenEnd);return n==null?null:{...t,mapStart:e,mapEnd:n}}}_vertexWithinPointerDistance(e,t){let n=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return n!=null&&V(n,t,25)}_getSnappingContext(e){let t=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new A({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:t==null?null:{value:t,elevationInfo:this.elevationInfo},drawConstraints:this.constraints})}};e([t()],B.prototype,`_hideDefaultCursor`,void 0),e([t()],B.prototype,`_stagedPointerId`,void 0),e([t()],B.prototype,`_isDragging`,null),e([t()],B.prototype,`_snappingOperation`,void 0),e([t()],B.prototype,`_snappingEnabled`,null),e([t({constructOnly:!0})],B.prototype,`graphic`,void 0),e([t()],B.prototype,`constraintsEnabled`,void 0),e([t()],B.prototype,`constraints`,void 0),e([t()],B.prototype,`_constraint`,null),e([t()],B.prototype,`constraintZ`,void 0),e([t()],B.prototype,`defaultZ`,void 0),e([t()],B.prototype,`isDraped`,void 0),e([t({value:P})],B.prototype,`drawingMode`,null),e([t({constructOnly:!0})],B.prototype,`elevationDrawSurface`,void 0),e([t({constructOnly:!0})],B.prototype,`elevationInfo`,void 0),e([t({constructOnly:!0,type:w})],B.prototype,`labelOptions`,void 0),e([t({constructOnly:!0})],B.prototype,`geometryType`,void 0),e([t({constructOnly:!0})],B.prototype,`hasM`,void 0),e([t({constructOnly:!0})],B.prototype,`hasZ`,void 0),e([t()],B.prototype,`cursor`,void 0),e([t()],B.prototype,`effectiveCursor`,null),e([t()],B.prototype,`loading`,void 0),e([t({constructOnly:!0})],B.prototype,`manipulators`,void 0),e([t({constructOnly:!0})],B.prototype,`drawSurface`,void 0),e([t({constructOnly:!0})],B.prototype,`segmentLabels`,void 0),e([t({constructOnly:!0})],B.prototype,`snappingManager`,void 0),e([t({constructOnly:!0})],B.prototype,`snappingVisualizer`,void 0),e([t()],B.prototype,`snapToSceneEnabled`,void 0),e([t({constructOnly:!0})],B.prototype,`spatialReference`,null),e([t({readOnly:!0})],B.prototype,`cursorVertex`,null),e([t({readOnly:!0})],B.prototype,`visualizationCursorVertex`,null),e([t()],B.prototype,`committableVertex`,null),e([t()],B.prototype,`firstVertex`,void 0),e([t()],B.prototype,`lastVertex`,void 0),e([t()],B.prototype,`secondToLastVertex`,void 0),e([t()],B.prototype,`updating`,null),e([t({constructOnly:!0})],B.prototype,`view`,void 0),B=e([n(`esri.views.draw.DrawOperation`)],B);function V(e,t,n){let r=e.x-t.x,i=e.y-t.y;return r*r+i*i<=n}export{B as DrawOperation,I as defaultCursor,L as defaultLoadingCursor};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{diff as r}from"../../core/accessorSupport/diffUtils.js";import{EventedAccessor as i}from"../../core/Evented.js";import{clone as a}from"../../core/lang.js";import{destroyMaybe as o,equalsMaybe as s}from"../../core/maybe.js";import{memoize as c}from"../../core/memoize.js";import{ignoreAbortErrors as l}from"../../core/promiseUtils.js";import u from"../../core/ReactiveSet.js";import{watch as d,syncAndInitial as f}from"../../core/reactiveUtils.js";import{createScreenPoint as p}from"../../core/screenUtils.js";import{UpdatingHandles as m}from"../../core/support/UpdatingHandles.js";import{pointEquals as h,pointNear as g}from"../../layers/graphics/dehydratedFeatureComparison.js";import{getEffectiveElevationInfo as _}from"../../support/elevationInfoUtils.js";import{createCoordinateHelper as v}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,sceneSnappingAtLocation as b}from"../interactive/dragEventPipeline.js";import{EditGeometry as x,Part as S}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as C}from"../interactive/editGeometry/EditGeometryOperations.js";import w from"../interactive/options/LabelOptions.js";import{isPoint as T}from"../interactive/sketch/constraints.js";import{getPointConstraint as E,getPolylineOrPolygonConstraint as D,pointToConstraintSpace as O,constraintSpaceToPoint as k}from"../interactive/sketch/constraintUtils.js";import{SnappingContext as A}from"../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as j}from"../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as M}from"../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as N}from"../interactive/snapping/snappingUtils.js";import{defaultDrawingMode as P}from"./drawingModes.js";import{LegacyDrawManipulator as F}from"./LegacyDrawManipulator.js";const I=`crosshair`,L=`progress`,R=Symbol(),z=Symbol();let B=class extends i{constructor(e){super(e),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new u,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new m,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=c(E),this._getPolylineOrPolygonConstraint=c(D),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new w,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,e.elevationInfo??(this.elevationInfo=_(!!e.hasZ))}initializePointer(){let e=this.view.inputManager?.latestPointerInfo;e!=null&&e.type!==`touch`&&this._updatePointer(e.location,e.id,e.type)}initialize(){let{geometryType:e,view:t,spatialReference:n}=this,i=e===`segment`||e===`multipoint`?`polyline`:e;this.coordinateHelper=v(this.hasZ,this.hasM,n),this._editGeometryOperations=new C(new x(i,this.coordinateHelper),t.state.isGlobal),this._snappingOperation=new M({view:t}),this.addHandles([d(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:e,constraint:t},n)=>{let{snappingOptions:r}=this;if(r&&(r.forceDisabled=t!=null&&T(t)),n!=null&&e===n.stagedPoint&&t!==n.constraint)return this._onKeyboardBasedChange();this._processCursor(e??this._screenToMap(this._stagedScreenPoint))},{equals:(e,t)=>e.stagedPoint===t.stagedPoint&&s(e.constraint,t.constraint)}),d(()=>this.view.viewpoint,(e,t)=>{e&&t&&r(e,t)&&this._onKeyboardBasedChange()})]),this._activePart=new S(n,t.state.isGlobal),this._editGeometryOperations.data.parts.push(this._activePart);let a=this.segmentLabels;a!=null&&(a.context={view:t,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles(d(()=>this.labelOptions.enabled,e=>{a.visible=e},f))),this.addHandles(this._editGeometryOperations.on([`vertex-add`,`vertex-update`,`vertex-remove`],e=>{let t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),n=t.map(e=>e.coordinates),r=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getFirstVertex()?.pos)??null;h(r,this.firstVertex)||(this.firstVertex=r);let i=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.getLastVertex()?.pos)??null;h(i,this.lastVertex)||(this.lastVertex=i);let a=this.coordinateHelper.vectorToDehydratedPoint(this._activePart.segments.at(-1)?.leftVertex?.pos)??null;switch(h(a,this.secondToLastVertex)||(this.secondToLastVertex=a),this._processCursor(this.cursorVertex),e.type){case`vertex-add`:this.emit(e.type,{...e,added:n,vertices:t});break;case`vertex-update`:this.emit(e.type,{...e,updated:n,vertices:t});break;case`vertex-remove`:this.emit(e.type,{...e,removed:n,vertices:t})}}));let o=this._manipulator=new F({consumesClicks:!1,grabbableForEvent:e=>this.drawingMode!==`click`||e.pointerType===`touch`&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(o),o.grabbable=e!==`point`&&e!==`multipoint`,this.addHandles([o.events.on(`immediate-click`,e=>this._onImmediateClick(e)),o.events.on(`immediate-double-click`,e=>this._onImmediateDoubleClick(e)),d(()=>this.drawingMode,()=>{this.removeHandles(R),this.addHandles(this._createManipulatorDragPipeline(o),R)},f),d(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:e})=>{o.cursor=e},f)]),N(this,()=>{let e=this.view.inputManager.latestPointerInfo?.type??`mouse`,t=this._getSnappingContext(e);if(this.snappingManager!=null){let e=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,t);this._updatingHandles.consumePromise(l(e))}})}destroy(){o(this.segmentLabels),o(this._snappingOperation),this._editGeometryOperations=o(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){let{_stagedPointerId:e,_manipulator:t}=this;return e!=null&&this._pointerDownStates.has(e)||t.grabbing||!t.interactive}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){let e=this._updateAndGetEffectiveDrawSurface();return this.view.type===`3d`&&this.drawSurface!==e}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activePart.vertices.map(e=>this.coordinateHelper.vectorToArray(e.pos))}get _constraint(){let{constraints:e,constraintsEnabled:t}=this;if(e&&t)switch(this.geometryType){case`point`:case`multipoint`:return this._getPointConstraint(e);case`polygon`:case`polyline`:return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,e)}}set drawingMode(e){this._set(`drawingMode`,e??P)}get effectiveCursor(){return this.loading?L:this._hideDefaultCursor?null:this.cursor||I}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activePart.vertices.length}get snappingOptions(){return this.snappingManager==null?null:this.snappingManager.options}get spatialReference(){return this._get(`spatialReference`)??this.view.spatialReference}get cursorVertex(){return this._get(`cursorVertex`)}get visualizationCursorVertex(){return this._stagedPointerType===`mouse`?this.cursorVertex:null}get committableVertex(){let{cursorVertex:e,lastVertex:t,firstVertex:n,geometryType:r}=this;return r===`polygon`&&g(e,n)||g(e,t)?null:e}get updating(){return this.loading||this._updatingHandles.updating||!!this.segmentLabels?.updating}get geometryIncludingUncommittedVertices(){let{committedVertices:e,committableVertex:t,coordinateHelper:n}=this,r=e.slice();return t!=null&&r.push(n.pointToArray(t)),r}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();let{committableVertex:e}=this;e!=null&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e),this._activePart)}complete(e){let t=e?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();let{geometryType:n,numCommittedVertices:r}=this,i=n===`multipoint`&&r===0||n===`polyline`&&r<2||n===`polygon`&&r<3;(n===`segment`||n===`point`)&&this.commitStagedVertex(),this._createOperationCompleted=!i,(this.isCompleted||t)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit(`complete`,{vertices:this.committedVertices.map((e,t)=>({componentIndex:0,vertexIndex:t,coordinates:e})),aborted:t,type:`complete`}))}onInputEvent(e){switch(e.type){case`pointer-down`:this._pointerDownStates.add(e.pointerId);break;case`pointer-up`:this._pointerDownStates.delete(e.pointerId)}switch(e.type){case`pointer-move`:return this._onPointerMove(e);case`hold`:return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(e){let t=a(this.cursorVertex),n=a(e),r=n&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(n)??n),i=this._snapToClosingVertex(r),o=this._applyConstraints(i);g(t,o)||(this._set(`cursorVertex`,o),this.segmentLabels?.set(`stagedVertex`,o==null?null:this.coordinateHelper.pointToVector(o)),o==null||this._stagedPointerType!==`mouse`?this.emit(`cursor-remove`):this.emit(`cursor-update`,{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activePart.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:`apply`,type:`vertex-update`}))}_snapToClosingVertex(e){if(e==null||this._isDragging||this.geometryType!==`polygon`||this.numCommittedVertices<=2)return e;let t=this._mapToScreen(e);if(!t)return e;let n=this._activePart;return this._vertexWithinPointerDistance(n.vertices[0].pos,t)?this.firstVertex:this._vertexWithinPointerDistance(n.vertices.at(-1).pos,t)?this.lastVertex:e}_createManipulatorDragPipeline(e){switch(this.drawingMode){case`click`:return this._createManipulatorDragPipelineClick(e);case`freehand`:return this._createManipulatorDragPipelineFreehand(e);case`hybrid`:return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return y(e,(e,t,n,r)=>{let i=r===`touch`&&this._snappingEnabled;if(this.isCompleted||!i)return;let{snappingStep:a,cancelSnapping:o}=j({predicate:()=>i,snappingManager:this.snappingManager,snappingContext:new A({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:r,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n.next(e=>(i&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),e)).next(o),t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._processCursor(e.mapStart),(this.geometryType===`segment`||i&&!this.numCommittedVertices)&&this.commitStagedVertex()),e)).next(b(this.view,this.elevationInfo)).next(...a).next(e=>(i&&(this._processCursor(e.mapEnd),e.action===`end`&&this.commitStagedVertex()),e)).next(e=>(e.action===`end`&&(this._stagedPointerType!==`mouse`&&this._snappingOperation.abort(),(this.geometryType===`segment`||this.geometryType===`point`)&&this.complete()),e))})}_createManipulatorDragPipelineFreehand(e){return y(e,(e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._snappingOperation.abort(),this.committableVertex??this._processCursor(e.mapStart),this.geometryType===`segment`&&this.commitStagedVertex()),e)).next(e=>{switch(e.action){case`start`:case`update`:this._processCursor(e.mapEnd),(this.geometryType===`polygon`||this.geometryType===`polyline`)&&this.commitStagedVertex();break;case`end`:this.complete()}return e})})}_createManipulatorDragPipelineHybrid(e){return y(e,(e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next(e=>(e.action===`start`&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),z),this._processCursor(e.mapStart),this.commitStagedVertex()),e)).next(e=>{switch(e.action){case`start`:case`update`:this._processCursor(e.mapEnd),(this.geometryType===`polygon`||this.geometryType===`polyline`)&&this.commitStagedVertex();break;case`end`:this._stagedPointerType!==`mouse`&&this._snappingOperation.abort(),this.removeHandles(z),(this.geometryType===`segment`||this.geometryType===`point`)&&this.complete()}return e})})}get _drawAtFixedElevation(){let{constraintsEnabled:e,constraintZ:t,geometryType:n,numCommittedVertices:r}=this;return e?t!=null||n===`segment`&&r>0:(n===`segment`||n===`polygon`)&&r>0}_updateAndGetEffectiveDrawSurface(){let{constraintsEnabled:e,coordinateHelper:t,drawSurface:n,elevationDrawSurface:r,snapToSceneEnabled:i}=this;if(r==null)return n;if(!this.hasZ)return r.defaultZ=null,r;let a=this.elevationInfo?.mode,o=this.defaultZ,s=e||a===`absolute-height`;return i!=null&&(s=i),a===`on-the-ground`&&(s=!1),this._drawAtFixedElevation&&(o=(e?this.constraintZ:null)??t.getZ(this._activePart.vertices[0].pos),s=!1),s?n:(r.defaultZ=o,r)}_mapToScreen(e){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(e)}_onHold(e){this._snappingOperation.abort(),this.drawingMode===`click`&&e.pointerType===`touch`&&this._snappingEnabled&&this._processCursor(e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if(!(e.pointerType===`mouse`&&e.button===2||this._manipulator.dragging))try{let{drawingMode:t,geometryType:n}=this;this._stagedPointerType=e.pointerType,this._stagedScreenPoint=e.screenPoint;let r=this._screenToMap(e.screenPoint);if(r==null||r==null||t===`freehand`&&n!==`point`&&n!==`multipoint`)return;if(this._snappingEnabled&&this.cursorVertex!=null||this._processCursor(r),this.committableVertex==null){this.complete();return}this.commitStagedVertex(),e.pointerType!==`mouse`&&this._processCursor(null),(t===`freehand`&&this.geometryType!==`multipoint`||n===`point`||n===`segment`&&this.numCommittedVertices===2||n===`segment`&&t===`hybrid`&&this.numCommittedVertices===1)&&this.complete()}finally{e.stopPropagation()}}_onImmediateDoubleClick(e){this._manipulator.dragging||this.geometryType===`point`||(this.complete(),e.stopPropagation())}_onPointerMove(e){let t=p(e.x,e.y);this._updatePointer(t,e.pointerId,e.pointerType)&&e.stopPropagation()}_updatePointer(e,t,n){return this._stagedScreenPoint=e,this._stagedPointerType=n,this._stagedPointerId=t,this._isDragging?(this._snappingOperation.abort(),!1):(this._processCursorMovementRelativeToSurface(e,n),!0)}_onKeyboardBasedChange(){this._stagedPointerType!==`mouse`||!this._stagedScreenPoint||this._stagedPointerId==null||this._isDragging?this._snappingOperation.abort():this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType)}_processCursorMovementRelativeToSurface(e,t){let n=this._snappingOperation,r=this._screenToMap(e),i=this._requiresScenePoint?this.drawSurface?.screenToMap(e):null;if(r==null){this._hideDefaultCursor=!0,this._processCursor(null),n.abort();return}this._hideDefaultCursor=!1;let a=this.snappingManager;if(a==null){this._processCursor(r),n.abort();return}let o=this._getSnappingContext(t);this._updatingHandles.consumePromise(l(n.snap({point:r,scenePoint:i},a,o)))}_applyConstraints(e){let{_constraint:t,constraints:n}=this;if(!e||!n||!t)return e;let{context:r}=n,i=O(e,r),a=i?t.closestTo(i):void 0;if(!a)return e;let o=k(a,e,r),s=this.view.type===`2d`||r.elevationInfo.mode!==`absolute-height`;return o!=null&&s&&this.constraintZ!=null&&this.hasZ&&(o.z=this.constraintZ),o}_screenToMap(e){return e?this._updateAndGetEffectiveDrawSurface()?.screenToMap(e):null}_screenToMapDragEventStep(){let e=null;return t=>{if(t.action===`start`&&(e=this._screenToMap(t.screenStart)),e==null)return null;let n=this._screenToMap(t.screenEnd);return n==null?null:{...t,mapStart:e,mapEnd:n}}}_vertexWithinPointerDistance(e,t){let n=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return n!=null&&V(n,t,25)}_getSnappingContext(e){let t=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new A({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:t==null?null:{value:t,elevationInfo:this.elevationInfo},drawConstraints:this.constraints})}};e([t()],B.prototype,`_hideDefaultCursor`,void 0),e([t()],B.prototype,`_stagedPointerId`,void 0),e([t()],B.prototype,`_isDragging`,null),e([t()],B.prototype,`_snappingOperation`,void 0),e([t()],B.prototype,`_snappingEnabled`,null),e([t({constructOnly:!0})],B.prototype,`graphic`,void 0),e([t()],B.prototype,`constraintsEnabled`,void 0),e([t()],B.prototype,`constraints`,void 0),e([t()],B.prototype,`_constraint`,null),e([t()],B.prototype,`constraintZ`,void 0),e([t()],B.prototype,`defaultZ`,void 0),e([t()],B.prototype,`isDraped`,void 0),e([t({value:P})],B.prototype,`drawingMode`,null),e([t({constructOnly:!0})],B.prototype,`elevationDrawSurface`,void 0),e([t({constructOnly:!0})],B.prototype,`elevationInfo`,void 0),e([t({constructOnly:!0,type:w})],B.prototype,`labelOptions`,void 0),e([t({constructOnly:!0})],B.prototype,`geometryType`,void 0),e([t({constructOnly:!0})],B.prototype,`hasM`,void 0),e([t({constructOnly:!0})],B.prototype,`hasZ`,void 0),e([t()],B.prototype,`cursor`,void 0),e([t()],B.prototype,`effectiveCursor`,null),e([t()],B.prototype,`loading`,void 0),e([t({constructOnly:!0})],B.prototype,`manipulators`,void 0),e([t({constructOnly:!0})],B.prototype,`drawSurface`,void 0),e([t({constructOnly:!0})],B.prototype,`segmentLabels`,void 0),e([t({constructOnly:!0})],B.prototype,`snappingManager`,void 0),e([t({constructOnly:!0})],B.prototype,`snappingVisualizer`,void 0),e([t()],B.prototype,`snapToSceneEnabled`,void 0),e([t({constructOnly:!0})],B.prototype,`spatialReference`,null),e([t({readOnly:!0})],B.prototype,`cursorVertex`,null),e([t({readOnly:!0})],B.prototype,`visualizationCursorVertex`,null),e([t()],B.prototype,`committableVertex`,null),e([t()],B.prototype,`firstVertex`,void 0),e([t()],B.prototype,`lastVertex`,void 0),e([t()],B.prototype,`secondToLastVertex`,void 0),e([t()],B.prototype,`updating`,null),e([t({constructOnly:!0})],B.prototype,`view`,void 0),B=e([n(`esri.views.draw.DrawOperation`)],B);function V(e,t,n){let r=e.x-t.x,i=e.y-t.y;return r*r+i*i<=n}export{B as DrawOperation,I as defaultCursor,L as defaultLoadingCursor};
|