@arcgis/core 6.0.0-next.40 → 6.0.0-next.42
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/Camera.js +1 -1
- package/applications/Components/arcadeFeatureUtils.d.ts +12 -0
- package/applications/Components/arcadeFeatureUtils.js +1 -1
- package/arcgisGlobal.d.ts +0 -2
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +1 -0
- package/assets/esri/core/workers/chunks/{1c406ab2bf99ac563316.js → 0696fa44a04b99738d7b.js} +1 -1
- package/assets/esri/core/workers/chunks/075fe33152fd79fe6d72.js +1 -0
- package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +1 -0
- package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +1 -0
- package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +1 -0
- package/assets/esri/core/workers/chunks/0d87cb6417672de95d53.js +1 -0
- package/assets/esri/core/workers/chunks/11877d4dc97f756e4711.js +1 -0
- package/assets/esri/core/workers/chunks/1860104c2b33f68785dd.js +1 -0
- package/assets/esri/core/workers/chunks/1980fd7ae1617ef4d19d.js +1 -0
- package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +1 -0
- package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +1 -0
- package/assets/esri/core/workers/chunks/{14d81280807a3d3c1b7e.js → 244ffdb91237d1cbade3.js} +1 -1
- package/assets/esri/core/workers/chunks/24bdeafbb16ae83bb8c3.js +1 -0
- package/assets/esri/core/workers/chunks/2690d5fcd9d5ca92ebf6.js +1 -0
- package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +1 -0
- package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +1 -0
- package/assets/esri/core/workers/chunks/2e760d04641755d1820d.js +1 -0
- package/assets/esri/core/workers/chunks/{0b21d0e2e5a91c34a108.js → 2f54e4feb554c1a7b9c4.js} +1 -1
- package/assets/esri/core/workers/chunks/348f28d7ab46df878c6f.js +1 -0
- package/assets/esri/core/workers/chunks/{7023651ed6398dcf8efb.js → 36bafcc29ac133a05558.js} +7 -7
- package/assets/esri/core/workers/chunks/36e5f070009b29b7ac3d.js +1 -0
- package/assets/esri/core/workers/chunks/39c23a52d7c3e1ee121c.js +1 -0
- package/assets/esri/core/workers/chunks/{5504ec9bd9ee4d10af07.js → 3f74c61359b4bd6dcf00.js} +1 -1
- package/assets/esri/core/workers/chunks/{00311d1b18d5952a014b.js → 446d172834f8675f1202.js} +1 -1
- package/assets/esri/core/workers/chunks/45aaefbdffe5e15dfb24.js +1 -0
- package/assets/esri/core/workers/chunks/48c6230b8a6d3a8a7906.js +1 -0
- package/assets/esri/core/workers/chunks/4c73c493dabe949c2512.js +1 -0
- package/assets/esri/core/workers/chunks/{592b5db1459c02cf6a0c.js → 4d62877f521cc9663535.js} +1 -1
- package/assets/esri/core/workers/chunks/{2fcd7db1e192858a650e.js → 503ee206e7de1f65e291.js} +1 -1
- package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +1 -0
- package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +1 -0
- package/assets/esri/core/workers/chunks/{76e80381fa6d1e084796.js → 5dea74fe52583e77f3ce.js} +1 -1
- package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +1 -0
- package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +1 -0
- package/assets/esri/core/workers/chunks/67c2e5953087dadfd245.js +1 -0
- package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +1 -0
- package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +1 -0
- package/assets/esri/core/workers/chunks/6d863761f29f31a030eb.js +1 -0
- package/assets/esri/core/workers/chunks/{ce8ef2eec290e1df6b2a.js → 7390af96250e89194332.js} +1 -1
- package/assets/esri/core/workers/chunks/7452b5ae971a9ff2e6e9.js +1 -0
- package/assets/esri/core/workers/chunks/7672c123cfb960f4ddad.js +1 -0
- package/assets/esri/core/workers/chunks/{9934e8e19f94e9169eea.js → 776b64a1e1a57878c34c.js} +1 -1
- package/assets/esri/core/workers/chunks/{1ec772eaa63eb6937231.js → 8140ed6e44c3d8536d3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{58716a3a6106a1b0fb9d.js → 832c887fdc5af4c08cf2.js} +1 -1
- package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +1 -0
- package/assets/esri/core/workers/chunks/867502158997cb2d6406.js +1 -0
- package/assets/esri/core/workers/chunks/8ceb6697e8adbeffe019.js +1 -0
- package/assets/esri/core/workers/chunks/8fe22c2370219f25c15b.js +1 -0
- package/assets/esri/core/workers/chunks/91586bf29492735e692d.js +1 -0
- package/assets/esri/core/workers/chunks/{b2d6b1ac9fbb50c7c8ab.js → 929ca32ddbb43328ef31.js} +1 -1
- package/assets/esri/core/workers/chunks/a03f15f2cbc3fed291c2.js +1 -0
- package/assets/esri/core/workers/chunks/{123541f79be7adff0818.js → a422a801e55fa125546e.js} +1 -1
- package/assets/esri/core/workers/chunks/{22e73501e1435a896826.js → a5f17e9a025ac2b6e1bf.js} +1 -1
- package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +1 -0
- package/assets/esri/core/workers/chunks/{fd967a9f3cf0e2890dbb.js → a91dc05a6a609d04ed04.js} +1 -1
- package/assets/esri/core/workers/chunks/a99c50b4e1c7568210e1.js +1 -0
- package/assets/esri/core/workers/chunks/ab48faea5432e2dbd45c.js +1 -0
- package/assets/esri/core/workers/chunks/afe3e89737fb45189a99.js +1 -0
- package/assets/esri/core/workers/chunks/b18459c1bed75dbdec08.js +1 -0
- package/assets/esri/core/workers/chunks/{d03b82e962c70a3fd377.js → b4928831a2a13b2da745.js} +1 -1
- package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +1 -0
- package/assets/esri/core/workers/chunks/bbddeb1c893ff8bbae5d.js +1 -0
- package/assets/esri/core/workers/chunks/bc2e2bdf1194e6e9eb5e.js +1 -0
- package/assets/esri/core/workers/chunks/{dae2036faa28dade2119.js → beccbfff549902733c4e.js} +1 -1
- package/assets/esri/core/workers/chunks/c3ba1a3247e14f6b7b3a.js +1 -0
- package/assets/esri/core/workers/chunks/c5d0a034ff31d5954571.js +1 -0
- package/assets/esri/core/workers/chunks/{396299c22994c502e41c.js → c8057b47c7c6c02a0bda.js} +1 -1
- package/assets/esri/core/workers/chunks/{9e2c30b67bab5795306e.js → cb2329d1ea72ce5cc057.js} +1 -1
- package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +1 -0
- package/assets/esri/core/workers/chunks/d0172d31389dbfaaa848.js +1 -0
- package/assets/esri/core/workers/chunks/{f07fb9b3fa30d7ee1681.js → d4c8673ca65df874a7ce.js} +1 -1
- package/assets/esri/core/workers/chunks/{947f3a1cad976bba9738.js → d5e251cddd41d643510c.js} +1 -1
- package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +1 -0
- package/assets/esri/core/workers/chunks/dff845574c0037a1dca6.js +1 -0
- package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +1 -0
- package/assets/esri/core/workers/chunks/e0cf6e1e21d0ee739009.js +1 -0
- package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +1 -0
- package/assets/esri/core/workers/chunks/{c9feffb9884cfed52c4b.js → f190a3124d6d03417d73.js} +1 -1
- package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +1 -0
- package/assets/esri/core/workers/chunks/fbe3a3b9d6c8c0b52f65.js +1 -0
- package/assets/esri/core/workers/chunks/fd17c4a9e13bf77aa86a.js +1 -0
- package/assets/esri/core/workers/chunks/fdd2b35388f9fe42b623.js +1 -0
- package/assets/esri/core/workers/chunks/fe7184993ef5713d13fb.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/themes/base/_core.scss +0 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/cameraUtilsPlanar.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.d.ts +1 -1
- package/core/Accessor.js +1 -1
- package/core/Logger.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/Property.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/deprecate.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/mat4.js +1 -1
- package/core/types.d.ts +0 -5
- package/core/workers/workers.js +1 -6
- package/core/workers.d.ts +1 -2
- package/geometry/Extent.js +1 -1
- package/geometry/Geometry.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/Polyline.js +1 -1
- package/geometry/coordinateFormatter.js +1 -1
- package/geometry/operators/gx/operatorRelate.js +2 -0
- package/geometry/operators/relateOperator.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/interfaces.d.ts +0 -17
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.js +1 -1
- package/layers/BaseTileLayer.js +1 -1
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/ElevationLayer.d.ts +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoRSSLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.d.ts +4 -3
- package/layers/IntegratedMeshLayer.d.ts +4 -3
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/OpenStreetMapLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/WebTileLayer.js +1 -1
- package/layers/graphics/sources/CSVSource.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/datasets/RasterFactory.js +1 -1
- package/layers/raster/datasets/ZarrRaster.js +2 -0
- package/layers/raster/datasets/datasetUtils.js +1 -1
- package/layers/raster/datasets/zarrParser.js +2 -0
- package/layers/raster/datasets/zarrUtils.js +2 -0
- package/layers/raster/formats/pixelRangeUtils.js +1 -1
- package/layers/raster/formats/tiffParser.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/GeometryDescriptor.js +1 -1
- package/layers/support/KMLSublayer.js +1 -1
- package/layers/support/SceneModifications.d.ts +1 -3
- package/layers/support/SceneModifications.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/legend/ActiveLayerInfo.js +1 -1
- package/package.json +4 -4
- package/portal/Portal.js +1 -1
- package/portal/PortalItem.js +1 -1
- package/rest/query/executePivotQuery.js +1 -1
- package/rest/query/operations/queryPivot.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/PivotQuery.js +1 -1
- package/rest/support/Query.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
- package/support/LayersMixin.d.ts +2 -2
- package/symbols/PictureFillSymbol.js +1 -1
- package/symbols/PictureMarkerSymbol.js +1 -1
- package/symbols/SimpleFillSymbol.js +1 -1
- package/symbols/SimpleLineSymbol.js +1 -1
- package/symbols/SimpleMarkerSymbol.js +1 -1
- package/symbols/Symbol3D.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/symbols/cim/Rasterizer.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/PaddedViewState.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/WMSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStateSet.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStates.js +1 -1
- package/views/3d/layers/i3s/Highlights.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
- package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +2 -0
- package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
- package/views/3d/layers/support/createFeatureFilterHighlight.js +2 -0
- package/views/3d/layers/support/createTileBVHForLayer.js +2 -0
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/highlightUtils.js +1 -1
- package/views/3d/layers/support/selectTiles3DSpatialReference.js +2 -0
- package/views/3d/layers/support/tileBoundingVolumeUtils.js +2 -0
- package/views/3d/support/GaussianSplatSortWorker.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/earthUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatSortCoordinator.js +2 -0
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/createWebGLContext.js +2 -0
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/internal/ribbonLineBufferUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedMaterialConfiguration.js +2 -0
- package/views/3d/webgl.d.ts +2 -1
- package/views/3d/webgl.js +1 -1
- package/views/SceneView.d.ts +9 -5
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.d.ts +1 -3
- package/views/View2D.d.ts +2 -2
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/interactive/options/ViewOptions.d.ts +0 -2
- package/views/layers/FeatureLikeLayerView.d.ts +3 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/GraphicsLayerView.d.ts +3 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/SceneLayerView.d.ts +3 -2
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/types.d.ts +1 -0
- package/webscene/version.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +0 -1
- package/widgets/Editor.d.ts +0 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/support/FeatureElementInfo.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/SizeRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltip.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +0 -1
- package/widgets/Sketch.d.ts +0 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Spinner.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList/ListItemPanel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.js +1 -1
- package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider.js +1 -1
- package/widgets/smartMapping/OpacitySlider.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/PluginSettingsControls.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/TimezonePicker.js +1 -1
- package/widgets/support/UnitSelect.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/01803f76bc0d9f2cd566.js +0 -1
- package/assets/esri/core/workers/chunks/02940f7ddaf98e69521e.js +0 -1
- package/assets/esri/core/workers/chunks/07e5482e1fc69be5de09.js +0 -1
- package/assets/esri/core/workers/chunks/0c893837f67829757df7.js +0 -1
- package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +0 -1
- package/assets/esri/core/workers/chunks/1a91443970d64a59521d.js +0 -1
- package/assets/esri/core/workers/chunks/1deca3de77b1a9a07da4.js +0 -1
- package/assets/esri/core/workers/chunks/1fd82fcba2758741996a.js +0 -1
- package/assets/esri/core/workers/chunks/20a2124cbe43e5527c40.js +0 -1
- package/assets/esri/core/workers/chunks/26ea39dfdf887f357fce.js +0 -1
- package/assets/esri/core/workers/chunks/276a0b549acf048e8673.js +0 -1
- package/assets/esri/core/workers/chunks/2c3612379111457c3221.js +0 -1
- package/assets/esri/core/workers/chunks/34467f7d84baffd772a3.js +0 -1
- package/assets/esri/core/workers/chunks/398ec098fffe6abceedd.js +0 -1
- package/assets/esri/core/workers/chunks/3b32a24488b3068f0cb7.js +0 -1
- package/assets/esri/core/workers/chunks/427d929dc7f89b0a1ea9.js +0 -1
- package/assets/esri/core/workers/chunks/432728c557be5dfa26b5.js +0 -1
- package/assets/esri/core/workers/chunks/4c240ca50f70bf30813f.js +0 -1
- package/assets/esri/core/workers/chunks/4d8833f48348cbbcc947.js +0 -1
- package/assets/esri/core/workers/chunks/514cc15acb77dc85035c.js +0 -1
- package/assets/esri/core/workers/chunks/585ae43c7bcb86a26762.js +0 -1
- package/assets/esri/core/workers/chunks/5e48898cebb6dbaf09b5.js +0 -1
- package/assets/esri/core/workers/chunks/5ec5a6cef9ee9a8cc400.js +0 -1
- package/assets/esri/core/workers/chunks/601e1d020b8115497944.js +0 -1
- package/assets/esri/core/workers/chunks/687deb918eb48a963c8f.js +0 -1
- package/assets/esri/core/workers/chunks/6a21dc13a465757ba007.js +0 -1
- package/assets/esri/core/workers/chunks/6e910342ada398c98e30.js +0 -1
- package/assets/esri/core/workers/chunks/78818c2a898444f7e890.js +0 -1
- package/assets/esri/core/workers/chunks/7d2cbc767c336d15e4d5.js +0 -1
- package/assets/esri/core/workers/chunks/7d497df6e13162156342.js +0 -1
- package/assets/esri/core/workers/chunks/7dbf4c7480bf9c72820d.js +0 -1
- package/assets/esri/core/workers/chunks/80c234ee5276ea1645db.js +0 -1
- package/assets/esri/core/workers/chunks/8c3779de09291170497f.js +0 -1
- package/assets/esri/core/workers/chunks/966204d6dedc8149c3e9.js +0 -1
- package/assets/esri/core/workers/chunks/9ab0735e86cf8932bf9d.js +0 -1
- package/assets/esri/core/workers/chunks/a0356702f2d3f787aeac.js +0 -1
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +0 -1
- package/assets/esri/core/workers/chunks/ab0ea4042f4e13874aed.js +0 -1
- package/assets/esri/core/workers/chunks/ab98ade3257360015d6c.js +0 -1
- package/assets/esri/core/workers/chunks/b13d8f4e4e80ef00b1bd.js +0 -1
- package/assets/esri/core/workers/chunks/b15a8d4322f3b7819d2f.js +0 -1
- package/assets/esri/core/workers/chunks/b3aa29589dcfb5b93106.js +0 -1
- package/assets/esri/core/workers/chunks/b472c0a21ae29e653f7d.js +0 -1
- package/assets/esri/core/workers/chunks/b90271ce38522bcf813b.js +0 -1
- package/assets/esri/core/workers/chunks/ba91df9835cdea7698a9.js +0 -1
- package/assets/esri/core/workers/chunks/bd812dd75d2a3d7d0441.js +0 -1
- package/assets/esri/core/workers/chunks/bfe13ac9fa1aafb190a1.js +0 -1
- package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +0 -1
- package/assets/esri/core/workers/chunks/c31830ee897d5a7f2582.js +0 -1
- package/assets/esri/core/workers/chunks/c48d97c38e821be17dc5.js +0 -1
- package/assets/esri/core/workers/chunks/c7ad62f54d2abe1d17a0.js +0 -1
- package/assets/esri/core/workers/chunks/cf21b217b13770757cb8.js +0 -1
- package/assets/esri/core/workers/chunks/d42a4f47843e075c56a8.js +0 -1
- package/assets/esri/core/workers/chunks/deb408bee61ca192b2ce.js +0 -1
- package/assets/esri/core/workers/chunks/e121d15b883184ee83e7.js +0 -1
- package/assets/esri/core/workers/chunks/e4042e43f0081fe49f7b.js +0 -1
- package/assets/esri/core/workers/chunks/e932951598499befabf5.js +0 -1
- package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +0 -1
- package/assets/esri/core/workers/chunks/f06ef153e106b26a6748.js +0 -1
- package/assets/esri/core/workers/chunks/faae3c43048b42341536.js +0 -1
- package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +0 -46
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ar.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.bg.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.bs.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ca.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.cs.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.da.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.de.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.el.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.en.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.es.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.et.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.fi.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.fr.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.he.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.hr.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.hu.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.id.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.it.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ja.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ko.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.lt.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.lv.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.nl.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.no.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pl.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pt-BR.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pt-PT.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ro.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ru.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sk.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sl.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sr.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sv.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.th.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.tr.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.uk.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.vi.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-CN.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-HK.json +0 -1
- package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-TW.json +0 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.d.ts +0 -72
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +0 -2
- package/widgets/UtilityNetworkValidateTopology.d.ts +0 -130
- package/widgets/UtilityNetworkValidateTopology.js +0 -2
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 n from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as i}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{destroyHandle as s,makeHandle as c}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{mapCollectionAsync as ee}from"../core/mapCollectionUtils.js";import{destroyMaybe as u,maybeProperty as te}from"../core/maybe.js";import{throwIfDestroyed as ne,throwIfAborted as d,createAbortError as re}from"../core/promiseUtils.js";import ie from"../core/ReactiveSet.js";import{on as f,watch as p,initial as m,sync as h,whenOnce as ae,syncAndInitial as g}from"../core/reactiveUtils.js";import{setFrameDuration as oe,cleanupScheduling as se}from"../core/scheduling.js";import{createScreenPoint as ce,createScreenPointArray as le}from"../core/screenUtils.js";import{cleanupWhereClauseCache as ue}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as de,getMetersPerUnitForSR as fe}from"../core/units.js";import{property as _,cast as v,subclass as pe}from"../core/accessorSupport/decorators.js";import{ensureType as y,ensureClass as b}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as me}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as he}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ge}from"../core/accessorSupport/trackingUtils.js";import{create as _e}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ve}from"../core/libs/rbush/PooledRBush.js";import{initialize as ye}from"../core/workers/workers.js";import x from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import S from"../geometry/Point.js";import{project as C,canProjectWithoutEngine as xe}from"../geometry/projectionUtils.js";import w from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Se}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Ce}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as T}from"../geometry/projection/projectPointToVector.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{isImageryTileLayer as E,isTiledLayer as D,isVoxelLayer as O,isIntegratedMeshLayer as k,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{BreakpointsOwner as Fe}from"./BreakpointsOwner.js";import{DOMContainer as Ie}from"./DOMContainer.js";import{PopupView as Le}from"./PopupView.js";import A from"./View.js";import Re from"./ViewAnimation.js";import{stringFromViewingMode as j,viewingModeFromString as M}from"./ViewingMode.js";import{GroundView3D as ze}from"./3d/GroundView3D.js";import{layerView3DImporter as N}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as Be}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Ve}from"./3d/camera/intersectionUtils.js";import P from"./3d/constraints/Constraints.js";import F from"./3d/environment/Environment.js";import{EnvironmentView as He}from"./3d/environment/EnvironmentView.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{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{ScreenSizePerspective as Je}from"./3d/state/ScreenSizePerspective.js";import I from"./3d/state/ViewState.js";import{ViewStateManager as Ye,cleanupViewStateManager as Xe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ze}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Qe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as $e}from"./3d/state/utils/navigationUtils.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as L}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{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as R}from"./3d/support/QualityProfile.js";import z 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{PointsOfInterest as B}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import V 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{Stage as vt}from"./3d/webgl-engine/Stage.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{defaultTolerance as H}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as U}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as St}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import W from"./interactive/options/ViewOptions.js";import Ct from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as wt}from"./support/drapedUtils.js";import{occludeesSupported as Tt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as G,createScreenPointFromSupportedEvent as K}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Et}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Dt,destroyTextureCompressionWorker as Ot}from"./support/TextureCompressionHelper.js";import kt from"./ui/DefaultUI.js";import At from"./ui/3d/DefaultUI3D.js";import jt from"../webscene/Environment.js";import{clearVNodeCache as Mt}from"../widgets/support/vnodeCache.js";var q;const Nt=Symbol(),J=Symbol();function Pt(e){let t=b(W,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let Y=class extends Fe(Le(Ie(A))){static{q=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new W({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 P,this._environment=new F,this.environmentView=new He,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Ct({importAnalysisViewModule:e=>Be(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ie,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new I({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 At,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(s(ee(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([f(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),p(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ue({view:this}),this.stateManager=new Ye({view:this}),this.screenSizePerspective=new Je({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=Dt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ze({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>oe(e>0?1e3/Math.ceil(e):0),m),this.addHandles([p(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),p(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(Ot(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,u(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this._set(`labeler`,u(this.labeler)),this._set(`deconflictor`,u(this.deconflictor)),this._resourceController=u(this._resourceController),this._set(`stateManager`,u(this.stateManager)),this._set(`inputManager`,u(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,u(this.environmentView)),this._set(`environment`,u(this.environment)),this.groundView=u(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=y(S,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||te(e,`clippingArea`);return!(this._userClippingArea||te(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof x?this.spatialReference&&(t=X(t,this.spatialReference),t==null)?(l.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):(l.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?l.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===1)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:X(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||w.WGS84,n=X(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||w.WGS84,t,n=n=>{let r=X(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 x({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 F?e:e instanceof jt?this.environment?.cloneWithWebsceneEnvironment(e)??F.fromWebsceneEnvironment(e):y(F,e):new F}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 q._layerToLayerview}static{this._layerToLayerview=A._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=R(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new z(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?he(()=>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=de(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&&l.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 L.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 L.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedViewingMode;if(e!=null)return j(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?j(this.defaultsFromMap.viewingMode):Et(t,1)?`global`:`local`:`global`}set viewingMode(e){this.ready?l.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 l.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Ft,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),T(t,Z,this.renderSpatialReference),this.state.camera.projectToScreen(Z,Q),ce(Q[0],Q[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;T(e,Z,n);let r=this.state.camera.computeScreenPixelSizeAt(Z);return t&&n!==t?r*fe(n)/fe(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(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 a(`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 a(`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()),o=await this._completeSettings(e);return o.format=`png`,[i,t(r[1],o,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new a(`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 N.importLayerView(e)}hasLayerViewModule(e){return N.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:M(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 Et(e,n)?t==null||E(t)?!0:!(D(t)&&mt(t,e,n)==null||O(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?w.WGS84:w.WebMercator:new w({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return E(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}]:!D(t)&&!O(t)&&(i||a)?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:D(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&&l.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${j(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.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),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return l.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&&Tt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{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 ae(()=>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),c(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await It[e]();if(t&&(ne(this),d(n.signal),await t(n.signal)),this.destroyed)throw re();return d(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 V({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 B({view:this})),this.addHandles([this.updatingHandles.add(()=>L.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&L.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=u(this._featureTreeDebugger))},g),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?C(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},g),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=u(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(J),this.removeHandles(Nt),this._featureTiles=u(this.featureTiles),this._set(`pointsOfInterest`,u(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.viewingMode=this.state.viewingMode,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(p(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&Ce(e,this.groundView.spatialReference,$,t)&&(this.renderCoordsHelper.extent=$)},h),J),this.sceneIntersectionHelper?.setTolerance(H/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(J)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(p(()=>[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(){let e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},t=new Qe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,t);let n=i(this.surface);this._stage=new vt({view:this,options:e,container:n}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),o(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new a(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=u(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface(),this._initStage(),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=>ae(()=>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=u(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(){M(this.viewingMode)===1&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(f(()=>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?me(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(U);for(let t of this.allLayerViews)(k(t.layer)&&(!has(`enable-feature:im-as-ground`)||t.layer.isUsedAsGroundLayer)||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(U);for(let t of this.allLayerViews)(has(`enable-feature:im-as-ground`)?k(t.layer)&&t.layer.isUsedAsGroundLayer:k(t.layer))&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Mt(),ge(),ue(),St(),Xe(),Ve(),Se(),wt(),Ne(),_t(),xt(),Ze(),$e(),ve(),se(),bt(),gt(),Ke.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),I.cleanupViewstate(),V.cleanupTerrainSurface()}};e([_({nonNullable:!0}),v(Pt)],Y.prototype,`options`,void 0),e([_()],Y.prototype,`_userClippingArea`,void 0),e([_()],Y.prototype,`_resourceController`,void 0),e([_()],Y.prototype,`stage`,null),e([_({readOnly:!0})],Y.prototype,`deconflictor`,void 0),e([_({readOnly:!0})],Y.prototype,`labeler`,void 0),e([_()],Y.prototype,`navigation`,void 0),e([_({type:Re,readOnly:!0})],Y.prototype,`animation`,null),e([_({readOnly:!0})],Y.prototype,`basemapTerrain`,void 0),e([_({readOnly:!0})],Y.prototype,`overlayManager`,null),e([_({readOnly:!0})],Y.prototype,`elevationProvider`,void 0),e([_()],Y.prototype,`camera`,null),e([_({type:t})],Y.prototype,`contentCamera`,null),e([_({readOnly:!0})],Y.prototype,`canvas`,null),e([_({type:S,useTypeForAutocast:!1})],Y.prototype,`center`,null),e([_({type:x})],Y.prototype,`clippingArea`,null),e([_({type:P,nonNullable:!0})],Y.prototype,`constraints`,void 0),e([_({type:x,readOnly:!0})],Y.prototype,`renderDataExtent`,null),e([_({readOnly:!0})],Y.prototype,`tileInfo`,null),e([_({type:x,readOnly:!0})],Y.prototype,`dataExtent`,null),e([_({type:x,readOnly:!0})],Y.prototype,`_groundAndLayersExtent`,null),e([_({type:F})],Y.prototype,`environment`,null),e([v(`environment`)],Y.prototype,`castEnvironment`,null),e([_({readOnly:!0})],Y.prototype,`environmentView`,void 0),e([_({type:x})],Y.prototype,`extent`,null),e([_({type:r})],Y.prototype,`floors`,void 0),e([_()],Y.prototype,`screenCenter`,null),e([_()],Y.prototype,`frustum`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`fullOpacity`,void 0),e([_({readOnly:!0})],Y.prototype,`graphicsView`,void 0),e([_()],Y.prototype,`analysisViewManager`,void 0),e([_()],Y.prototype,`groundView`,void 0),e([_({readOnly:!0})],Y.prototype,`layerviewCollections`,null),e([_({type:Boolean})],Y.prototype,`initialExtentRequired`,null),e([_()],Y.prototype,`defaultsFromMapSettings`,null),e([_()],Y.prototype,`interacting`,null),e([_()],Y.prototype,`stationary`,null),e([_()],Y.prototype,`navigating`,null),e([_()],Y.prototype,`map`,void 0),e([_()],Y.prototype,`padding`,null),e([_({type:B,readOnly:!0})],Y.prototype,`pointsOfInterest`,void 0),e([_()],Y.prototype,`_featureTiles`,void 0),e([_()],Y.prototype,`featureTiles`,null),e([_()],Y.prototype,`_featureTreeDebugger`,void 0),e([_({constructOnly:!0})],Y.prototype,`deactivatedWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`debugWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`renderCanvas`,void 0),e([_({constructOnly:!0})],Y.prototype,`state`,void 0),e([_()],Y.prototype,`screenSizePerspective`,void 0),e([_({readOnly:!0})],Y.prototype,`inputManager`,void 0),e([_({readOnly:!0})],Y.prototype,`stateManager`,void 0),e([_({type:[`low`,`medium`,`high`]})],Y.prototype,`qualityProfile`,null),e([_({type:z,get(){let e=this._get(`qualitySettings`);if(!e){let t=R(this.qualityProfile);e=new z(t)}return e}})],Y.prototype,`qualitySettings`,void 0),e([_()],Y.prototype,`slice`,void 0),e([_({readOnly:!0})],Y.prototype,`typeSpecificPreconditionsReady`,null),e([_({readOnly:!0})],Y.prototype,`sceneIntersectionHelper`,void 0),e([_({type:Number,readOnly:!0})],Y.prototype,`resolution`,null),e([_({type:Number})],Y.prototype,`scale`,null),e([_({readOnly:!0,type:Number})],Y.prototype,`terrainLevel`,null),e([_()],Y.prototype,`heightModelInfo`,null),e([_({type:w})],Y.prototype,`spatialReference`,void 0),e([_({type:Boolean,value:!1})],Y.prototype,`alphaCompositingEnabled`,null),e([_({constructOnly:!0})],Y.prototype,`preserveDrawingBufferEnabled`,void 0),e([_({type:Boolean})],Y.prototype,`supersampleScreenshotsEnabled`,void 0),e([_({readOnly:!0})],Y.prototype,`type`,void 0),e([_(),v(e=>e instanceof kt?e:b(At,e))],Y.prototype,`ui`,void 0),e([_({type:Boolean,readOnly:!0})],Y.prototype,`updating`,null),e([_()],Y.prototype,`_updatingObjects`,null),e([_()],Y.prototype,`_updatingObjectsWithProgress`,null),e([_()],Y.prototype,`_updatingObjectsToDebug`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`updatingProgress`,void 0),e([_({type:[`global`,`local`]})],Y.prototype,`viewingMode`,null),e([_({type:n})],Y.prototype,`viewpoint`,null),e([_({readOnly:!0})],Y.prototype,`visibleArea`,null),e([_({type:Number})],Y.prototype,`zoom`,null),e([_({readOnly:!0})],Y.prototype,`quality`,null),e([_({readOnly:!0})],Y.prototype,`resolutionScale`,null),e([_()],Y.prototype,`focusAreasView`,void 0),e([_()],Y.prototype,`_defaultToMapOptions`,null),e([_()],Y.prototype,`_defaultHitTestOptions`,null),Y=q=e([pe(`esri.views.SceneView`)],Y);function X(e,t){return e!=null&&xe(e.spatialReference,t)?C(e,t):null}const Z=_e(),Q=le(),$=Te(),Ft=Ae(0,0,0,w.WebMercator),It={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Lt=Y;export{Lt as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import n from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as i}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{destroyHandle as s,makeHandle as c}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{mapCollectionAsync as ee}from"../core/mapCollectionUtils.js";import{destroyMaybe as u,maybeProperty as d}from"../core/maybe.js";import{throwIfDestroyed as te,throwIfAborted as ne,createAbortError as re}from"../core/promiseUtils.js";import ie from"../core/ReactiveSet.js";import{on as f,watch as p,initial as m,sync as h,whenOnce as g,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as ae,cleanupScheduling as oe}from"../core/scheduling.js";import{createScreenPoint as se,createScreenPointArray as ce}from"../core/screenUtils.js";import{cleanupWhereClauseCache as le}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as ue,getMetersPerUnitForSR as de}from"../core/units.js";import{property as v,cast as y,subclass as fe}from"../core/accessorSupport/decorators.js";import{ensureType as b,ensureClass as x}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as pe}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as me}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as he}from"../core/accessorSupport/trackingUtils.js";import{create as ge}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as _e}from"../core/libs/rbush/PooledRBush.js";import{initialize as ve}from"../core/workers/workers.js";import S from"../geometry/Extent.js";import ye from"../geometry/HeightModelInfo.js";import C from"../geometry/Point.js";import{project as w,canProjectWithoutEngine as be}from"../geometry/projectionUtils.js";import T from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as xe}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Se}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as E}from"../geometry/projection/projectPointToVector.js";import{toExtent as Ce,create as we}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Te}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Ee}from"../geometry/support/scaleUtils.js";import{wgs84 as De,webMercator as Oe}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as ke}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as D,isTiledLayer as O,isVoxelLayer as k,isIntegratedMeshLayer as A,isGaussianSplatLayer as Ae}from"../layers/support/layerUtils.js";import{TilemapCache as je}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Me}from"../portal/portalDefault.js";import{WebSceneTag as Ne}from"../support/tagSymbols.js";import{BreakpointsOwner as Pe}from"./BreakpointsOwner.js";import{DOMContainer as Fe}from"./DOMContainer.js";import{PopupView as Ie}from"./PopupView.js";import j from"./View.js";import Le from"./ViewAnimation.js";import{stringFromViewingMode as M,viewingModeFromString as N}from"./ViewingMode.js";import{GroundView3D as Re}from"./3d/GroundView3D.js";import{layerView3DImporter as P}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as ze}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Be}from"./3d/camera/intersectionUtils.js";import F from"./3d/constraints/Constraints.js";import I from"./3d/environment/Environment.js";import{EnvironmentView as Ve}from"./3d/environment/EnvironmentView.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{Navigation3D as Ke}from"./3d/navigation/Navigation3D.js";import{ScreenSizePerspective as qe}from"./3d/state/ScreenSizePerspective.js";import L from"./3d/state/ViewState.js";import{ViewStateManager as Je,cleanupViewStateManager as Ye}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Xe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Ze}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Qe}from"./3d/state/utils/navigationUtils.js";import $e from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as et}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as R}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{popupHitTest as at}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as ot,getQualityProfileSettings as z}from"./3d/support/QualityProfile.js";import B 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{PointsOfInterest as V}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import H 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{Stage as vt}from"./3d/webgl-engine/Stage.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{defaultTolerance as U}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as W}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as St}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import G from"./interactive/options/ViewOptions.js";import Ct from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as wt}from"./support/drapedUtils.js";import{occludeesSupported as Tt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as K,createScreenPointFromSupportedEvent as Et}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Dt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Ot,destroyTextureCompressionWorker as kt}from"./support/TextureCompressionHelper.js";import At from"./ui/DefaultUI.js";import jt from"./ui/3d/DefaultUI3D.js";import Mt from"../webscene/Environment.js";import{clearVNodeCache as Nt}from"../widgets/support/vnodeCache.js";var q;const Pt=Symbol(),J=Symbol();function Ft(e){let t=x(G,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let Y=class extends Pe(Ie(Fe(j))){static{q=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new G({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 F,this._environment=new I,this.environmentView=new Ve,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Ct({importAnalysisViewModule:e=>ze(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ie,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new L({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 jt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ve();let t=()=>this._updatingChanged();this.addHandles(s(ee(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([f(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),p(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new He({view:this}),this.stateManager=new Je({view:this}),this.screenSizePerspective=new qe({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=Ot(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new Re({view:this}),this.groundAndIMSurface=new nt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>ae(e>0?1e3/Math.ceil(e):0),m),this.addHandles([p(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),p(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(kt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,u(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this._set(`labeler`,u(this.labeler)),this._set(`deconflictor`,u(this.deconflictor)),this._resourceController=u(this._resourceController),this._set(`stateManager`,u(this.stateManager)),this._set(`inputManager`,u(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,u(this.environmentView)),this._set(`environment`,u(this.environment)),this.groundView=u(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=b(C,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||d(e,`clippingArea`);return!(this._userClippingArea||d(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof S?this.spatialReference&&(t=X(t,this.spatialReference),t==null)?(l.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):(l.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?l.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===1)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:X(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||T.WGS84,n=X(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||T.WGS84,t,n=n=>{let r=X(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 I?e:e instanceof Mt?this.environment?.cloneWithWebsceneEnvironment(e)??I.fromWebsceneEnvironment(e):b(I,e):new I}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 q._layerToLayerview}static{this._layerToLayerview=j._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&&Ne 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=z(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new B(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?me(()=>Ee(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=ue(this.spatialReference);if(t&&e.heightUnit!==t)return new ye({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&&l.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 R.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 R.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedViewingMode;if(e!=null)return M(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?M(this.defaultsFromMap.viewingMode):Dt(t,1)?`global`:`local`:`global`}set viewingMode(e){this.ready?l.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 l.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=K(e)?Et(this,e):e;return rt(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.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),E(t,Z,this.renderSpatialReference),this.state.camera.projectToScreen(Z,Q),se(Q[0],Q[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;E(e,Z,n);let r=this.state.camera.computeScreenPixelSizeAt(Z);return t&&n!==t?r*de(n)/de(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=K(e)?Et(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 a(`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 a(`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()),o=await this._completeSettings(e);return o.format=`png`,[i,t(r[1],o,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new a(`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 P.importLayerView(e)}hasLayerViewModule(e){return P.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:N(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 Dt(e,n)?t==null||D(t)?!0:!(O(t)&&pt(t,e,n)==null||k(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?T.WGS84:T.WebMercator:new T({...i?De:Oe,vcsWkid:o,latestVcsWkid:s});return D(t)&&(i||a)?!(a&&r!==2)||mt(t.tileInfo,t.fullExtent,e,1)===null?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:[{spatialReference:c(),viewingMode:n}]:!O(t)&&!k(t)&&(i||a)?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:O(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&&l.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${M(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.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),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return l.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&&Tt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{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),c(()=>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&&(te(this),ne(n.signal),await t(n.signal)),this.destroyed)throw re();return ne(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 H({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 V({view:this})),this.addHandles([this.updatingHandles.add(()=>R.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&R.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=u(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?w(Ce(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=u(this._featureTiles)},h)],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(J),this.removeHandles(Pt),this._featureTiles=u(this.featureTiles),this._set(`pointsOfInterest`,u(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Te(t,e);n!==this.renderSpatialReference&&(this.renderCoordsHelper.viewingMode=this.state.viewingMode,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(p(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&Se(e,this.groundView.spatialReference,$,t)&&(this.renderCoordsHelper.extent=$)},h),J),this.sceneIntersectionHelper?.setTolerance(U/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(J)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(p(()=>[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 Ze(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,n);let r=i(this.surface);this._stage=new vt({view:this,options:t,container:r}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),o(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new a(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(U/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=u(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=u(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(){N(this.viewingMode)===1&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(f(()=>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?pe(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(W);for(let t of this.allLayerViews)(A(t.layer)&&(!has(`enable-feature:im-as-ground`)||t.layer.isUsedAsGroundLayer)||Ae(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(W);for(let t of this.allLayerViews)(has(`enable-feature:im-as-ground`)?A(t.layer)&&t.layer.isUsedAsGroundLayer:A(t.layer))&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Nt(),he(),le(),St(),Ye(),Be(),xe(),wt(),Me(),gt(),xt(),Xe(),Qe(),_e(),oe(),bt(),ht(),Ge.cleanupI3SLodHandling(),je.cleanupTilemapCache(),L.cleanupViewstate(),H.cleanupTerrainSurface()}};e([v({nonNullable:!0}),y(Ft)],Y.prototype,`options`,void 0),e([v()],Y.prototype,`_userClippingArea`,void 0),e([v()],Y.prototype,`_resourceController`,void 0),e([v()],Y.prototype,`stage`,null),e([v({readOnly:!0})],Y.prototype,`deconflictor`,void 0),e([v({readOnly:!0})],Y.prototype,`labeler`,void 0),e([v()],Y.prototype,`navigation`,void 0),e([v({type:Le,readOnly:!0})],Y.prototype,`animation`,null),e([v({readOnly:!0})],Y.prototype,`basemapTerrain`,void 0),e([v({readOnly:!0})],Y.prototype,`overlayManager`,null),e([v({readOnly:!0})],Y.prototype,`elevationProvider`,void 0),e([v()],Y.prototype,`camera`,null),e([v({type:t})],Y.prototype,`contentCamera`,null),e([v({readOnly:!0})],Y.prototype,`canvas`,null),e([v({type:C,useTypeForAutocast:!1})],Y.prototype,`center`,null),e([v({type:S})],Y.prototype,`clippingArea`,null),e([v({type:F,nonNullable:!0})],Y.prototype,`constraints`,void 0),e([v({type:S,readOnly:!0})],Y.prototype,`renderDataExtent`,null),e([v({readOnly:!0})],Y.prototype,`tileInfo`,null),e([v({type:S,readOnly:!0})],Y.prototype,`dataExtent`,null),e([v({type:S,readOnly:!0})],Y.prototype,`_groundAndLayersExtent`,null),e([v({type:I})],Y.prototype,`environment`,null),e([y(`environment`)],Y.prototype,`castEnvironment`,null),e([v({readOnly:!0})],Y.prototype,`environmentView`,void 0),e([v({type:S})],Y.prototype,`extent`,null),e([v({type:r})],Y.prototype,`floors`,void 0),e([v()],Y.prototype,`screenCenter`,null),e([v()],Y.prototype,`frustum`,null),e([v({type:Number,readOnly:!0})],Y.prototype,`fullOpacity`,void 0),e([v({readOnly:!0})],Y.prototype,`graphicsView`,void 0),e([v()],Y.prototype,`analysisViewManager`,void 0),e([v()],Y.prototype,`groundView`,void 0),e([v({readOnly:!0})],Y.prototype,`layerviewCollections`,null),e([v({type:Boolean})],Y.prototype,`initialExtentRequired`,null),e([v()],Y.prototype,`defaultsFromMapSettings`,null),e([v()],Y.prototype,`interacting`,null),e([v()],Y.prototype,`stationary`,null),e([v()],Y.prototype,`navigating`,null),e([v()],Y.prototype,`map`,void 0),e([v()],Y.prototype,`padding`,null),e([v({type:V,readOnly:!0})],Y.prototype,`pointsOfInterest`,void 0),e([v()],Y.prototype,`_featureTiles`,void 0),e([v()],Y.prototype,`featureTiles`,null),e([v()],Y.prototype,`_featureTreeDebugger`,void 0),e([v({constructOnly:!0})],Y.prototype,`deactivatedWebGLExtensions`,void 0),e([v({constructOnly:!0})],Y.prototype,`debugWebGLExtensions`,void 0),e([v({constructOnly:!0})],Y.prototype,`renderCanvas`,void 0),e([v({constructOnly:!0})],Y.prototype,`state`,void 0),e([v()],Y.prototype,`screenSizePerspective`,void 0),e([v({readOnly:!0})],Y.prototype,`inputManager`,void 0),e([v({readOnly:!0})],Y.prototype,`stateManager`,void 0),e([v({type:[`low`,`medium`,`high`]})],Y.prototype,`qualityProfile`,null),e([v({type:B,get(){let e=this._get(`qualitySettings`);if(!e){let t=z(this.qualityProfile);e=new B(t)}return e}})],Y.prototype,`qualitySettings`,void 0),e([v()],Y.prototype,`slice`,void 0),e([v({readOnly:!0})],Y.prototype,`typeSpecificPreconditionsReady`,null),e([v({readOnly:!0})],Y.prototype,`sceneIntersectionHelper`,void 0),e([v({type:Number,readOnly:!0})],Y.prototype,`resolution`,null),e([v({type:Number})],Y.prototype,`scale`,null),e([v({readOnly:!0,type:Number})],Y.prototype,`terrainLevel`,null),e([v()],Y.prototype,`heightModelInfo`,null),e([v({type:T})],Y.prototype,`spatialReference`,void 0),e([v({type:Boolean,value:!1})],Y.prototype,`alphaCompositingEnabled`,null),e([v({constructOnly:!0})],Y.prototype,`preserveDrawingBufferEnabled`,void 0),e([v({type:Boolean})],Y.prototype,`supersampleScreenshotsEnabled`,void 0),e([v({readOnly:!0})],Y.prototype,`type`,void 0),e([v(),y(e=>e instanceof At?e:x(jt,e))],Y.prototype,`ui`,void 0),e([v({type:Boolean,readOnly:!0})],Y.prototype,`updating`,null),e([v()],Y.prototype,`_updatingObjects`,null),e([v()],Y.prototype,`_updatingObjectsWithProgress`,null),e([v()],Y.prototype,`_updatingObjectsToDebug`,null),e([v({type:Number,readOnly:!0})],Y.prototype,`updatingProgress`,void 0),e([v({type:[`global`,`local`]})],Y.prototype,`viewingMode`,null),e([v({type:n})],Y.prototype,`viewpoint`,null),e([v({readOnly:!0})],Y.prototype,`visibleArea`,null),e([v({type:Number})],Y.prototype,`zoom`,null),e([v({readOnly:!0})],Y.prototype,`quality`,null),e([v({readOnly:!0})],Y.prototype,`resolutionScale`,null),e([v()],Y.prototype,`focusAreasView`,void 0),e([v()],Y.prototype,`_defaultToMapOptions`,null),e([v()],Y.prototype,`_defaultHitTestOptions`,null),Y=q=e([fe(`esri.views.SceneView`)],Y);function X(e,t){return e!=null&&be(e.spatialReference,t)?w(e,t):null}const Z=ge(),Q=ce(),$=we(),It=ke(0,0,0,T.WebMercator),Lt={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Rt=Y;export{Rt as default};
|
package/views/VideoView.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"../Color.js";import n from"../Viewpoint.js";import r from"../core/Accessor.js";import i from"../core/Error.js";import{EventedMixin as a}from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import{EsriPromiseMixin as s}from"../core/Promise.js";import{watch as c,syncAndInitial as l,whenOnce as u,when as d}from"../core/reactiveUtils.js";import{property as f,cast as p,subclass as m}from"../core/accessorSupport/decorators.js";import{ensureClass as h}from"../core/accessorSupport/ensureType.js";import{create as g,fromValues as _}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import v from"../geometry/Extent.js";import y from"../geometry/Point.js";import b from"../geometry/SpatialReference.js";import{projectLoad as x,projectExecute as S}from"../geometry/operators/projectOperator.js";import C from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as w}from"../layers/support/MediaElementView.js";import T from"../layers/support/TileInfo.js";import E from"../layers/support/VideoElement.js";import{DOMContainer as D}from"./DOMContainer.js";import{Viewport2DBaseMixin as O}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as k}from"./Viewport2DMixin.js";import A from"./2d/AnimationManager.js";import j from"./2d/MapViewConstraints.js";import"./2d/engine/Stage.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"../core/RandomLCG.js";import"../core/has.js";import"../core/Logger.js";import"./2d/engine/transitions/FadeTransition.js";import"./webgl/BufferObject.js";import"./webgl/FramebufferObject.js";import"./webgl/Program.js";import"./webgl/Renderbuffer.js";import"./webgl/Texture.js";import"../core/memoryEstimations.js";import"./webgl/enums.js";import"./webgl/Util.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import{Container as M}from"./2d/engine/Container.js";import"./2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"../geometry/Polygon.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"./webgl/UniformBufferLayout.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtils.js";import"./2d/layers/support/util.js";import N from"./2d/navigation/MapViewNavigation.js";import"../request.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"../core/mathUtils.js";import"../core/urlUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/units.js";import"../geometry/ellipsoidUtils.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polyline.js";import"../geometry/spatialReferenceEllipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"../geometry/support/spatialReferenceUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as P}from"./2d/ViewStateManager.js";import F from"./2d/engine/webgl/Overlay.js";import I from"./2d/engine/webgl/OverlayContainer.js";import{createScreenshotRegion as L}from"./2d/support/screenshotUtils.js";import R from"./navigation/Navigation.js";import{getMaximumResolutionScale as z,encode as B,getFormatAndQuality as V}from"./support/screenshotUtils.js";import H from"./ui/DefaultUI.js";import U from"./ui/video/DefaultUIVideo.js";const W=new t(`#000`);let G;async function K(){let[,{ParentStage:e}]=await Promise.all([import(`./2d/webglDeps.js`),import(`./2d/mapViewDeps.js`)]);G=e}const q=.01,J=[`feature`,`geojson`,`csv`,`stream`,`ogc-feature`,`catalog`,`wfs`,`parquet`,`graphics`,`group`];let Y=class extends k(O(D(a(s(r))))){constructor(e){super(e),this._isValid=!1,this._readyCycleForced=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.map=null,this.navigation=new R,this.ready=!1,this.spatialReference=new b({wkid:0}),this.stateManager=new P({constraints:new j({view:this,minScale:1,maxScale:q})}),this.type=`2d`,this.ui=new U,this.view2dType=`video`,this.addHandles([c(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),c(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),c(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),c(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},l)])}initialize(){this._prevZoomEnabled=this.navigation.actionMap.mouseWheel===`zoom`&&this.ui.components.includes(`zoom`),this._prevRotationEnabled=this.navigation.actionMap.dragSecondary===`rotate`&&this.ui.components.includes(`compass`),this.addHandles([c(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?`none`:`zoom`,this.navigation.actionMap.dragPrimary=this.operationalDataVisible?`none`:`pan`,this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>e!==`zoom`):[...new Set([...this.ui.components,`zoom`])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?`none`:`rotate`,this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>e!==`compass`):[...new Set([...this.ui.components,`compass`])])))},l)]),this.addResolvingPromise(K().then(()=>(this._isValid=!0,u(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set(`preconditionsReady`,!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set(`inputManager`,null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get focusRegion(){return super.focusRegion}get layer(){return this._get(`layer`)}set layer(e){e!==this._get(`layer`)&&(this.constructed&&!this.destroyed&&(this._forceReadyCycle(),this.addResolvingPromise(u(()=>this.ready))),this._set(`layer`,e))}get preconditionsReady(){return!(!this._isValid||this._readyCycleForced||this.width===0||this.height===0||this.videoSize[0]===0||this.videoSize[1]===0)}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];let[e,t]=this.size,n=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),r=e/t,i=t*n,a=e/n;return r>=1?n>=1?i<=e?[i,t]:[e,a]:a<=t?[e,a]:[i,t]:n>=1?a<=t?[e,a]:[i,t]:i<=e?[i,t]:[e,a]}async hitTest(e,t){if(!this._operationalDataView||!this._operationalDataView.ready)return{screenPoint:e,results:[]};let n=this._operationalDataView.videoToMap(e);if(!n)return{screenPoint:e,results:[]};let r=this._operationalDataView.state.toScreen(g(),n);return this._operationalDataView.hitTest({x:r[0],y:r[1]},t)}async takeScreenshot(e){let t=this.stage,[n,r]=this.size;if(!this.ready||!t||n<=0||r<=0)throw new i(`videoview:not-ready`,`The VideoView must be ready before taking a screenshot.`);let a=L(e||{},Math.min(4,z(this.size,Math.min(4096,t.context.parameters.maxTextureSize))),this.size,this.padding),o=await t.takeScreenshot(a,void 0,e?.ignoreBackground?null:W,e?.rotation);return B(o,V(e?.format,e?.quality),{flipY:!0,premultipliedAlpha:!0})}_startup(){if(!this.layer)return;let e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);let t={renderingOptions:this.renderingOptions,backgroundColor:W,groundControlPoints:()=>this._groundControlPoints(),getSize:()=>this.videoSize},n=new G(this._getOrCreateRenderCanvas(),t);this.stage=n,this._prepareStage(this.stage),this.childStage=n.childStage,this._prepareChildStage(this.childStage);let r=new A({view:this});this._set(`animationManager`,r);let i=new N({view:this,animationManager:r});this._set(`mapViewNavigation`,i),this._updateConstraints(),this.frameTask.start(),this._set(`ready`,!0)}_teardown(){this.frameTask?.stop(),this.stationaryManager?.clear(),this.stage?.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer?.removeAllChildren(),this._overlayContainer=null,this.removeHandles(`video-view`),this._set(`ready`,!1),this.stateManager?.ready&&this.stateManager.teardown()}_getViewpoint(){return new n({targetGeometry:new y({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([c(()=>this.stationary,t=>e.stationary=t,l),c(()=>this.state.id,()=>e.state=this.state,l),c(()=>this.renderingOptions,t=>e.renderingOptions=t,l)],`video-view`),this._extent=new v({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new w({element:new E({video:this.layer?.videoElement,georeference:new C({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});let t=new F(this._videoElementView);this._overlayContainer=new I,this._overlayContainer.addChild(t),this._effectsContainer=new M,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);let n=document.createElement(`div`);n.classList.add(`esri-video-poster`),this.container?.classList.add(`esri-video-view`),this.container?.appendChild(n)}_prepareChildStage(e){this.addHandles([c(()=>this.map,async t=>{if(!t)return;let{default:n}=await import(`./video/VideoOperationalDataView.js`);this._operationalDataView=new n({stage:e,layerViewFilter:e=>new Set(J).has(e.type),width:this.size[0],height:this.size[1],map:t,groundControlPoints:()=>this._groundControlPoints(),getVideoResolution:()=>_(this.layer?.videoWidth||0,this.layer?.videoHeight||0),getSize:()=>this.size}),u(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},l),c(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;let t=this.layer.groundControlPoints,n=t?.length;if(!n)return;await x();let r=Array(n),i=e.state.spatialReference;for(let e=0;e<n;e++){let{lat:n,lon:a}=t[e];r[e]=S(new y(a,n),i)}let a=1/0,o=1/0,s=-1/0,c=-1/0;for(let e of r)a=Math.min(a,e.x),o=Math.min(o,e.y),s=Math.max(s,e.x),c=Math.max(c,e.y);let l=v.fromJSON({xmin:a,ymin:o,xmax:s,ymax:c,spatialReference:i});await this._operationalDataView?.goTo(l,{animate:!1}).catch(()=>{})},l)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){let e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),n=[];for(let e=t;e>q;e/=2)n.push(e);n.push(q);let{lods:r}=T.create({scales:n});this.constraints.set({lods:r,minScale:t})}_updatePanConstraints(){let e=e=>{if(!e.targetGeometry)return e;let[t,n]=this.videoSize,r=t*e.scale/2,i=n*e.scale/2,a=e.targetGeometry.clone();return a.x=Math.max(r,Math.min(t-r,a.x)),a.y=Math.max(i,Math.min(n-i,a.y)),e.targetGeometry=a,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}_forceReadyCycle(){this.ready&&(d(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}_groundControlPoints(){return this.layer?.groundControlPoints}};e([f()],Y.prototype,`_overlayContainer`,void 0),e([f()],Y.prototype,`_isValid`,void 0),e([f()],Y.prototype,`_readyCycleForced`,void 0),e([f()],Y.prototype,`_effectsContainer`,void 0),e([f()],Y.prototype,`constraintsInfo`,null),e([f()],Y.prototype,`operationalDataVisible`,void 0),e([f()],Y.prototype,`layer`,null),e([f()],Y.prototype,`map`,void 0),e([f({type:R,nonNullable:!0})],Y.prototype,`navigation`,void 0),e([f({readOnly:!0})],Y.prototype,`preconditionsReady`,null),e([f({readOnly:!0})],Y.prototype,`ready`,void 0),e([f({readOnly:!0})],Y.prototype,`rendering`,null),e([f()],Y.prototype,`scale`,null),e([f()],Y.prototype,`spatialReference`,void 0),e([f()],Y.prototype,`stateManager`,void 0),e([f()],Y.prototype,`type`,void 0),e([f(),p(e=>e instanceof H?e:h(U,e))],Y.prototype,`ui`,void 0),e([f({readOnly:!0})],Y.prototype,`videoSize`,null),e([f({readOnly:!0})],Y.prototype,`view2dType`,void 0),Y=e([m(`esri.views.VideoView`)],Y);const X=Y;export{X as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import n from"../Viewpoint.js";import r from"../core/Accessor.js";import i from"../core/Error.js";import{EventedMixin as a}from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import{EsriPromiseMixin as s}from"../core/Promise.js";import{watch as c,syncAndInitial as l,whenOnce as u,when as d}from"../core/reactiveUtils.js";import{property as f,cast as p,subclass as m}from"../core/accessorSupport/decorators.js";import{ensureClass as h}from"../core/accessorSupport/ensureType.js";import{create as g,fromValues as _}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import v from"../geometry/Extent.js";import y from"../geometry/Point.js";import b from"../geometry/SpatialReference.js";import{projectLoad as x,projectExecute as S}from"../geometry/operators/projectOperator.js";import C from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as w}from"../layers/support/MediaElementView.js";import T from"../layers/support/TileInfo.js";import E from"../layers/support/VideoElement.js";import{DOMContainer as D}from"./DOMContainer.js";import{Viewport2DBaseMixin as O}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as k}from"./Viewport2DMixin.js";import A from"./2d/AnimationManager.js";import j from"./2d/MapViewConstraints.js";import"./2d/engine/Stage.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"../core/RandomLCG.js";import"../core/has.js";import"../core/Logger.js";import"./2d/engine/transitions/FadeTransition.js";import"./webgl/BufferObject.js";import"./webgl/FramebufferObject.js";import"./webgl/Program.js";import"./webgl/Renderbuffer.js";import"./webgl/Texture.js";import"../core/memoryEstimations.js";import"./webgl/enums.js";import"./webgl/Util.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import{Container as M}from"./2d/engine/Container.js";import"./2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"../geometry/Polygon.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"./webgl/UniformBufferLayout.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtils.js";import"./2d/layers/support/util.js";import N from"./2d/navigation/MapViewNavigation.js";import"../request.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"../core/mathUtils.js";import"../core/urlUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/units.js";import"../geometry/ellipsoidUtils.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polyline.js";import"../geometry/spatialReferenceEllipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"../geometry/support/spatialReferenceUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as P}from"./2d/ViewStateManager.js";import F from"./2d/engine/webgl/Overlay.js";import I from"./2d/engine/webgl/OverlayContainer.js";import{createScreenshotRegion as L}from"./2d/support/screenshotUtils.js";import R from"./navigation/Navigation.js";import{getMaximumResolutionScale as z,encode as B,getFormatAndQuality as V}from"./support/screenshotUtils.js";import H from"./ui/DefaultUI.js";import U from"./ui/video/DefaultUIVideo.js";const W=new t(`#000`);let G;async function K(){let[,{ParentStage:e}]=await Promise.all([import(`./2d/webglDeps.js`),import(`./2d/mapViewDeps.js`)]);G=e}const q=.01,J=[`feature`,`geojson`,`csv`,`stream`,`ogc-feature`,`catalog`,`wfs`,`parquet`,`graphics`,`group`];let Y=class extends k(O(D(a(s(r))))){constructor(e){super(e),this._isValid=!1,this._readyCycleForced=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.map=null,this.navigation=new R,this.ready=!1,this.spatialReference=new b({wkid:0}),this.stateManager=new P({constraints:new j({view:this,minScale:1,maxScale:q})}),this.type=`2d`,this.ui=new U,this.view2dType=`video`,this.addHandles([c(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),c(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),c(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),c(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},l)])}initialize(){this._prevZoomEnabled=this.navigation.actionMap.mouseWheel===`zoom`&&this.ui.components.includes(`zoom`),this._prevRotationEnabled=this.navigation.actionMap.dragSecondary===`rotate`&&this.ui.components.includes(`compass`),this.addHandles([c(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?`none`:`zoom`,this.navigation.actionMap.dragPrimary=this.operationalDataVisible?`none`:`pan`,this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>e!==`zoom`):[...new Set([...this.ui.components,`zoom`])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?`none`:`rotate`,this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>e!==`compass`):[...new Set([...this.ui.components,`compass`])])))},l)]),this.addResolvingPromise(K().then(()=>(this._isValid=!0,u(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set(`preconditionsReady`,!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set(`inputManager`,null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get focusRegion(){return super.focusRegion}get layer(){return this._get(`layer`)}set layer(e){e!==this._get(`layer`)&&(this.constructed&&!this.destroyed&&(this._forceReadyCycle(),this.addResolvingPromise(u(()=>this.ready))),this._set(`layer`,e))}get preconditionsReady(){return!(!this._isValid||this._readyCycleForced||this.width===0||this.height===0||this.videoSize[0]===0||this.videoSize[1]===0)}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];let[e,t]=this.size,n=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),r=e/t,i=t*n,a=e/n;return r>=1?n>=1?i<=e?[i,t]:[e,a]:a<=t?[e,a]:[i,t]:n>=1?a<=t?[e,a]:[i,t]:i<=e?[i,t]:[e,a]}async hitTest(e,t){if(!this._operationalDataView||!this._operationalDataView.ready)return{screenPoint:e,results:[]};let n=this._operationalDataView.videoToMap(e);if(!n)return{screenPoint:e,results:[]};let r=this._operationalDataView.state.toScreen(g(),n);return this._operationalDataView.hitTest({x:r[0],y:r[1]},t)}async takeScreenshot(e){let t=this.stage,[n,r]=this.size;if(!this.ready||!t||n<=0||r<=0)throw new i(`videoview:not-ready`,`The VideoView must be ready before taking a screenshot.`);let a=L(e||{},Math.min(4,z(this.size,Math.min(4096,t.context.parameters.maxTextureSize))),this.size,this.padding),o=await t.takeScreenshot(a,void 0,e?.ignoreBackground?null:W,e?.rotation);return B(o,V(e?.format,e?.quality),{flipY:!0,premultipliedAlpha:!0})}_startup(){if(!this.layer)return;let e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);let t={renderingOptions:this.renderingOptions,backgroundColor:W,groundControlPoints:()=>this._groundControlPoints(),getSize:()=>this.videoSize},n=new G(this._getOrCreateRenderCanvas(),t);this.stage=n,this._prepareStage(this.stage),this.childStage=n.childStage,this._prepareChildStage(this.childStage);let r=new A({view:this});this._set(`animationManager`,r);let i=new N({view:this,animationManager:r});this._set(`mapViewNavigation`,i),this._updateConstraints(),this.frameTask.start(),this._set(`ready`,!0)}_teardown(){this.frameTask?.stop(),this.stationaryManager?.clear(),this.stage?.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer?.removeAllChildren(),this._overlayContainer=null,this.removeHandles(`video-view`),this._set(`ready`,!1),this.stateManager?.ready&&this.stateManager.teardown()}_getViewpoint(){return new n({targetGeometry:new y({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([c(()=>this.stationary,t=>e.stationary=t,l),c(()=>this.state.id,()=>e.state=this.state,l),c(()=>this.renderingOptions,t=>e.renderingOptions=t,l)],`video-view`),this._extent=new v({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new w({element:new E({video:this.layer?.videoElement,georeference:new C({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});let t=new F(this._videoElementView);this._overlayContainer=new I,this._overlayContainer.addChild(t),this._effectsContainer=new M,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);let n=document.createElement(`div`);n.classList.add(`esri-video-poster`),this.container?.classList.add(`esri-video-view`),this.container?.appendChild(n)}_prepareChildStage(e){this.addHandles([c(()=>this.map,async t=>{if(!t)return;let{default:n}=await import(`./video/VideoOperationalDataView.js`);this._operationalDataView=new n({stage:e,layerViewFilter:e=>new Set(J).has(e.type),width:this.size[0],height:this.size[1],map:t,groundControlPoints:()=>this._groundControlPoints(),getVideoResolution:()=>_(this.layer?.videoWidth||0,this.layer?.videoHeight||0),getSize:()=>this.size}),u(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},l),c(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;let t=this.layer.groundControlPoints,n=t?.length;if(!n)return;await x();let r=Array(n),i=e.state.spatialReference;for(let e=0;e<n;e++){let{lat:n,lon:a}=t[e];r[e]=S(new y({x:a,y:n}),i)}let a=1/0,o=1/0,s=-1/0,c=-1/0;for(let e of r)a=Math.min(a,e.x),o=Math.min(o,e.y),s=Math.max(s,e.x),c=Math.max(c,e.y);let l=v.fromJSON({xmin:a,ymin:o,xmax:s,ymax:c,spatialReference:i});await this._operationalDataView?.goTo(l,{animate:!1}).catch(()=>{})},l)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){let e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),n=[];for(let e=t;e>q;e/=2)n.push(e);n.push(q);let{lods:r}=T.create({scales:n});this.constraints.set({lods:r,minScale:t})}_updatePanConstraints(){let e=e=>{if(!e.targetGeometry)return e;let[t,n]=this.videoSize,r=t*e.scale/2,i=n*e.scale/2,a=e.targetGeometry.clone();return a.x=Math.max(r,Math.min(t-r,a.x)),a.y=Math.max(i,Math.min(n-i,a.y)),e.targetGeometry=a,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}_forceReadyCycle(){this.ready&&(d(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}_groundControlPoints(){return this.layer?.groundControlPoints}};e([f()],Y.prototype,`_overlayContainer`,void 0),e([f()],Y.prototype,`_isValid`,void 0),e([f()],Y.prototype,`_readyCycleForced`,void 0),e([f()],Y.prototype,`_effectsContainer`,void 0),e([f()],Y.prototype,`constraintsInfo`,null),e([f()],Y.prototype,`operationalDataVisible`,void 0),e([f()],Y.prototype,`layer`,null),e([f()],Y.prototype,`map`,void 0),e([f({type:R,nonNullable:!0})],Y.prototype,`navigation`,void 0),e([f({readOnly:!0})],Y.prototype,`preconditionsReady`,null),e([f({readOnly:!0})],Y.prototype,`ready`,void 0),e([f({readOnly:!0})],Y.prototype,`rendering`,null),e([f()],Y.prototype,`scale`,null),e([f()],Y.prototype,`spatialReference`,void 0),e([f()],Y.prototype,`stateManager`,void 0),e([f()],Y.prototype,`type`,void 0),e([f(),p(e=>e instanceof H?e:h(U,e))],Y.prototype,`ui`,void 0),e([f({readOnly:!0})],Y.prototype,`videoSize`,null),e([f({readOnly:!0})],Y.prototype,`view2dType`,void 0),Y=e([m(`esri.views.VideoView`)],Y);const X=Y;export{X as default};
|
package/views/View.d.ts
CHANGED
|
@@ -169,7 +169,6 @@ export interface ViewProperties<TLayerView extends LayerView = LayerView> extend
|
|
|
169
169
|
* >
|
|
170
170
|
* > These options are not saved in a [WebMap](https://developers.arcgis.com/javascript/latest/references/core/WebMap/) or [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/).
|
|
171
171
|
*
|
|
172
|
-
* @beta
|
|
173
172
|
* @since 5.2
|
|
174
173
|
*/
|
|
175
174
|
options?: ViewOptionsProperties;
|
|
@@ -616,7 +615,6 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
|
|
|
616
615
|
* >
|
|
617
616
|
* > These options are not saved in a [WebMap](https://developers.arcgis.com/javascript/latest/references/core/WebMap/) or [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/).
|
|
618
617
|
*
|
|
619
|
-
* @beta
|
|
620
618
|
* @since 5.2
|
|
621
619
|
*/
|
|
622
620
|
get options(): ViewOptions;
|
|
@@ -857,7 +855,7 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
|
|
|
857
855
|
* @see [Sample - StreamLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-streamlayer/)
|
|
858
856
|
* @example
|
|
859
857
|
* // Create a feature layer from a url pointing to a Feature Service
|
|
860
|
-
* let layer = new FeatureLayer(url);
|
|
858
|
+
* let layer = new FeatureLayer({ url });
|
|
861
859
|
*
|
|
862
860
|
* map.add(layer);
|
|
863
861
|
*
|
package/views/View2D.d.ts
CHANGED
|
@@ -1098,7 +1098,7 @@ export default abstract class View2D extends View2DSuperclass {
|
|
|
1098
1098
|
* [LayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/) for the specified layer.
|
|
1099
1099
|
* @example
|
|
1100
1100
|
* // Create a feature layer from a url pointing to a Feature Service
|
|
1101
|
-
* let layer = new FeatureLayer(url);
|
|
1101
|
+
* let layer = new FeatureLayer({ url });
|
|
1102
1102
|
*
|
|
1103
1103
|
* map.add(layer);
|
|
1104
1104
|
*
|
|
@@ -1112,7 +1112,7 @@ export default abstract class View2D extends View2DSuperclass {
|
|
|
1112
1112
|
* @see [Sample - StreamLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-streamlayer/)
|
|
1113
1113
|
* @example
|
|
1114
1114
|
* // Create a feature layer from a url pointing to a Feature Service
|
|
1115
|
-
* let layer = new FeatureLayer(url);
|
|
1115
|
+
* let layer = new FeatureLayer({ url });
|
|
1116
1116
|
*
|
|
1117
1117
|
* map.add(layer);
|
|
1118
1118
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import*as t from"@amcharts/amcharts5/index.js";import{XYChart as n,ValueAxis as r,AxisRendererX as i,AxisRendererY as a,XYCursor as o,LineSeries as s}from"@amcharts/amcharts5/xy.js";import c from"@amcharts/amcharts5/themes/Dark.js";import l from"@amcharts/amcharts5/themes/Responsive.js";import{fetchMessageBundle as u,substitute as d,formatNumber as f}from"../../../intl.js";import p from"../../../core/Accessor.js";import{createTask as m}from"../../../core/asyncUtils.js";import{makeHandle as h,handlesGroup as g}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as _}from"../../../core/promiseUtils.js";import{watch as v,initial as y}from"../../../core/reactiveUtils.js";import{throttle as b}from"../../../core/throttle.js";import{formatDecimal as x,unitName as S}from"../../../core/unitFormatUtils.js";import{property as C,subclass as w}from"../../../core/accessorSupport/decorators.js";import{getEpsilon as T}from"../../../core/libs/gl-matrix-2/math/common.js";import{isDarkMode as E}from"../../../support/modeUtils.js";import{getConfig as D,notAvailable as O}from"./constants.js";import{getAdjustedBounds as k}from"./elevationProfileChartBoundsUtils.js";import{themeLight as A,themeDark as j}from"./elevationProfileChartTheme.js";import{binaryFindClosest as M}from"./elevationProfileGenerationUtils.js";import{createRoot as N}from"../../../widgets/support/chartUtilsAm5.js";let P=class extends p{get chartVisible(){let e=this._chartData;if(e==null)return!1;let t=0;for(let{samples:n}of e.lines)t+=n?.length??0;return e.refined||t<=D().largeChartSamples}get spinnerVisible(){return this._chartData!=null&&(this.analysisView?.progress??0)<1}get _updateParameters(){let{messages:e,_unitsMessages:t}=this;if(e&&t)return{data:this._chartData,messages:e,unitsMessages:t}}get _chartData(){let{analysisView:e,uniformScaling:t}=this;if(!this._hasGeometry||!e)return;let{effectiveDisplayUnits:n,progress:r,results:i,statistics:a}=e;return{lines:this._lineData,statistics:a,effectiveUnits:n,refined:r===1,uniformScaling:t,dynamicElevationRange:i.some(({profile:e})=>e.type===`scene`)}}get _hasGeometry(){return this.analysisView?.analysis.geometry!=null}get _lineData(){let{analysisView:e}=this;if(!e)return[];let t=[];for(let n of e.results){let e=n.profile;if(!n.available||!n.rawResult?.hasZ||!e.chartOptions.lineVisible)continue;let r=e.type!==`input`;t.push({id:e.id,type:e.type,title:e.title,color:e.color,samples:n.samples,fillEnabled:r,strokeOffsetY:r?-1:0,strokeWidth:1.5})}return t}constructor(e){super(e),this.view=null,this.analysisView=null,this.messages=null,this.uniformScaling=!1,this.hideGridLines=!1,this.hideAxisLabels=!1,this._theme=A,this._data=null,this._seriesInfos=new Map,this._pointerIsOver=!1,this._rtl=!1,this._chartInfo=null,this._unitsMessages=null,this._throttledUpdate=b(e=>{this._update(e)},D().updateThrottleMillis),this._onCursorMove=()=>{let e=this._chartInfo;if(!e||!this._pointerIsOver)return;let{chart:t,xAxis:n,yAxis:r}=e;this._updateTooltips();let i=t.get(`cursor`),a=i?.getPrivate(`positionX`)??0,o=i?.getPrivate(`positionY`)??0,s=this._data;if(s?.statistics!=null){let{maxDistance:e,minElevation:t,maxElevation:i}=s.statistics,c,l;e!=null&&(R(n)===1?(c=0,l=e):(c=V(n),l=H(n)),a=z(a,c,l,0,e)),t!=null&&i!=null&&(R(r)===1?(c=t,l=i):(c=V(r),l=H(r)),o=z(o,c,l,t,i))}this.onCursorPositionChange?.(a,o)}}initialize(){this.addHandles(m(e=>this._initializeChart(e)))}destroy(){this._chartInfo=null,this._seriesInfos.clear(),this._data=null}zoomOut(){this._chartInfo?.xAxis.zoom(0,1),this._chartInfo?.yAxis.zoom(0,1)}async _initializeChart(e){let[t,r]=await Promise.all([N(this.container),u(`esri/core/t9n/Units`)]);_(e);let i=W(this.container),a=E(this.container),o=a?j:A;t.setThemes(a?[l.new(t),c.new(t)]:[l.new(t)]),this._rtl=i,this._theme=o,this._unitsMessages=r;let s=t.container.children.push(n.new(t,{panX:!0,panY:!0,paddingTop:o.paddingTop,paddingBottom:o.paddingBottom,paddingLeft:i?o.paddingRight:o.paddingLeft,paddingRight:i?o.paddingLeft:o.paddingRight,maxTooltipDistance:-1}));s.zoomOutButton.set(`forceHidden`,!0);let d=s.xAxes.push(this._createXAxis(t)),f=s.yAxes.push(this._createYAxis(t));this._chartInfo={chart:s,xAxis:d,yAxis:f},this._updateAxisVisibility(),this._initializeTest(s),this.addHandles([this._setupZoomHandling(),this._setupCursorHandling(),K(t),v(()=>this._updateParameters,e=>this._throttledUpdate(e),y),v(()=>[this.hideAxisLabels,this.hideGridLines],()=>this._updateAxisVisibility(),y),this._throttledUpdate])}_initializeTest(e){}_update(e){if(!e||this.destroyed)return;let t=this._data,n=e.data;if(n===t&&e.messages===this.messages&&e.unitsMessages===this._unitsMessages)return;let r=t!==n,i=t?.effectiveUnits!==n?.effectiveUnits,a=t?.uniformScaling!==n?.uniformScaling;this._data=n,(r||i)&&(this._updateAxes(),this._updateSeries()),a&&this.zoomOut(),this._updateTooltips()}_createXAxis(e){let n=this._theme,a=r.new(e,{renderer:i.new(e,{})});a.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(e,`distance`),strictMinMax:!0,strictMinMaxSelection:!0}),a.axisHeader.set(`forceHidden`,!0);let o=a.get(`renderer`);o.setAll({inside:!1,minGridDistance:n.xAxisMinGridDistance}),o.labels.template.setAll({centerX:t.p0,centerY:t.p0,fill:t.color(n.axisLabelsColor),fontFamily:n.fontFamily,fontSize:n.axisLabelsFontSize,fontWeight:n.axisLabelsFontWeight,forceHidden:this.hideAxisLabels,maxPosition:n.xAxisMaxLabelPosition,minPosition:n.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:n.xAxisLabelsSpacing,visible:!this.hideAxisLabels});let s=a.set(`tooltip`,t.Tooltip.new(e,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));return s.get(`background`)?.setAll({fill:t.color(n.axisTooltipBackgroundColor),stroke:void 0}),s.label.setAll({fill:t.color(n.axisTooltipLabelColor),fontFamily:n.fontFamily,fontSize:n.axisTooltipFontSize,paddingBottom:n.axisTooltipPaddingBottom,paddingLeft:n.axisTooltipPaddingHorizontal,paddingRight:n.axisTooltipPaddingHorizontal,paddingTop:n.axisTooltipPaddingTop,direction:this._rtl?`rtl`:`ltr`}),o.grid.template.setAll({forceHidden:this.hideGridLines,stroke:t.color(n.axisGridStroke),strokeOpacity:1,visible:!this.hideGridLines}),a}_createYAxis(e){let n=this._theme,i=this._rtl,o=r.new(e,{renderer:a.new(e,{})});o.setAll({baseValue:D().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(e,`elevation`),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),o.axisHeader.set(`visible`,!1);let s=o.get(`renderer`);return s.setAll({minGridDistance:n.yAxisMinGridDistance,opposite:i,inside:!0}),s.labels.template.setAll({centerX:t.p0,centerY:t.p100,fill:t.color(n.axisLabelsColor),fontFamily:n.fontFamily,fontSize:n.axisLabelsFontSize,fontWeight:n.axisLabelsFontWeight,forceHidden:this.hideAxisLabels,maxPosition:n.yAxisMaxLabelPosition,minPosition:n.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:i?0:n.yAxisLabelSpacing,paddingRight:i?n.yAxisLabelSpacing:0,paddingTop:0,textAlign:`start`,visible:!this.hideAxisLabels}),s.grid.template.setAll({forceHidden:this.hideGridLines,stroke:t.color(n.axisGridStroke),strokeOpacity:1,visible:!this.hideGridLines}),o}_updateAxisVisibility(){let e=this._chartInfo;if(!e)return;let t=!this.hideAxisLabels,n=!this.hideGridLines,r=e.xAxis.get(`renderer`);r.labels.template.set(`visible`,t),r.labels.template.set(`forceHidden`,!t),r.grid.template.set(`visible`,n),r.grid.template.set(`forceHidden`,!n);let i=e.yAxis.get(`renderer`);i.labels.template.set(`visible`,t),i.labels.template.set(`forceHidden`,!t),i.grid.template.set(`visible`,n),i.grid.template.set(`forceHidden`,!n)}_setupZoomHandling(){let e=this._chartInfo;if(!e)return h();let{xAxis:t,yAxis:n}=e,r=()=>{this.onRangeChange?.(R(t),R(n))},i=e=>[e.on(`start`,r),e.on(`end`,r)];return G([...i(t),...i(n)])}_setupCursorHandling(){let e=this._chartInfo?.chart;if(!e)return h();let t=e.plotContainer.events,n=e=>{this._pointerIsOver=e,this._updateTooltips()},r=()=>{n(!1),this.onCursorPositionChange?.(null,null)};return G([t.on(`pointerover`,()=>n(!0)),t.on(`pointerout`,r),t.on(`blur`,r)])}_updateAxes(){let e=this._chartInfo;if(!e)return;let{chart:t,xAxis:n,yAxis:r}=e,i=this._data,{minX:a,maxX:o,minY:s,maxY:c}=k({data:i,pixelWidth:n.width(),pixelHeight:r.height()}),l=!!i?.uniformScaling,u=!!i?.refined;t.setAll({panX:!0,panY:l,pinchZoomX:u,pinchZoomY:u&&l,wheelX:`panX`,wheelY:u?l?`zoomXY`:`zoomX`:`none`}),n.setAll({max:o,min:a,panX:!0,panY:!1,zoomX:!0,zoomY:l}),r.setAll({max:c,min:s,panX:!1,panY:l,zoomX:l,zoomY:l})}_updateSeries(){let e=this._seriesInfos,t=this._chartInfo;if(!t)return;let{chart:n,xAxis:r,yAxis:i}=t,a=this._data;if(!a||a.lines.length===0){this._seriesInfos.clear(),n.series.clear();return}let o=new Map,s=new Set(n.series.values),c=a.lines.length;for(let r=0;r<c;r++){let i=a.lines[r],l=e.get(i.id);l?(l.fill&&s.delete(l.fill),s.delete(l.line)):(l=F(t,i),l.fill&&n.series.push(l.fill),n.series.push(l.line)),o.set(l.id,l);let u=c-r-1;l.fill?.set(`layer`,u),l.line.set(`layer`,c+u),this._updateLineSeries(l,i)}this._seriesInfos=o;for(let e of s)n.series.removeValue(e);r.set(`layer`,c+1),i.set(`layer`,c+2)}_updateLineSeries(e,n){let r=t.color(n.color.toCss()),i=n.samples??[],a=i.length>0,{line:o,fill:s}=e;o.set(`visible`,a),o.set(`stroke`,r),s?.set(`visible`,a),s?.set(`fill`,t.Color.lighten(r,this._theme.seriesFillLighten)),o.data.setAll(i),s?.data.setAll(i)}_updateTooltips(){let e=this._chartInfo;if(!e)return;let{chart:t,xAxis:n,yAxis:r}=e,i=t.get(`cursor`);if(!this._data?.refined){i?.events.removeType(`cursormoved`),i?.dispose(),t.set(`cursor`,void 0);return}if(!i){let e=o.new(t.root,{behavior:`none`,xAxis:n,yAxis:r,snapToSeriesBy:`y`});e.lineY.set(`visible`,!1),e.events.on(`cursormoved`,this._onCursorMove),t.set(`cursor`,e)}let a=this._getSeriesTooltipText();a?this._seriesInfos.forEach(t=>{let n=t.line.get(`tooltip`)??L(e,this._theme,this._rtl);n.label.set(`text`,a),t.line.set(`tooltip`,n)}):this._seriesInfos.forEach(e=>{e.line.get(`tooltip`)?.dispose(),e.line.set(`tooltip`,void 0)}),this._chartInfo?.xAxis.getTooltip()?.setAll({tooltipText:this._getAxisTooltipText()})}_getSeriesTooltipText(){let e=this._data?.lines.map(e=>({line:e,y:this._getPointNearestToCursor(e)?.elevation})).sort(B);return!e||e.length===0||e[0].y==null?null:e.map(({y:e,line:t})=>this._getTooltipTextForLine(t,e)).join(`
|
|
2
|
+
import{__decorate as e}from"tslib";import*as t from"@amcharts/amcharts5/index.js";import{XYChart as n,ValueAxis as r,AxisRendererX as i,AxisRendererY as a,XYCursor as o,LineSeries as s}from"@amcharts/amcharts5/xy.js";import c from"@amcharts/amcharts5/themes/Dark.js";import l from"@amcharts/amcharts5/themes/Responsive.js";import{fetchMessageBundle as u,substitute as d,formatNumber as f}from"../../../intl.js";import p from"../../../core/Accessor.js";import{createTask as m}from"../../../core/asyncUtils.js";import{makeHandle as h,handlesGroup as g}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as _}from"../../../core/promiseUtils.js";import{watch as v,initial as y}from"../../../core/reactiveUtils.js";import{throttle as b}from"../../../core/throttle.js";import{formatDecimal as x,unitName as S}from"../../../core/unitFormatUtils.js";import{property as C,subclass as w}from"../../../core/accessorSupport/decorators.js";import{getEpsilon as T}from"../../../core/libs/gl-matrix-2/math/common.js";import{isDarkMode as E}from"../../../support/modeUtils.js";import{getConfig as D,notAvailable as O}from"./constants.js";import{getAdjustedBounds as k}from"./elevationProfileChartBoundsUtils.js";import{themeLight as A,themeDark as j}from"./elevationProfileChartTheme.js";import{binaryFindClosest as M}from"./elevationProfileGenerationUtils.js";import{createRoot as N}from"../../../widgets/support/chartUtilsAm5.js";let P=class extends p{get chartVisible(){let e=this._chartData;if(e==null)return!1;let t=0;for(let{samples:n}of e.lines)t+=n?.length??0;return e.refined||t<=D().largeChartSamples}get spinnerVisible(){return this._chartData!=null&&(this.analysisView?.progress??0)<1}get _updateParameters(){let{messages:e,_unitsMessages:t}=this;if(e&&t)return{data:this._chartData,messages:e,unitsMessages:t}}get _chartData(){let{analysisView:e,uniformScaling:t}=this;if(!this._hasGeometry||!e)return;let{effectiveDisplayUnits:n,progress:r,results:i,statistics:a}=e;return{lines:this._lineData,statistics:a,effectiveUnits:n,refined:r===1,uniformScaling:t,dynamicElevationRange:i.some(({profile:e})=>e.type===`scene`)}}get _hasGeometry(){return this.analysisView?.analysis.geometry!=null}get _lineData(){let{analysisView:e}=this;if(!e)return[];let t=[];for(let n of e.results){let e=n.profile;if(!n.available||!n.rawResult?.hasZ||!e.chartOptions.lineVisible)continue;let r=e.type!==`input`;t.push({id:e.id,type:e.type,title:e.title,color:e.color,samples:n.samples,fillEnabled:r,strokeOffsetY:r?-1:0,strokeWidth:1.5})}return t}constructor(e){super(e),this.view=null,this.analysisView=null,this.messages=null,this.uniformScaling=!1,this.hideGridLines=!1,this.hideAxisLabels=!1,this._theme=A,this._data=null,this._seriesInfos=new Map,this._pointerIsOver=!1,this._rtl=!1,this._chartInfo=null,this._unitsMessages=null,this._throttledUpdate=b(e=>{this._update(e)},D().updateThrottleMillis),this._onCursorMove=()=>{let e=this._chartInfo;if(!e||!this._pointerIsOver)return;let{chart:t,xAxis:n,yAxis:r}=e;this._updateTooltips();let i=t.get(`cursor`),a=i?.getPrivate(`positionX`)??0,o=i?.getPrivate(`positionY`)??0,s=this._data;if(s?.statistics!=null){let{maxDistance:e,minElevation:t,maxElevation:i}=s.statistics,c,l;e!=null&&(R(n)===1?(c=0,l=e):(c=V(n),l=H(n)),a=z(a,c,l,0,e)),t!=null&&i!=null&&(R(r)===1?(c=t,l=i):(c=V(r),l=H(r)),o=z(o,c,l,t,i))}this.onCursorPositionChange?.(a,o)}}initialize(){this.addHandles(m(e=>this._initializeChart(e)))}destroy(){this._chartInfo=null,this._seriesInfos.clear(),this._data=null}zoomOut(){this._chartInfo?.xAxis.zoom(0,1),this._chartInfo?.yAxis.zoom(0,1)}async _initializeChart(e){let[t,r]=await Promise.all([N(this.container),u(`esri/core/t9n/Units`)]);_(e);let i=W(this.container),a=E(this.container),o=a?j:A;t.setThemes(a?[l.new(t),c.new(t)]:[l.new(t)]),this._rtl=i,this._theme=o,this._unitsMessages=r;let s=t.container.children.push(n.new(t,{panX:!0,panY:!0,paddingTop:o.paddingTop,paddingBottom:o.paddingBottom,paddingLeft:i?o.paddingRight:o.paddingLeft,paddingRight:i?o.paddingLeft:o.paddingRight,maxTooltipDistance:-1}));s.zoomOutButton.set(`forceHidden`,!0);let d=s.xAxes.push(this._createXAxis(t)),f=s.yAxes.push(this._createYAxis(t));this._chartInfo={chart:s,xAxis:d,yAxis:f},this._updateAxisVisibility(),this._initializeTest(s),this.addHandles([this._setupZoomHandling(),this._setupCursorHandling(),K(t),v(()=>this._updateParameters,e=>this._throttledUpdate(e),y),v(()=>[this.hideAxisLabels,this.hideGridLines],()=>this._updateAxisVisibility(),y),this._throttledUpdate])}_initializeTest(e){}_update(e){if(!e||this.destroyed)return;let t=this._data,n=e.data;if(n===t&&e.messages===this.messages&&e.unitsMessages===this._unitsMessages)return;let r=t!==n,i=t?.effectiveUnits!==n?.effectiveUnits,a=t?.uniformScaling!==n?.uniformScaling;this._data=n,(r||i)&&(this._updateAxes(),this._updateSeries()),a&&this.zoomOut(),this._updateTooltips()}_createXAxis(e){let n=this._theme,a=r.new(e,{renderer:i.new(e,{})});a.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(e,`distance`),strictMinMax:!0,strictMinMaxSelection:!0}),a.axisHeader.set(`forceHidden`,!0);let o=a.get(`renderer`);o.setAll({inside:!1,minGridDistance:n.xAxisMinGridDistance}),o.labels.template.setAll({centerX:this._rtl?t.p100:t.p0,centerY:t.p0,fill:t.color(n.axisLabelsColor),fontFamily:n.fontFamily,fontSize:n.axisLabelsFontSize,fontWeight:n.axisLabelsFontWeight,forceHidden:this.hideAxisLabels,maxPosition:n.xAxisMaxLabelPosition,minPosition:n.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:n.xAxisLabelsSpacing,visible:!this.hideAxisLabels});let s=a.set(`tooltip`,t.Tooltip.new(e,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));return s.get(`background`)?.setAll({fill:t.color(n.axisTooltipBackgroundColor),stroke:void 0}),s.label.setAll({fill:t.color(n.axisTooltipLabelColor),fontFamily:n.fontFamily,fontSize:n.axisTooltipFontSize,paddingBottom:n.axisTooltipPaddingBottom,paddingLeft:n.axisTooltipPaddingHorizontal,paddingRight:n.axisTooltipPaddingHorizontal,paddingTop:n.axisTooltipPaddingTop,direction:this._rtl?`rtl`:`ltr`}),o.grid.template.setAll({forceHidden:this.hideGridLines,stroke:t.color(n.axisGridStroke),strokeOpacity:1,visible:!this.hideGridLines}),a}_createYAxis(e){let n=this._theme,i=this._rtl,o=r.new(e,{renderer:a.new(e,{})});o.setAll({baseValue:D().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(e,`elevation`),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),o.axisHeader.set(`visible`,!1);let s=o.get(`renderer`);return s.setAll({minGridDistance:n.yAxisMinGridDistance,opposite:i,inside:!0}),s.labels.template.setAll({centerX:i?t.p100:t.p0,centerY:t.p100,fill:t.color(n.axisLabelsColor),fontFamily:n.fontFamily,fontSize:n.axisLabelsFontSize,fontWeight:n.axisLabelsFontWeight,forceHidden:this.hideAxisLabels,maxPosition:n.yAxisMaxLabelPosition,minPosition:n.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:n.yAxisLabelSpacing,paddingRight:0,paddingTop:0,textAlign:`start`,visible:!this.hideAxisLabels}),s.grid.template.setAll({forceHidden:this.hideGridLines,stroke:t.color(n.axisGridStroke),strokeOpacity:1,visible:!this.hideGridLines}),o}_updateAxisVisibility(){let e=this._chartInfo;if(!e)return;let t=!this.hideAxisLabels,n=!this.hideGridLines,r=e.xAxis.get(`renderer`);r.labels.template.set(`visible`,t),r.labels.template.set(`forceHidden`,!t),r.grid.template.set(`visible`,n),r.grid.template.set(`forceHidden`,!n);let i=e.yAxis.get(`renderer`);i.labels.template.set(`visible`,t),i.labels.template.set(`forceHidden`,!t),i.grid.template.set(`visible`,n),i.grid.template.set(`forceHidden`,!n)}_setupZoomHandling(){let e=this._chartInfo;if(!e)return h();let{xAxis:t,yAxis:n}=e,r=()=>{this.onRangeChange?.(R(t),R(n))},i=e=>[e.on(`start`,r),e.on(`end`,r)];return G([...i(t),...i(n)])}_setupCursorHandling(){let e=this._chartInfo?.chart;if(!e)return h();let t=e.plotContainer.events,n=e=>{this._pointerIsOver=e,this._updateTooltips()},r=()=>{n(!1),this.onCursorPositionChange?.(null,null)};return G([t.on(`pointerover`,()=>n(!0)),t.on(`pointerout`,r),t.on(`blur`,r)])}_updateAxes(){let e=this._chartInfo;if(!e)return;let{chart:t,xAxis:n,yAxis:r}=e,i=this._data,{minX:a,maxX:o,minY:s,maxY:c}=k({data:i,pixelWidth:n.width(),pixelHeight:r.height()}),l=!!i?.uniformScaling,u=!!i?.refined;t.setAll({panX:!0,panY:l,pinchZoomX:u,pinchZoomY:u&&l,wheelX:`panX`,wheelY:u?l?`zoomXY`:`zoomX`:`none`}),n.setAll({max:o,min:a,panX:!0,panY:!1,zoomX:!0,zoomY:l}),r.setAll({max:c,min:s,panX:!1,panY:l,zoomX:l,zoomY:l})}_updateSeries(){let e=this._seriesInfos,t=this._chartInfo;if(!t)return;let{chart:n,xAxis:r,yAxis:i}=t,a=this._data;if(!a||a.lines.length===0){this._seriesInfos.clear(),n.series.clear();return}let o=new Map,s=new Set(n.series.values),c=a.lines.length;for(let r=0;r<c;r++){let i=a.lines[r],l=e.get(i.id);l?(l.fill&&s.delete(l.fill),s.delete(l.line)):(l=F(t,i),l.fill&&n.series.push(l.fill),n.series.push(l.line)),o.set(l.id,l);let u=c-r-1;l.fill?.set(`layer`,u),l.line.set(`layer`,c+u),this._updateLineSeries(l,i)}this._seriesInfos=o;for(let e of s)n.series.removeValue(e);r.set(`layer`,c+1),i.set(`layer`,c+2)}_updateLineSeries(e,n){let r=t.color(n.color.toCss()),i=n.samples??[],a=i.length>0,{line:o,fill:s}=e;o.set(`visible`,a),o.set(`stroke`,r),s?.set(`visible`,a),s?.set(`fill`,t.Color.lighten(r,this._theme.seriesFillLighten)),o.data.setAll(i),s?.data.setAll(i)}_updateTooltips(){let e=this._chartInfo;if(!e)return;let{chart:t,xAxis:n,yAxis:r}=e,i=t.get(`cursor`);if(!this._data?.refined){i?.events.removeType(`cursormoved`),i?.dispose(),t.set(`cursor`,void 0);return}if(!i){let e=o.new(t.root,{behavior:`none`,xAxis:n,yAxis:r,snapToSeriesBy:`y`});e.lineY.set(`visible`,!1),e.events.on(`cursormoved`,this._onCursorMove),t.set(`cursor`,e)}let a=this._getSeriesTooltipText();a?this._seriesInfos.forEach(t=>{let n=t.line.get(`tooltip`)??L(e,this._theme,this._rtl);n.label.set(`text`,a),t.line.set(`tooltip`,n)}):this._seriesInfos.forEach(e=>{e.line.get(`tooltip`)?.dispose(),e.line.set(`tooltip`,void 0)}),this._chartInfo?.xAxis.getTooltip()?.setAll({tooltipText:this._getAxisTooltipText()})}_getSeriesTooltipText(){let e=this._data?.lines.map(e=>({line:e,y:this._getPointNearestToCursor(e)?.elevation})).sort(B);return!e||e.length===0||e[0].y==null?null:e.map(({y:e,line:t})=>this._getTooltipTextForLine(t,e)).join(`
|
|
3
3
|
`)}_getPointNearestToCursor(e){let t=e.samples??[];if(t.length===0)return null;let n=this._chartInfo;if(!n)return null;let{chart:r,xAxis:i}=n,a=r.get(`cursor`)?.getPrivate(`positionX`)??0,o=i.toAxisPosition(a),s=i.positionToValue(o);return M(t,s,e=>e.distance)}_getTooltipTextForLine(e,t){let n=this._data,r=this.messages,i=this._unitsMessages;if(!n||!r||!i)return``;let a=`[${e.color.toHex()}]●[/]`,o=D().formatPrecision,s=d(r.chartTooltip,{name:U(e,r),elevation:t==null?O:x(i,t,n.effectiveUnits.elevation,o)});return this._rtl?s+` `+a:a+` `+s}_getAxisTooltipText(){let e=this._data,t=this._unitsMessages;if(!e||!t)return``;let n=e.lines[0],r=n?this._getPointNearestToCursor(n):null,i=D().formatPrecision;return r==null?`-`:x(t,r.distance,e.effectiveUnits.distance,i)}_makeFormatter(e,n){let r=t.NumberFormatter.new(e,{}),i=n===`distance`?new Intl.NumberFormat(void 0,{notation:`compact`,compactDisplay:`short`,maximumSignificantDigits:3}):null;return r.format=(e,t,r)=>{let a=this._data,o=this._unitsMessages;if(!a||!o||typeof e==`string`)return``;let s;return s=i&&Math.abs(e)>=1e6?i.format(e):f(e,{maximumFractionDigits:r}),`${s} ${S(o,a.effectiveUnits[n],`abbr`)}`},r}};e([C()],P.prototype,`view`,void 0),e([C()],P.prototype,`analysisView`,void 0),e([C()],P.prototype,`container`,void 0),e([C()],P.prototype,`messages`,void 0),e([C()],P.prototype,`onRangeChange`,void 0),e([C()],P.prototype,`onCursorPositionChange`,void 0),e([C()],P.prototype,`uniformScaling`,void 0),e([C()],P.prototype,`hideGridLines`,void 0),e([C()],P.prototype,`hideAxisLabels`,void 0),e([C()],P.prototype,`chartVisible`,null),e([C()],P.prototype,`spinnerVisible`,null),e([C()],P.prototype,`test`,void 0),e([C()],P.prototype,`_theme`,void 0),e([C()],P.prototype,`_data`,void 0),e([C()],P.prototype,`_seriesInfos`,void 0),e([C()],P.prototype,`_pointerIsOver`,void 0),e([C()],P.prototype,`_rtl`,void 0),e([C()],P.prototype,`_chartInfo`,void 0),e([C()],P.prototype,`_unitsMessages`,void 0),e([C()],P.prototype,`_updateParameters`,null),e([C()],P.prototype,`_chartData`,null),e([C()],P.prototype,`_hasGeometry`,null),e([C()],P.prototype,`_lineData`,null),P=e([w(`esri.views.analysis.ElevationProfile.ElevationProfileChart`)],P);function F(e,t){let{id:n}=t,r=I(e,`line-${n}`);r.setAll({dy:t.strokeOffsetY,tooltip:void 0}),r.strokes.template.setAll({strokeWidth:t.strokeWidth});let i=null;return t.fillEnabled&&(i=I(e,`fill-${n}`),i.fills.template.setAll({fillOpacity:1,visible:!0})),{id:n,line:r,fill:i}}function I({chart:e,xAxis:t,yAxis:n},r){return s.new(e.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:r,stroke:void 0,valueXField:`distance`,valueYField:`elevation`,xAxis:t,yAxis:n})}function L({chart:e},n,r){let i=t.Tooltip.new(e.root,{autoTextColor:!1,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:`vertical`,visible:!1}),a=n.seriesTooltipPaddingHorizontal,o=n.seriesTooltipPaddingVertical;return i.label.setAll({fill:t.color(n.seriesTooltipLabelColor),fontFamily:n.fontFamily,fontSize:n.seriesTooltipFontSize,paddingBottom:o,paddingLeft:a,paddingRight:a,paddingTop:o,textAlign:r?`end`:`start`,direction:`ltr`}),i.get(`background`)?.setAll({stroke:void 0,fill:t.color(n.seriesTooltipBackgroundColor)}),i.adapters.add(`dy`,e=>{let t=n.seriesTooltipSpacing,r=i.get(`pointTo`)?.y??0;return(e??0)+(i.y()>r?t:-t)}),i}function R(e){let t=Math.abs((e.get(`end`)??0)-(e.get(`start`)??0)),n=t===0?1:1/t;return Math.abs(1-n)<T()?1:n}function z(e,t,n,r,i){return(t+e*(n-t)-r)/(i-r)}function B({y:e},{y:t}){return e==null?1:t==null?-1:t-e}function V(e){return e.positionToValue(e.get(`start`)??0)}function H(e){return e.positionToValue(e.get(`end`)??1)}function U(e,t){let n=e.title;if(n!=null)return n;switch(e.type){case`ground`:return t.profiles.ground;case`input`:return t.profiles.input;case`query`:return t.profiles.query;case`scene`:return t.profiles.scene;default:return``}}function W(e){let t=e?.closest(`[dir]`);return t!==null&&t instanceof HTMLElement&&t.dir===`rtl`||document.dir===`rtl`}function G(e){return g(e.map(K))}function K(e){return h(()=>e?.dispose())}export{P as ElevationProfileChart};
|
|
@@ -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"../../../Graphic.js";import{EventedAccessor as n}from"../../../core/Evented.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{debounce as i}from"../../../core/promiseUtils.js";import{zeroMeters as a}from"../../../core/quantity.js";import{when as o,watch as s,syncAndInitial as c,initial as l}from"../../../core/reactiveUtils.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../core/support/UpdatingHandles.js";import p from"../../../geometry/Point.js";import m from"../../../geometry/Polygon.js";import h from"../../../geometry/Polyline.js";import{create as g,center as _}from"../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as v}from"../../../geometry/support/boundsUtils.js";import y from"../../../geometry/support/rotate.js";import b from"../../../symbols/SimpleFillSymbol.js";import x from"../../../symbols/SimpleLineSymbol.js";import S from"../../../symbols/SimpleMarkerSymbol.js";import{cloneMove as C,scale as w,getRotationAngle as T,getScaleRatio as E}from"./drawUtils.js";import D from"./GraphicMover.js";import O from"./HighlightHelper.js";import{addUniqueLayer as k}from"./layerUtils.js";import{settings as A}from"./settings.js";import j from"../../interactive/options/InteractiveToolOptions.js";import{makeTooltip as M}from"../../interactive/tooltip/tooltipCommonUtils.js";import{ExtentRotateTooltipInfo as N}from"../../interactive/tooltip/infos/ExtentRotateTooltipInfo.js";import{ExtentScaleTooltipInfo as P}from"../../interactive/tooltip/infos/ExtentScaleTooltipInfo.js";import{TranslateTooltipInfo as F}from"../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{GeometryWorkerHandle as I}from"../../support/GeometryWorkerHandle.js";const L=A.transformGraphics,R={centerIndicator:new S({style:`cross`,size:L.center.size,color:L.center.color}),fill:{default:new b({color:L.fill.color,outline:{color:L.fill.outlineColor,join:`round`,width:1}}),active:new b({color:L.fill.stagedColor,outline:{color:L.fill.outlineColor,join:`round`,style:`dash`,width:1}})},handles:{default:new S({style:`square`,size:L.vertex.size,color:L.vertex.color,outline:{color:L.vertex.outlineColor,width:1}}),hover:new S({style:`square`,size:L.vertex.hoverSize,color:L.vertex.hoverColor,outline:{color:L.vertex.hoverOutlineColor,width:1}})},rotator:{default:new S({style:`circle`,size:L.vertex.size,color:L.vertex.color,outline:{color:L.vertex.outlineColor,width:1}}),hover:new S({style:`circle`,size:L.vertex.hoverSize,color:L.vertex.hoverColor,outline:{color:L.vertex.hoverOutlineColor,width:1}})},rotatorLine:new x({color:L.line.color,width:1})},z=Symbol();let B=class extends n{constructor(e){super(e),this._activeHandleGraphic=null,this._graphicAttributes={esriSketchTool:`box`},this._mover=null,this._centerGraphic=null,this._backgroundGraphic=null,this._vertexGraphics=[],this._rotateHandleGraphic=null,this._rotateGraphicOffset=20,this._angleOfRotation=0,this._rotateLineGraphic=null,this._startInfo=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this.tooltip=null,this.type=`box`,this.callbacks={onMoveStart(){},onMove(){},onMoveStop(){},onScaleStart(){},onScale(){},onScaleStop(){},onRotateStart(){},onRotate(){},onRotateStop(){},onGraphicClick(){}},this.enableMovement=!0,this.enableRotation=!0,this.enableScaling=!0,this.graphics=[],this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.preserveAspectRatio=!1,this.showCenterGraphic=!0,this.symbols=R,this.toolOptions=new j,this.view=null,this._updatingHandles=new f,this._getBounds=(()=>{let e=g();return(t,n)=>{t[0]=1/0,t[1]=1/0,t[2]=-1/0,t[3]=-1/0;for(let r of n){if(!r)continue;let n,i,a,o;if(r.type===`point`)n=a=r.x,i=o=r.y;else if(r.type===`extent`)[n,i,a,o]=[r.xmin,r.ymin,r.xmax,r.ymax];else{let t=v(e,r);[n,i,a,o]=t}t[0]=Math.min(n,t[0]),t[1]=Math.min(i,t[1]),t[2]=Math.max(a,t[2]),t[3]=Math.max(o,t[3])}return t}})(),this._extentScaleTooltipInfo=new P({toolOptions:this.toolOptions}),this._measurementWorker=new I({preloadGeodetic:!0}),this._updateScaleTooltipAsync=i(async()=>{let e=this._getCoordinates(),t=this.view.spatialReference,{width:n,height:r}=await this._measurementWorker.autoSize2D(new p({x:e[0][0],y:e[0][1],spatialReference:t}),new p({x:e[1][0],y:e[1][1],spatialReference:t}),new p({x:e[2][0],y:e[2][1],spatialReference:t}),new p({x:e[3][0],y:e[3][1],spatialReference:t}));this._extentScaleTooltipInfo.xSize=n,this._extentScaleTooltipInfo.ySize=r}),this._translateTooltipInfo=new F({toolOptions:this.toolOptions}),this._updateMoveTooltipAsync=i(async e=>{let{view:t}=this,n=this._translateTooltipInfo;if(!e){n.distance=a;return}let{x:r,y:i}=e.origin,o=t.toMap(e),s=t.toMap({x:r,y:i});n.distance=await this._measurementWorker.autoDistance2DBetweenPoints(s,o)??a})}initialize(){let e=this.view;this._highlightHelper=new O({view:e}),this._setup(),this.addHandles([o(()=>e?.ready,()=>{let{layer:e,view:t}=this;k(t,e)},{once:!0,initial:!0}),s(()=>this.preserveAspectRatio,()=>{this._activeHandleGraphic&&(this._scaleGraphic(this._activeHandleGraphic),this._updateGraphics(),this._updateTooltip(this._activeHandleGraphic))}),s(()=>e?.scale,()=>{this._updateRotateGraphic(),this._updateRotateLineGraphic()}),s(()=>this.graphics,()=>this.refresh()),s(()=>this.layer,(e,t)=>{t&&this._resetGraphics(t),this.refresh()}),s(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),s(()=>this.toolOptions.tooltips.effectiveEnabled,t=>{this.tooltip=t?M(()=>({view:e,options:this.toolOptions.tooltips})):r(this.tooltip)},c),s(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),l),this.on(`move-start`,e=>this.callbacks?.onMoveStart?.(e)),this.on(`move`,e=>this.callbacks?.onMove?.(e)),this.on(`move-stop`,e=>this.callbacks?.onMoveStop?.(e)),this.on(`rotate-start`,e=>this.callbacks?.onRotateStart?.(e)),this.on(`rotate`,e=>this.callbacks?.onRotate?.(e)),this.on(`rotate-stop`,e=>this.callbacks?.onRotateStop?.(e)),this.on(`scale-start`,e=>this.callbacks?.onScaleStart?.(e)),this.on(`scale`,e=>this.callbacks?.onScale?.(e)),this.on(`scale-stop`,e=>this.callbacks?.onScaleStop?.(e))])}destroy(){this._reset(),this.tooltip=r(this.tooltip)}get state(){let e=this.view?.ready??!1,t=this.graphics.length&&this.layer;return e&&t?`active`:e?`ready`:`disabled`}get updating(){return this._updatingHandles.updating}isUIGraphic(e){return this._vertexGraphics.includes(e)||e===this._backgroundGraphic||e===this._centerGraphic||e===this._rotateHandleGraphic||e===this._rotateLineGraphic}move(e,t){if(this._mover&&this.graphics.length){for(let n of this.graphics){let r=n.geometry;n.geometry=C(r,e,t,this.view)}this.refresh(),this.emit(`move-stop`,{graphics:this.graphics,mover:null,dx:e,dy:t,type:`move-stop`})}}scale(e,t){if(!this._mover||!this.graphics.length)return;let n=this._getBoxBounds(g()),r=_(n);for(let n of this.graphics){let i=n.geometry;n.geometry=w(i,e,t,r)}this.refresh(),this.emit(`scale-stop`,{graphics:this.graphics,mover:null,xScale:e,yScale:t,type:`scale-stop`})}rotate(e,t){if(this._mover&&this.graphics.length){if(!t){let e=this._vertexGraphics[1].geometry.x,n=this._vertexGraphics[3].geometry.y;t=new p(e,n,this.view.spatialReference)}for(let n of this.graphics){let r=n.geometry;n.geometry=y(r,e,t)}this.refresh(),this.emit(`rotate-stop`,{graphics:this.graphics,mover:null,angle:e,type:`rotate-stop`})}}refresh(){this._reset(),this._setup()}reset(){this.graphics=[]}_setup(){this.state===`active`&&(this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._updateGraphics())}_reset(){this._highlightHelper?.removeAll(),this._resetGraphicStateVars(),this._resetGraphics(),this._updateTooltip(),this._mover?.destroy(),this._mover=null,this.removeHandles(z)}_resetGraphicStateVars(){this._startInfo=null,this._activeHandleGraphic=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this._angleOfRotation=0}_resetGraphics(e){e||=this.layer,e&&(e.removeMany(this._vertexGraphics),e.remove(this._backgroundGraphic),e.remove(this._centerGraphic),e.remove(this._rotateHandleGraphic),e.remove(this._rotateLineGraphic)),this._vertexGraphics.forEach(e=>!e.destroyed&&e.destroy()),!this._backgroundGraphic.destroyed&&this._backgroundGraphic.destroy(),!this._centerGraphic.destroyed&&this._centerGraphic.destroy(),!this._rotateHandleGraphic.destroyed&&this._rotateHandleGraphic.destroy(),!this._rotateLineGraphic.destroyed&&this._rotateLineGraphic.destroy(),this._vertexGraphics=[],this._backgroundGraphic=null,this._centerGraphic=null,this._rotateHandleGraphic=null,this._rotateLineGraphic=null}_setupMover(){let e=[];this.enableScaling&&(e=e.concat(this._vertexGraphics)),this.enableRotation&&e.push(this._rotateHandleGraphic),this.enableMovement&&(e=e.concat(this.graphics,this._backgroundGraphic)),this.showCenterGraphic&&e.push(this._centerGraphic),this._mover=new D({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,view:this.view,graphics:e,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_setCursor(e){this.addHandles(this.view.acquireCursor(e,`high`),z)}_getStartInfo(e){let[t,n,r,i]=this._getBoxBounds(g()),a=Math.abs(r-t),o=Math.abs(i-n),s=(r+t)/2,c=(i+n)/2,{x:l,y:u}=e.geometry;return{width:a,height:o,centerX:s,centerY:c,startX:l,startY:u,graphicInfos:this._getGraphicInfos(),box:this._backgroundGraphic.geometry,rotate:this._rotateHandleGraphic.geometry}}_getGraphicInfos(){return this.graphics.map(e=>this._getGraphicInfo(e))}_getGraphicInfo(e){let t=e.geometry,[n,r,i,a]=this._getBounds(g(),[t]);return{width:Math.abs(i-n),height:Math.abs(a-r),centerX:(i+n)/2,centerY:(a+r)/2,geometry:t}}_onGraphicClickCallback(e){e.viewEvent.stopPropagation(),this.emit(`graphic-click`,e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e)}_onGraphicMoveStartCallback(e){let{_angleOfRotation:t,_xScale:n,_yScale:r,_backgroundGraphic:i,_vertexGraphics:a,_rotateHandleGraphic:o,symbols:s,graphics:c}=this,{graphic:l,dx:u,dy:d,viewEvent:f}=e;this._resetGraphicStateVars(),this._hideGraphicsBeforeUpdate(),i.symbol=s.fill.active,this._startInfo=this._getStartInfo(l),this._updateTooltip(l,f),l===o?(this._setCursor(`grabbing`),this.emit(`rotate-start`,{type:`rotate-start`,mover:l,graphics:c,angle:t})):a.includes(l)?(this._activeHandleGraphic=l,this.emit(`scale-start`,{type:`scale-start`,mover:l,graphics:c,xScale:n,yScale:r})):this.emit(`move-start`,{type:`move-start`,graphics:c,mover:l,dx:u,dy:d})}_onGraphicMoveCallback(e){let t=e.graphic;if(!this._startInfo)return;let{_xScale:n,_yScale:r,_angleOfRotation:i,graphics:a}=this;if(this._vertexGraphics.includes(t))this._scaleGraphic(t),this._updateTooltip(t,e.viewEvent),this.emit(`scale`,{type:`scale`,graphics:a,mover:t,xScale:n,yScale:r});else if(t===this._rotateHandleGraphic)this._rotateGraphic(t),this._updateTooltip(t,e.viewEvent),this.emit(`rotate`,{type:`rotate`,graphics:a,mover:t,angle:i});else{let{dx:n,dy:r}=e;this._totalDx+=n,this._totalDy+=r,this._moveGraphic(t,n,r),this._updateTooltip(t,e.viewEvent),this.emit(`move`,{type:`move`,graphics:a,mover:t,dx:n,dy:r})}}_onGraphicMoveStopCallback(e){let t=e.graphic;if(!this._startInfo){this.refresh();return}let{_angleOfRotation:n,_totalDx:r,_totalDy:i,_xScale:a,_yScale:o,_vertexGraphics:s,_rotateHandleGraphic:c,graphics:l}=this;this.refresh(),t===c?(this._setCursor(`pointer`),this.emit(`rotate-stop`,{type:`rotate-stop`,graphics:l,mover:t,angle:n})):s.includes(t)?this.emit(`scale-stop`,{type:`scale-stop`,mover:t,graphics:l,xScale:a,yScale:o}):this.emit(`move-stop`,{type:`move-stop`,graphics:l,mover:t,dx:r,dy:i})}_onGraphicPointerOverCallback(e){let{_backgroundGraphic:t,_vertexGraphics:n,graphics:r,_rotateHandleGraphic:i,symbols:a,view:o}=this,s=e.graphic;if(this._hoveredGraphic=s,s===i){i.symbol=a.rotator.hover,this._setCursor(`pointer`),this._updateTooltip(s);return}if(r.includes(s)||s===t){this._setCursor(`move`);return}if(!n.includes(s)){this._setCursor(`pointer`);return}this._updateTooltip(s),e.graphic.symbol=a.handles.hover;let c=o.rotation,l=e.index,u;switch(l<8&&(c>=0&&c<45?l%=8:l=c>=45&&c<90?(l+1)%8:c>=90&&c<135?(l+2)%8:c>=135&&c<180?(l+3)%8:c>=180&&c<225?(l+4)%8:c>=225&&c<270?(l+5)%8:c>=270&&c<315?(l+6)%8:(l+7)%8),l){case 0:u=`nwse-resize`;break;case 1:u=`ns-resize`;break;case 2:u=`nesw-resize`;break;case 3:u=`ew-resize`;break;case 4:u=`nwse-resize`;break;case 5:u=`ns-resize`;break;case 6:u=`nesw-resize`;break;case 7:u=`ew-resize`;break;default:u=`pointer`}this._setCursor(u)}_onGraphicPointerOutCallback(e){let{_vertexGraphics:t,_rotateHandleGraphic:n,symbols:r}=this;this._hoveredGraphic=null,e.graphic===n?n.symbol=r.rotator.default:t.includes(e.graphic)&&(e.graphic.symbol=r.handles.default),this.removeHandles(z),this._updateTooltip()}_scaleGraphic(e){let{_startInfo:t,_vertexGraphics:n,preserveAspectRatio:r,view:i}=this,{centerX:a,centerY:o,graphicInfos:s,height:c,startX:l,startY:u,width:d}=t,{resolution:f,transform:m}=i.state,h=n.indexOf(e);(h===1||h===5)&&this._updateX(e,a),(h===3||h===7)&&this._updateY(e,o);let{x:g,y:_}=e.geometry,v=m[0]*g+m[2]*_+m[4],y=m[1]*g+m[3]*_+m[5],b=s?.map(e=>e.geometry)??[],x=b.every(e=>e.type===`point`);if((d===0||c===0)&&x){let e=V((g-l)/f),n=V((u-_)/f);for(let t=0;t<b.length;t++)this.graphics[t].geometry=C(b[t],e,n,i,!0);this._centerGraphic.geometry=new p(g,_,i.spatialReference),this._backgroundGraphic.geometry=C(t.box,e,n,i,!0)}else if(r){let e=V(m[0]*a+m[2]*o+m[4],2),t=V(m[1]*a+m[3]*o+m[5],2),n=V(m[0]*l+m[2]*u+m[4],2),r=V(m[1]*l+m[3]*u+m[5],2),i=E(e,t,n,r,v,y);(i===0||Math.abs(i)===1/0)&&(i=1),this._xScale=this._yScale=i;for(let e of b){let t=b.indexOf(e);this.graphics[t].geometry=w(e,this._xScale,this._yScale,[a,o])}this._updateBackgroundGraphic()}else{let e=l>a,n=u<o,r=g-l,s=u-_;if(h===1||h===5?r=0:(h===3||h===7)&&(s=0),r===0&&s===0)return;let m=e?r:r*-1,v=n?s:s*-1,y=d+m,x=c+v,S=a+r/2,T=o+s/2,E=y/d,D=x/c;(h===1||h===5||E===0||Math.abs(E)===1/0)&&(E=1),(h===3||h===7||D===0||Math.abs(D)===1/0)&&(D=1),this._xScale=E,this._yScale=D;let O=(S-a)/f,k=(T-o)/f,A=w(t.box,this._xScale,this._yScale);this._backgroundGraphic.geometry=C(A,O,k,i,!0);let{centerX:j,centerY:M}=this._getGraphicInfo(this._backgroundGraphic),N=(j-a)/f,P=-1*(M-o)/f;for(let e of b){let t=b.indexOf(e),n=w(e,this._xScale,this._yScale,[a,o]);this.graphics[t].geometry=C(n,N,P,i,!0)}this._centerGraphic.geometry=new p(j,M,i.spatialReference)}}_rotateGraphic(e){let{centerX:t,centerY:n,startX:r,startY:i,box:a,rotate:o}=this._startInfo,s=this.view.spatialReference,c=new p(r,i,s),l=new p(t,n,s),u=e.geometry;this._angleOfRotation=T(c,u,l);let d=this._startInfo.graphicInfos?.map(e=>e.geometry)??[];for(let e of d){let t=d.indexOf(e),n=y(e,this._angleOfRotation,l);this.graphics[t].geometry=n}this._backgroundGraphic.geometry=y(a,this._angleOfRotation,l),this._rotateHandleGraphic.geometry=y(o,this._angleOfRotation,l)}_moveGraphic(e,t,n){if(this.graphics.includes(e)){let r=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=C(r,t,n,this.view);for(let r of this.graphics)r!==e&&(r.geometry=C(r.geometry,t,n,this.view))}else if(e===this._centerGraphic){let e=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=C(e,t,n,this.view)}if(e===this._backgroundGraphic||e===this._centerGraphic)for(let e of this.graphics)e.geometry=C(e.geometry,t,n,this.view)}_setUpHighlights(){this.highlightsEnabled&&this.graphics.length&&this._highlightHelper?.add(this.graphics,this.highlightName)}_setupGraphics(){let{_graphicAttributes:e,symbols:n}=this;this._centerGraphic=new t({symbol:n.centerIndicator,attributes:e}),this.showCenterGraphic&&this.layer.add(this._centerGraphic),this._backgroundGraphic=new t({symbol:n.fill.default,attributes:e}),this.layer.add(this._backgroundGraphic),this._rotateLineGraphic=new t({symbol:n.rotatorLine,attributes:e}),this._rotateHandleGraphic=new t({symbol:n.rotator.default,attributes:e}),this.enableRotation&&!this._hasExtentGraphic()&&this.layer.addMany([this._rotateLineGraphic,this._rotateHandleGraphic]);for(let r=0;r<8;r++)this._vertexGraphics.push(new t({symbol:n.handles.default,attributes:e}));this.enableScaling&&this.layer.addMany(this._vertexGraphics)}_updateSymbolsForTheme(){let e=this.view.effectiveTheme.accentColor;this.symbols={...this.symbols,fill:{active:this.symbols.fill.active?.clone().set(`outline.color`,e),default:this.symbols.fill.default?.clone().set(`outline.color`,e)},handles:{...this.symbols.handles,default:this.symbols.handles.default.clone().set(`outline.color`,e)},rotator:{...this.symbols.rotator,default:this.symbols.rotator.default.clone().set(`outline.color`,e)},rotatorLine:this.symbols.rotatorLine.clone().set(`color`,e)};for(let e of this._vertexGraphics)e.symbol=e===this._hoveredGraphic?this.symbols.handles.hover:this.symbols.handles.default;this._backgroundGraphic.symbol=this.symbols.fill.default,this._rotateHandleGraphic.symbol=this._rotateHandleGraphic===this._hoveredGraphic?this.symbols.rotator.hover:this.symbols.rotator.default,this._rotateLineGraphic.symbol=this.symbols.rotatorLine}_updateGraphics(){this._updateBackgroundGraphic(),this._updateHandleGraphics(),this._updateCenterGraphic(),this._updateRotateGraphic(),this._updateRotateLineGraphic()}_hideGraphicsBeforeUpdate(){this._centerGraphic.visible=!1,this._rotateHandleGraphic.visible=!1,this._rotateLineGraphic.visible=!1,this._vertexGraphics.forEach(e=>e.visible=!1)}_updateHandleGraphics(){let e=this._getCoordinates(!0);this._vertexGraphics.forEach((t,n)=>{let[r,i]=e[n];this._updateXY(t,r,i)})}_updateBackgroundGraphic(){let e=this._getCoordinates().map(([e,t])=>[e,t]);this._backgroundGraphic.geometry=new m({rings:[e],spatialReference:this.view.spatialReference})}_updateCenterGraphic(){let[e,t,n,r]=this._getBoxBounds(g()),i=(n+e)/2,a=(r+t)/2;this._centerGraphic.geometry=new p(i,a,this.view.spatialReference)}_updateRotateGraphic(){if(!this._vertexGraphics.length)return;let{x:e,y:t}=this._vertexGraphics[1].geometry,n=t+this.view.state.resolution*this._rotateGraphicOffset;this._rotateHandleGraphic.geometry=new p(e,n,this.view.spatialReference)}_updateRotateLineGraphic(){if(!this._vertexGraphics.length||!this._rotateHandleGraphic?.geometry)return;let e=this._vertexGraphics[1].geometry,t=this._rotateHandleGraphic.geometry;this._rotateLineGraphic.geometry=new h({paths:[[[e.x,e.y],[t.x,t.y]]],spatialReference:this.view.spatialReference})}_updateXY(e,t,n){e.geometry=new p(t,n,this.view.spatialReference)}_updateX(e,t){let n=e.geometry.y;e.geometry=new p(t,n,this.view.spatialReference)}_updateY(e,t){let n=e.geometry.x;e.geometry=new p(n,t,this.view.spatialReference)}_hasExtentGraphic(){return this.graphics.some(e=>e?.geometry!=null&&e.geometry.type===`extent`)}_getBoxBounds(e){let t=this.graphics.map(e=>e.geometry);return this._getBounds(e,t)}_getCoordinates(e){let[t,n,r,i]=this._getBoxBounds(g());if(e){let e=(t+r)/2,a=(i+n)/2;return[[t,i],[e,i],[r,i],[r,a],[r,n],[e,n],[t,n],[t,a]]}return[[t,i],[r,i],[r,n],[t,n]]}_updateTooltip(e,t){if(this.tooltip==null)return;if(!e){this.tooltip.clear();return}let{_backgroundGraphic:n,graphics:r,_vertexGraphics:i,_rotateHandleGraphic:a}=this;e===a?this._updateRotateTooltip():i.includes(e)?this._updateScaleTooltip():(r.includes(e)||e===n)&&this._updateMoveTooltip(t)}_updateRotateTooltip(){this.tooltip!=null&&(this.tooltip.info=new N({toolOptions:this.toolOptions,angle:-this._angleOfRotation}))}_updateScaleTooltip(){let{tooltip:e,_xScale:t,_yScale:n,toolOptions:r}=this;if(e==null)return;let i=Math.abs(t),a=Math.abs(n),o=this._extentScaleTooltipInfo;o.toolOptions=r,o.xScale=i,o.yScale=a,this._updatingHandles.consumePromise(this._updateScaleTooltipAsync()),e.info=o}_updateMoveTooltip(e){let{tooltip:t}=this;if(t==null)return;let n=this._translateTooltipInfo;this._updatingHandles.consumePromise(this._updateMoveTooltipAsync(e)),t.info=n}};e([u()],B.prototype,`tooltip`,void 0),e([u({readOnly:!0})],B.prototype,`type`,void 0),e([u()],B.prototype,`callbacks`,void 0),e([u()],B.prototype,`enableMovement`,void 0),e([u()],B.prototype,`enableRotation`,void 0),e([u()],B.prototype,`enableScaling`,void 0),e([u()],B.prototype,`graphics`,void 0),e([u()],B.prototype,`highlightName`,void 0),e([u()],B.prototype,`highlightsEnabled`,void 0),e([u()],B.prototype,`layer`,void 0),e([u()],B.prototype,`preserveAspectRatio`,void 0),e([u()],B.prototype,`showCenterGraphic`,void 0),e([u({readOnly:!0})],B.prototype,`state`,null),e([u()],B.prototype,`symbols`,void 0),e([u({type:j})],B.prototype,`toolOptions`,void 0),e([u({constructOnly:!0})],B.prototype,`view`,void 0),B=e([d(`esri.views.draw.support.Box`)],B);function V(e,t=2){return Number.parseFloat(e.toFixed(t))}const H=B;export{H as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import{EventedAccessor as n}from"../../../core/Evented.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{debounce as i}from"../../../core/promiseUtils.js";import{zeroMeters as a}from"../../../core/quantity.js";import{when as o,watch as s,syncAndInitial as c,initial as l}from"../../../core/reactiveUtils.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../core/support/UpdatingHandles.js";import p from"../../../geometry/Point.js";import m from"../../../geometry/Polygon.js";import h from"../../../geometry/Polyline.js";import{create as g,center as _}from"../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as v}from"../../../geometry/support/boundsUtils.js";import y from"../../../geometry/support/rotate.js";import b from"../../../symbols/SimpleFillSymbol.js";import x from"../../../symbols/SimpleLineSymbol.js";import S from"../../../symbols/SimpleMarkerSymbol.js";import{cloneMove as C,scale as w,getRotationAngle as T,getScaleRatio as E}from"./drawUtils.js";import D from"./GraphicMover.js";import O from"./HighlightHelper.js";import{addUniqueLayer as k}from"./layerUtils.js";import{settings as A}from"./settings.js";import j from"../../interactive/options/InteractiveToolOptions.js";import{makeTooltip as M}from"../../interactive/tooltip/tooltipCommonUtils.js";import{ExtentRotateTooltipInfo as N}from"../../interactive/tooltip/infos/ExtentRotateTooltipInfo.js";import{ExtentScaleTooltipInfo as P}from"../../interactive/tooltip/infos/ExtentScaleTooltipInfo.js";import{TranslateTooltipInfo as F}from"../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{GeometryWorkerHandle as I}from"../../support/GeometryWorkerHandle.js";const L=A.transformGraphics,R={centerIndicator:new S({style:`cross`,size:L.center.size,color:L.center.color}),fill:{default:new b({color:L.fill.color,outline:{color:L.fill.outlineColor,join:`round`,width:1}}),active:new b({color:L.fill.stagedColor,outline:{color:L.fill.outlineColor,join:`round`,style:`dash`,width:1}})},handles:{default:new S({style:`square`,size:L.vertex.size,color:L.vertex.color,outline:{color:L.vertex.outlineColor,width:1}}),hover:new S({style:`square`,size:L.vertex.hoverSize,color:L.vertex.hoverColor,outline:{color:L.vertex.hoverOutlineColor,width:1}})},rotator:{default:new S({style:`circle`,size:L.vertex.size,color:L.vertex.color,outline:{color:L.vertex.outlineColor,width:1}}),hover:new S({style:`circle`,size:L.vertex.hoverSize,color:L.vertex.hoverColor,outline:{color:L.vertex.hoverOutlineColor,width:1}})},rotatorLine:new x({color:L.line.color,width:1})},z=Symbol();let B=class extends n{constructor(e){super(e),this._activeHandleGraphic=null,this._graphicAttributes={esriSketchTool:`box`},this._mover=null,this._centerGraphic=null,this._backgroundGraphic=null,this._vertexGraphics=[],this._rotateHandleGraphic=null,this._rotateGraphicOffset=20,this._angleOfRotation=0,this._rotateLineGraphic=null,this._startInfo=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this.tooltip=null,this.type=`box`,this.callbacks={onMoveStart(){},onMove(){},onMoveStop(){},onScaleStart(){},onScale(){},onScaleStop(){},onRotateStart(){},onRotate(){},onRotateStop(){},onGraphicClick(){}},this.enableMovement=!0,this.enableRotation=!0,this.enableScaling=!0,this.graphics=[],this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.preserveAspectRatio=!1,this.showCenterGraphic=!0,this.symbols=R,this.toolOptions=new j,this.view=null,this._updatingHandles=new f,this._getBounds=(()=>{let e=g();return(t,n)=>{t[0]=1/0,t[1]=1/0,t[2]=-1/0,t[3]=-1/0;for(let r of n){if(!r)continue;let n,i,a,o;if(r.type===`point`)n=a=r.x,i=o=r.y;else if(r.type===`extent`)[n,i,a,o]=[r.xmin,r.ymin,r.xmax,r.ymax];else{let t=v(e,r);[n,i,a,o]=t}t[0]=Math.min(n,t[0]),t[1]=Math.min(i,t[1]),t[2]=Math.max(a,t[2]),t[3]=Math.max(o,t[3])}return t}})(),this._extentScaleTooltipInfo=new P({toolOptions:this.toolOptions}),this._measurementWorker=new I({preloadGeodetic:!0}),this._updateScaleTooltipAsync=i(async()=>{let e=this._getCoordinates(),t=this.view.spatialReference,{width:n,height:r}=await this._measurementWorker.autoSize2D(new p({x:e[0][0],y:e[0][1],spatialReference:t}),new p({x:e[1][0],y:e[1][1],spatialReference:t}),new p({x:e[2][0],y:e[2][1],spatialReference:t}),new p({x:e[3][0],y:e[3][1],spatialReference:t}));this._extentScaleTooltipInfo.xSize=n,this._extentScaleTooltipInfo.ySize=r}),this._translateTooltipInfo=new F({toolOptions:this.toolOptions}),this._updateMoveTooltipAsync=i(async e=>{let{view:t}=this,n=this._translateTooltipInfo;if(!e){n.distance=a;return}let{x:r,y:i}=e.origin,o=t.toMap(e),s=t.toMap({x:r,y:i});n.distance=await this._measurementWorker.autoDistance2DBetweenPoints(s,o)??a})}initialize(){let e=this.view;this._highlightHelper=new O({view:e}),this._setup(),this.addHandles([o(()=>e?.ready,()=>{let{layer:e,view:t}=this;k(t,e)},{once:!0,initial:!0}),s(()=>this.preserveAspectRatio,()=>{this._activeHandleGraphic&&(this._scaleGraphic(this._activeHandleGraphic),this._updateGraphics(),this._updateTooltip(this._activeHandleGraphic))}),s(()=>e?.scale,()=>{this._updateRotateGraphic(),this._updateRotateLineGraphic()}),s(()=>this.graphics,()=>this.refresh()),s(()=>this.layer,(e,t)=>{t&&this._resetGraphics(t),this.refresh()}),s(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),s(()=>this.toolOptions.tooltips.effectiveEnabled,t=>{this.tooltip=t?M(()=>({view:e,options:this.toolOptions.tooltips})):r(this.tooltip)},c),s(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),l),this.on(`move-start`,e=>this.callbacks?.onMoveStart?.(e)),this.on(`move`,e=>this.callbacks?.onMove?.(e)),this.on(`move-stop`,e=>this.callbacks?.onMoveStop?.(e)),this.on(`rotate-start`,e=>this.callbacks?.onRotateStart?.(e)),this.on(`rotate`,e=>this.callbacks?.onRotate?.(e)),this.on(`rotate-stop`,e=>this.callbacks?.onRotateStop?.(e)),this.on(`scale-start`,e=>this.callbacks?.onScaleStart?.(e)),this.on(`scale`,e=>this.callbacks?.onScale?.(e)),this.on(`scale-stop`,e=>this.callbacks?.onScaleStop?.(e))])}destroy(){this._reset(),this.tooltip=r(this.tooltip)}get state(){let e=this.view?.ready??!1,t=this.graphics.length&&this.layer;return e&&t?`active`:e?`ready`:`disabled`}get updating(){return this._updatingHandles.updating}isUIGraphic(e){return this._vertexGraphics.includes(e)||e===this._backgroundGraphic||e===this._centerGraphic||e===this._rotateHandleGraphic||e===this._rotateLineGraphic}move(e,t){if(this._mover&&this.graphics.length){for(let n of this.graphics){let r=n.geometry;n.geometry=C(r,e,t,this.view)}this.refresh(),this.emit(`move-stop`,{graphics:this.graphics,mover:null,dx:e,dy:t,type:`move-stop`})}}scale(e,t){if(!this._mover||!this.graphics.length)return;let n=this._getBoxBounds(g()),r=_(n);for(let n of this.graphics){let i=n.geometry;n.geometry=w(i,e,t,r)}this.refresh(),this.emit(`scale-stop`,{graphics:this.graphics,mover:null,xScale:e,yScale:t,type:`scale-stop`})}rotate(e,t){if(this._mover&&this.graphics.length){if(!t){let e=this._vertexGraphics[1].geometry.x,n=this._vertexGraphics[3].geometry.y;t=new p({x:e,y:n,spatialReference:this.view.spatialReference})}for(let n of this.graphics){let r=n.geometry;n.geometry=y(r,e,t)}this.refresh(),this.emit(`rotate-stop`,{graphics:this.graphics,mover:null,angle:e,type:`rotate-stop`})}}refresh(){this._reset(),this._setup()}reset(){this.graphics=[]}_setup(){this.state===`active`&&(this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._updateGraphics())}_reset(){this._highlightHelper?.removeAll(),this._resetGraphicStateVars(),this._resetGraphics(),this._updateTooltip(),this._mover?.destroy(),this._mover=null,this.removeHandles(z)}_resetGraphicStateVars(){this._startInfo=null,this._activeHandleGraphic=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this._angleOfRotation=0}_resetGraphics(e){e||=this.layer,e&&(e.removeMany(this._vertexGraphics),e.remove(this._backgroundGraphic),e.remove(this._centerGraphic),e.remove(this._rotateHandleGraphic),e.remove(this._rotateLineGraphic)),this._vertexGraphics.forEach(e=>!e.destroyed&&e.destroy()),!this._backgroundGraphic.destroyed&&this._backgroundGraphic.destroy(),!this._centerGraphic.destroyed&&this._centerGraphic.destroy(),!this._rotateHandleGraphic.destroyed&&this._rotateHandleGraphic.destroy(),!this._rotateLineGraphic.destroyed&&this._rotateLineGraphic.destroy(),this._vertexGraphics=[],this._backgroundGraphic=null,this._centerGraphic=null,this._rotateHandleGraphic=null,this._rotateLineGraphic=null}_setupMover(){let e=[];this.enableScaling&&(e=e.concat(this._vertexGraphics)),this.enableRotation&&e.push(this._rotateHandleGraphic),this.enableMovement&&(e=e.concat(this.graphics,this._backgroundGraphic)),this.showCenterGraphic&&e.push(this._centerGraphic),this._mover=new D({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,view:this.view,graphics:e,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_setCursor(e){this.addHandles(this.view.acquireCursor(e,`high`),z)}_getStartInfo(e){let[t,n,r,i]=this._getBoxBounds(g()),a=Math.abs(r-t),o=Math.abs(i-n),s=(r+t)/2,c=(i+n)/2,{x:l,y:u}=e.geometry;return{width:a,height:o,centerX:s,centerY:c,startX:l,startY:u,graphicInfos:this._getGraphicInfos(),box:this._backgroundGraphic.geometry,rotate:this._rotateHandleGraphic.geometry}}_getGraphicInfos(){return this.graphics.map(e=>this._getGraphicInfo(e))}_getGraphicInfo(e){let t=e.geometry,[n,r,i,a]=this._getBounds(g(),[t]);return{width:Math.abs(i-n),height:Math.abs(a-r),centerX:(i+n)/2,centerY:(a+r)/2,geometry:t}}_onGraphicClickCallback(e){e.viewEvent.stopPropagation(),this.emit(`graphic-click`,e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e)}_onGraphicMoveStartCallback(e){let{_angleOfRotation:t,_xScale:n,_yScale:r,_backgroundGraphic:i,_vertexGraphics:a,_rotateHandleGraphic:o,symbols:s,graphics:c}=this,{graphic:l,dx:u,dy:d,viewEvent:f}=e;this._resetGraphicStateVars(),this._hideGraphicsBeforeUpdate(),i.symbol=s.fill.active,this._startInfo=this._getStartInfo(l),this._updateTooltip(l,f),l===o?(this._setCursor(`grabbing`),this.emit(`rotate-start`,{type:`rotate-start`,mover:l,graphics:c,angle:t})):a.includes(l)?(this._activeHandleGraphic=l,this.emit(`scale-start`,{type:`scale-start`,mover:l,graphics:c,xScale:n,yScale:r})):this.emit(`move-start`,{type:`move-start`,graphics:c,mover:l,dx:u,dy:d})}_onGraphicMoveCallback(e){let t=e.graphic;if(!this._startInfo)return;let{_xScale:n,_yScale:r,_angleOfRotation:i,graphics:a}=this;if(this._vertexGraphics.includes(t))this._scaleGraphic(t),this._updateTooltip(t,e.viewEvent),this.emit(`scale`,{type:`scale`,graphics:a,mover:t,xScale:n,yScale:r});else if(t===this._rotateHandleGraphic)this._rotateGraphic(t),this._updateTooltip(t,e.viewEvent),this.emit(`rotate`,{type:`rotate`,graphics:a,mover:t,angle:i});else{let{dx:n,dy:r}=e;this._totalDx+=n,this._totalDy+=r,this._moveGraphic(t,n,r),this._updateTooltip(t,e.viewEvent),this.emit(`move`,{type:`move`,graphics:a,mover:t,dx:n,dy:r})}}_onGraphicMoveStopCallback(e){let t=e.graphic;if(!this._startInfo){this.refresh();return}let{_angleOfRotation:n,_totalDx:r,_totalDy:i,_xScale:a,_yScale:o,_vertexGraphics:s,_rotateHandleGraphic:c,graphics:l}=this;this.refresh(),t===c?(this._setCursor(`pointer`),this.emit(`rotate-stop`,{type:`rotate-stop`,graphics:l,mover:t,angle:n})):s.includes(t)?this.emit(`scale-stop`,{type:`scale-stop`,mover:t,graphics:l,xScale:a,yScale:o}):this.emit(`move-stop`,{type:`move-stop`,graphics:l,mover:t,dx:r,dy:i})}_onGraphicPointerOverCallback(e){let{_backgroundGraphic:t,_vertexGraphics:n,graphics:r,_rotateHandleGraphic:i,symbols:a,view:o}=this,s=e.graphic;if(this._hoveredGraphic=s,s===i){i.symbol=a.rotator.hover,this._setCursor(`pointer`),this._updateTooltip(s);return}if(r.includes(s)||s===t){this._setCursor(`move`);return}if(!n.includes(s)){this._setCursor(`pointer`);return}this._updateTooltip(s),e.graphic.symbol=a.handles.hover;let c=o.rotation,l=e.index,u;switch(l<8&&(c>=0&&c<45?l%=8:l=c>=45&&c<90?(l+1)%8:c>=90&&c<135?(l+2)%8:c>=135&&c<180?(l+3)%8:c>=180&&c<225?(l+4)%8:c>=225&&c<270?(l+5)%8:c>=270&&c<315?(l+6)%8:(l+7)%8),l){case 0:u=`nwse-resize`;break;case 1:u=`ns-resize`;break;case 2:u=`nesw-resize`;break;case 3:u=`ew-resize`;break;case 4:u=`nwse-resize`;break;case 5:u=`ns-resize`;break;case 6:u=`nesw-resize`;break;case 7:u=`ew-resize`;break;default:u=`pointer`}this._setCursor(u)}_onGraphicPointerOutCallback(e){let{_vertexGraphics:t,_rotateHandleGraphic:n,symbols:r}=this;this._hoveredGraphic=null,e.graphic===n?n.symbol=r.rotator.default:t.includes(e.graphic)&&(e.graphic.symbol=r.handles.default),this.removeHandles(z),this._updateTooltip()}_scaleGraphic(e){let{_startInfo:t,_vertexGraphics:n,preserveAspectRatio:r,view:i}=this,{centerX:a,centerY:o,graphicInfos:s,height:c,startX:l,startY:u,width:d}=t,{resolution:f,transform:m}=i.state,h=n.indexOf(e);(h===1||h===5)&&this._updateX(e,a),(h===3||h===7)&&this._updateY(e,o);let{x:g,y:_}=e.geometry,v=m[0]*g+m[2]*_+m[4],y=m[1]*g+m[3]*_+m[5],b=s?.map(e=>e.geometry)??[],x=b.every(e=>e.type===`point`);if((d===0||c===0)&&x){let e=V((g-l)/f),n=V((u-_)/f);for(let t=0;t<b.length;t++)this.graphics[t].geometry=C(b[t],e,n,i,!0);this._centerGraphic.geometry=new p({x:g,y:_,spatialReference:i.spatialReference}),this._backgroundGraphic.geometry=C(t.box,e,n,i,!0)}else if(r){let e=V(m[0]*a+m[2]*o+m[4],2),t=V(m[1]*a+m[3]*o+m[5],2),n=V(m[0]*l+m[2]*u+m[4],2),r=V(m[1]*l+m[3]*u+m[5],2),i=E(e,t,n,r,v,y);(i===0||Math.abs(i)===1/0)&&(i=1),this._xScale=this._yScale=i;for(let e of b){let t=b.indexOf(e);this.graphics[t].geometry=w(e,this._xScale,this._yScale,[a,o])}this._updateBackgroundGraphic()}else{let e=l>a,n=u<o,r=g-l,s=u-_;if(h===1||h===5?r=0:(h===3||h===7)&&(s=0),r===0&&s===0)return;let m=e?r:r*-1,v=n?s:s*-1,y=d+m,x=c+v,S=a+r/2,T=o+s/2,E=y/d,D=x/c;(h===1||h===5||E===0||Math.abs(E)===1/0)&&(E=1),(h===3||h===7||D===0||Math.abs(D)===1/0)&&(D=1),this._xScale=E,this._yScale=D;let O=(S-a)/f,k=(T-o)/f,A=w(t.box,this._xScale,this._yScale);this._backgroundGraphic.geometry=C(A,O,k,i,!0);let{centerX:j,centerY:M}=this._getGraphicInfo(this._backgroundGraphic),N=(j-a)/f,P=-1*(M-o)/f;for(let e of b){let t=b.indexOf(e),n=w(e,this._xScale,this._yScale,[a,o]);this.graphics[t].geometry=C(n,N,P,i,!0)}this._centerGraphic.geometry=new p({x:j,y:M,spatialReference:i.spatialReference})}}_rotateGraphic(e){let{centerX:t,centerY:n,startX:r,startY:i,box:a,rotate:o}=this._startInfo,s=this.view.spatialReference,c=new p({x:r,y:i,spatialReference:s}),l=new p({x:t,y:n,spatialReference:s}),u=e.geometry;this._angleOfRotation=T(c,u,l);let d=this._startInfo.graphicInfos?.map(e=>e.geometry)??[];for(let e of d){let t=d.indexOf(e),n=y(e,this._angleOfRotation,l);this.graphics[t].geometry=n}this._backgroundGraphic.geometry=y(a,this._angleOfRotation,l),this._rotateHandleGraphic.geometry=y(o,this._angleOfRotation,l)}_moveGraphic(e,t,n){if(this.graphics.includes(e)){let r=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=C(r,t,n,this.view);for(let r of this.graphics)r!==e&&(r.geometry=C(r.geometry,t,n,this.view))}else if(e===this._centerGraphic){let e=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=C(e,t,n,this.view)}if(e===this._backgroundGraphic||e===this._centerGraphic)for(let e of this.graphics)e.geometry=C(e.geometry,t,n,this.view)}_setUpHighlights(){this.highlightsEnabled&&this.graphics.length&&this._highlightHelper?.add(this.graphics,this.highlightName)}_setupGraphics(){let{_graphicAttributes:e,symbols:n}=this;this._centerGraphic=new t({symbol:n.centerIndicator,attributes:e}),this.showCenterGraphic&&this.layer.add(this._centerGraphic),this._backgroundGraphic=new t({symbol:n.fill.default,attributes:e}),this.layer.add(this._backgroundGraphic),this._rotateLineGraphic=new t({symbol:n.rotatorLine,attributes:e}),this._rotateHandleGraphic=new t({symbol:n.rotator.default,attributes:e}),this.enableRotation&&!this._hasExtentGraphic()&&this.layer.addMany([this._rotateLineGraphic,this._rotateHandleGraphic]);for(let r=0;r<8;r++)this._vertexGraphics.push(new t({symbol:n.handles.default,attributes:e}));this.enableScaling&&this.layer.addMany(this._vertexGraphics)}_updateSymbolsForTheme(){let e=this.view.effectiveTheme.accentColor;this.symbols={...this.symbols,fill:{active:this.symbols.fill.active?.clone().set(`outline.color`,e),default:this.symbols.fill.default?.clone().set(`outline.color`,e)},handles:{...this.symbols.handles,default:this.symbols.handles.default.clone().set(`outline.color`,e)},rotator:{...this.symbols.rotator,default:this.symbols.rotator.default.clone().set(`outline.color`,e)},rotatorLine:this.symbols.rotatorLine.clone().set(`color`,e)};for(let e of this._vertexGraphics)e.symbol=e===this._hoveredGraphic?this.symbols.handles.hover:this.symbols.handles.default;this._backgroundGraphic.symbol=this.symbols.fill.default,this._rotateHandleGraphic.symbol=this._rotateHandleGraphic===this._hoveredGraphic?this.symbols.rotator.hover:this.symbols.rotator.default,this._rotateLineGraphic.symbol=this.symbols.rotatorLine}_updateGraphics(){this._updateBackgroundGraphic(),this._updateHandleGraphics(),this._updateCenterGraphic(),this._updateRotateGraphic(),this._updateRotateLineGraphic()}_hideGraphicsBeforeUpdate(){this._centerGraphic.visible=!1,this._rotateHandleGraphic.visible=!1,this._rotateLineGraphic.visible=!1,this._vertexGraphics.forEach(e=>e.visible=!1)}_updateHandleGraphics(){let e=this._getCoordinates(!0);this._vertexGraphics.forEach((t,n)=>{let[r,i]=e[n];this._updateXY(t,r,i)})}_updateBackgroundGraphic(){let e=this._getCoordinates().map(([e,t])=>[e,t]);this._backgroundGraphic.geometry=new m({rings:[e],spatialReference:this.view.spatialReference})}_updateCenterGraphic(){let[e,t,n,r]=this._getBoxBounds(g()),i=(n+e)/2,a=(r+t)/2;this._centerGraphic.geometry=new p({x:i,y:a,spatialReference:this.view.spatialReference})}_updateRotateGraphic(){if(!this._vertexGraphics.length)return;let{x:e,y:t}=this._vertexGraphics[1].geometry,n=t+this.view.state.resolution*this._rotateGraphicOffset;this._rotateHandleGraphic.geometry=new p({x:e,y:n,spatialReference:this.view.spatialReference})}_updateRotateLineGraphic(){if(!this._vertexGraphics.length||!this._rotateHandleGraphic?.geometry)return;let e=this._vertexGraphics[1].geometry,t=this._rotateHandleGraphic.geometry;this._rotateLineGraphic.geometry=new h({paths:[[[e.x,e.y],[t.x,t.y]]],spatialReference:this.view.spatialReference})}_updateXY(e,t,n){e.geometry=new p({x:t,y:n,spatialReference:this.view.spatialReference})}_updateX(e,t){let n=e.geometry.y;e.geometry=new p({x:t,y:n,spatialReference:this.view.spatialReference})}_updateY(e,t){let n=e.geometry.x;e.geometry=new p({x:n,y:t,spatialReference:this.view.spatialReference})}_hasExtentGraphic(){return this.graphics.some(e=>e?.geometry!=null&&e.geometry.type===`extent`)}_getBoxBounds(e){let t=this.graphics.map(e=>e.geometry);return this._getBounds(e,t)}_getCoordinates(e){let[t,n,r,i]=this._getBoxBounds(g());if(e){let e=(t+r)/2,a=(i+n)/2;return[[t,i],[e,i],[r,i],[r,a],[r,n],[e,n],[t,n],[t,a]]}return[[t,i],[r,i],[r,n],[t,n]]}_updateTooltip(e,t){if(this.tooltip==null)return;if(!e){this.tooltip.clear();return}let{_backgroundGraphic:n,graphics:r,_vertexGraphics:i,_rotateHandleGraphic:a}=this;e===a?this._updateRotateTooltip():i.includes(e)?this._updateScaleTooltip():(r.includes(e)||e===n)&&this._updateMoveTooltip(t)}_updateRotateTooltip(){this.tooltip!=null&&(this.tooltip.info=new N({toolOptions:this.toolOptions,angle:-this._angleOfRotation}))}_updateScaleTooltip(){let{tooltip:e,_xScale:t,_yScale:n,toolOptions:r}=this;if(e==null)return;let i=Math.abs(t),a=Math.abs(n),o=this._extentScaleTooltipInfo;o.toolOptions=r,o.xScale=i,o.yScale=a,this._updatingHandles.consumePromise(this._updateScaleTooltipAsync()),e.info=o}_updateMoveTooltip(e){let{tooltip:t}=this;if(t==null)return;let n=this._translateTooltipInfo;this._updatingHandles.consumePromise(this._updateMoveTooltipAsync(e)),t.info=n}};e([u()],B.prototype,`tooltip`,void 0),e([u({readOnly:!0})],B.prototype,`type`,void 0),e([u()],B.prototype,`callbacks`,void 0),e([u()],B.prototype,`enableMovement`,void 0),e([u()],B.prototype,`enableRotation`,void 0),e([u()],B.prototype,`enableScaling`,void 0),e([u()],B.prototype,`graphics`,void 0),e([u()],B.prototype,`highlightName`,void 0),e([u()],B.prototype,`highlightsEnabled`,void 0),e([u()],B.prototype,`layer`,void 0),e([u()],B.prototype,`preserveAspectRatio`,void 0),e([u()],B.prototype,`showCenterGraphic`,void 0),e([u({readOnly:!0})],B.prototype,`state`,null),e([u()],B.prototype,`symbols`,void 0),e([u({type:j})],B.prototype,`toolOptions`,void 0),e([u({constructOnly:!0})],B.prototype,`view`,void 0),B=e([d(`esri.views.draw.support.Box`)],B);function V(e,t=2){return Number.parseFloat(e.toFixed(t))}const H=B;export{H as default};
|
|
@@ -9,7 +9,6 @@ import type { UnitsProperties } from "../support/Units.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* Properties used to configure [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
11
11
|
*
|
|
12
|
-
* @beta
|
|
13
12
|
* @since 5.2
|
|
14
13
|
*/
|
|
15
14
|
export interface ViewOptionsProperties {
|
|
@@ -122,7 +121,6 @@ export interface ViewOptionsProperties {
|
|
|
122
121
|
* - Where unit properties are exposed, explicit units override those configured through `view.options` per measurement type.
|
|
123
122
|
* - Set an explicit unit to `null` or `undefined` to use the unit from `view.options` for that measurement type again.
|
|
124
123
|
*
|
|
125
|
-
* @beta
|
|
126
124
|
* @since 5.2
|
|
127
125
|
* @see [Sample - View options for snapping, tooltips and units](https://developers.arcgis.com/javascript/latest/sample-code/view-options/)
|
|
128
126
|
*/
|
|
@@ -419,7 +419,9 @@ export default abstract class FeatureLikeLayerView extends LayerView {
|
|
|
419
419
|
* greater than a specified value. As features become available while navigating the map, features that match the specified objectIDs or filter are highlighted.
|
|
420
420
|
*
|
|
421
421
|
* Release-specific changes:
|
|
422
|
-
* * As of version
|
|
422
|
+
* * As of version 6.0, [FeatureFilter](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureFilter/) targets are also supported by feature-like layer views in [3D SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) and
|
|
423
|
+
* the [scene component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-scene/).
|
|
424
|
+
* * As of version 5.2, [FeatureFilter](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureFilter/) can be used as a target to highlight features that match a filter in [2D MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and
|
|
423
425
|
* the [map component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/).
|
|
424
426
|
* * As of version 4.32, the `highlight` method accepts an `options` parameter which can be used to provide a [HighlightOptions.name](https://developers.arcgis.com/javascript/latest/references/core/views/support/HighlightOptions/#name)
|
|
425
427
|
* to apply specific [HighlightOptions](https://developers.arcgis.com/javascript/latest/references/core/views/support/HighlightOptions/).
|