@arcgis/core 5.0.0-next.69 → 5.0.0-next.70
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/Map.d.ts +3 -1
- package/analysis/Analysis.d.ts +1 -0
- package/analysis/Dimension/types.d.ts +1 -0
- package/analysis/DimensionAnalysis.d.ts +10 -10
- package/analysis/DimensionSimpleStyle.d.ts +14 -13
- package/analysis/DirectLineMeasurementAnalysis.d.ts +1 -1
- package/analysis/DistanceMeasurementAnalysis.d.ts +2 -1
- package/analysis/ElevationProfile/ElevationProfileLineScene.d.ts +3 -3
- package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +1 -1
- package/analysis/ElevationProfile/types.d.ts +2 -0
- package/analysis/LengthDimension.d.ts +22 -21
- package/analysis/LineOfSightAnalysis.d.ts +2 -2
- package/analysis/ShadowCast/MinDurationOptions.d.ts +2 -2
- package/analysis/ShadowCast/types.d.ts +6 -2
- package/analysis/Slice/types.d.ts +1 -0
- package/analysis/Viewshed.d.ts +22 -20
- package/analysis/ViewshedAnalysis.d.ts +13 -13
- package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +1 -2
- package/analysis/VolumeMeasurement/VolumeMeasurementInputUnits.d.ts +2 -2
- package/analysis/VolumeMeasurement/types.d.ts +1 -0
- package/analysis/VolumeMeasurementAnalysis.d.ts +1 -0
- package/analysis/types.d.ts +5 -0
- package/arcade.d.ts +2 -2
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/04364f3dd7578c2acb71.js +1 -0
- package/assets/esri/core/workers/chunks/18ed69d563986dc2eb21.js +1 -0
- package/assets/esri/core/workers/chunks/{4c04c54330b693892cfc.js → 1a45b4b4803337f4b99f.js} +2 -2
- package/assets/esri/core/workers/chunks/{60c7f896f2246a8aa6d7.js → 244006d4b0547d574401.js} +53 -53
- package/assets/esri/core/workers/chunks/329b10897c6965948b84.js +1 -0
- package/assets/esri/core/workers/chunks/4387aaf9d5e8f6d1833d.js +1 -0
- package/assets/esri/core/workers/chunks/{944dfa9309da8f49a616.js → 6a3d66d7c92f90cc2a17.js} +1 -1
- package/assets/esri/core/workers/chunks/760a759f9697adde6dd4.js +1 -0
- package/assets/esri/core/workers/chunks/798d227205bd958de6a7.js +1 -0
- package/assets/esri/core/workers/chunks/{9d88b4ba8e511da64583.js → 98d68b145226e7527c84.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ad6595ad44c2d60c1ce.js → a79fad422d41019c8232.js} +1 -1
- package/assets/esri/core/workers/chunks/{10e474d664b20adcd917.js → db4661fd82dc61162115.js} +1 -1
- package/assets/esri/core/workers/chunks/{1d1e25bb61eeeee8ee94.js → df2ba5f9d57080fca183.js} +1 -1
- package/assets/esri/themes/base/widgets/_UtilityNetworkAssociations.scss +5 -3
- package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +15 -11
- 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/ComponentShader.glsl.js +43 -43
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/config.js +1 -1
- package/form/elements/inputs/attachments/Input.d.ts +6 -6
- package/geometry/Mesh.d.ts +20 -21
- package/geometry/Polygon.d.ts +1 -8
- package/geometry/Polygon.js +1 -1
- package/geometry/geometryEngine.d.ts +19 -19
- package/geometry/support/MeshComponent.d.ts +3 -3
- package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +2 -2
- package/geometry/support/MeshLocalVertexSpace.d.ts +2 -2
- package/geometry/support/MeshMaterial.d.ts +8 -8
- package/geometry/support/MeshMaterialMetallicRoughness.d.ts +1 -1
- package/geometry/support/MeshTexture.d.ts +3 -3
- package/geometry/support/MeshTextureTransform.d.ts +3 -3
- package/geometry/support/MeshTransform.d.ts +1 -1
- package/geometry/support/MeshVertexAttributes.d.ts +13 -5
- package/geometry/support/intersects.js +1 -1
- package/geometry/support/intersectsBase.js +1 -1
- package/geometry/support/meshUtils/centerAt.js +1 -1
- package/geometry/support/meshUtils/geographicUtils.js +1 -1
- package/geometry/support/meshUtils/georeference.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils/scale.js +1 -1
- package/geometry/support/meshUtils/types.d.ts +44 -52
- package/geometry/support/meshUtils.d.ts +6 -50
- package/geometry/support/meshUtils.js +1 -1
- package/interfaces.d.ts +5 -151
- package/kernel.js +1 -1
- package/layers/BaseDynamicLayer.d.ts +2 -2
- package/layers/BaseElevationLayer.d.ts +2 -2
- package/layers/BuildingSceneLayer.d.ts +2 -2
- package/layers/CSVLayer.d.ts +2 -2
- package/layers/CatalogLayer.d.ts +2 -2
- package/layers/DimensionLayer.d.ts +2 -2
- package/layers/ElevationLayer.d.ts +2 -2
- package/layers/FeatureLayer.d.ts +2 -2
- package/layers/GeoJSONLayer.d.ts +2 -2
- package/layers/GeoRSSLayer.d.ts +2 -2
- package/layers/GraphicsLayer.d.ts +2 -2
- package/layers/GroupLayer.d.ts +2 -2
- package/layers/ImageryLayer.d.ts +2 -2
- package/layers/ImageryTileLayer.d.ts +2 -2
- package/layers/IntegratedMesh3DTilesLayer.d.ts +2 -2
- package/layers/IntegratedMeshLayer.d.ts +2 -2
- package/layers/KMLLayer.d.ts +2 -2
- package/layers/Layer.d.ts +9 -7
- package/layers/LineOfSightLayer.d.ts +3 -3
- package/layers/MapImageLayer.d.ts +2 -2
- package/layers/MapNotesLayer.d.ts +2 -2
- package/layers/MediaLayer.d.ts +2 -2
- package/layers/OGCFeatureLayer.d.ts +2 -2
- package/layers/OrientedImageryLayer.d.ts +2 -2
- package/layers/ParquetLayer.d.ts +2 -2
- package/layers/PointCloudLayer.d.ts +2 -2
- package/layers/RouteLayer.d.ts +2 -2
- package/layers/SceneLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.d.ts +2 -2
- package/layers/TileLayer.d.ts +2 -2
- package/layers/UnknownLayer.d.ts +2 -2
- package/layers/UnsupportedLayer.d.ts +2 -2
- package/layers/VectorTileLayer.d.ts +2 -2
- package/layers/VideoLayer.d.ts +2 -2
- package/layers/ViewshedLayer.d.ts +2 -2
- package/layers/VoxelLayer.d.ts +2 -2
- package/layers/WCSLayer.d.ts +2 -2
- package/layers/WFSLayer.d.ts +2 -2
- package/layers/WMSLayer.d.ts +2 -2
- package/layers/WMTSLayer.d.ts +2 -2
- package/layers/catalog/CatalogDynamicGroupLayer.d.ts +2 -2
- package/layers/catalog/CatalogFootprintLayer.d.ts +2 -2
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +2 -2
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/raster/types.d.ts +8 -1
- package/layers/support/PixelBlock.d.ts +7 -7
- package/layers/support/RasterInfo.d.ts +2 -9
- package/layers/types.d.ts +77 -2
- package/networks/support/CircuitSection.d.ts +20 -2
- package/networks/support/CircuitSection.js +1 -1
- package/networks/support/Subcircuit.d.ts +12 -10
- package/networks/support/Subcircuit.js +1 -1
- package/networks/support/typeUtils.d.ts +2 -0
- package/networks/support/typeUtils.js +1 -1
- package/package.json +2 -2
- package/rest/support/AttributeBinsQuery.d.ts +7 -1
- package/rest/support/NormalizationBinParametersMixin.d.ts +29 -9
- package/support/revision.js +1 -1
- package/symbols/patterns/LinePattern3D.d.ts +3 -3
- package/symbols/patterns/Pattern3D.d.ts +3 -3
- package/unionTypes.d.ts +17 -17
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +6 -5
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +7 -6
- package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/types.d.ts +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +2 -2
- package/views/3d/analysis/DirectLineMeasurement/types.d.ts +1 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/types.d.ts +1 -0
- package/views/3d/analysis/types.d.ts +2 -0
- package/views/3d/constraints/Constraints.d.ts +2 -2
- package/views/3d/environment/ChapmanApproximation.glsl.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/layers/DimensionLayerView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
- package/views/3d/layers/ViewshedLayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/support/LayerPerformanceInfo.d.ts +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ViewingModeConfiguration.js +5 -0
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +2 -2
- package/views/BreakpointsOwner.d.ts +9 -10
- package/views/MapView.d.ts +18 -17
- package/views/SceneView.d.ts +30 -89
- package/views/SceneView.js +1 -1
- package/views/View2D.d.ts +0 -37
- package/views/View2D.js +1 -1
- package/views/ViewAnimation.d.ts +2 -3
- package/views/analysis/ElevationProfile/types.d.ts +7 -6
- package/views/analysis/types.d.ts +1 -0
- package/views/animation/types.d.ts +3 -1
- package/views/layers/DimensionLayerView.d.ts +97 -4
- package/views/layers/DimensionLayerView.js +1 -1
- package/views/layers/HighlightLayerViewMixin.d.ts +1 -59
- package/views/layers/HighlightLayerViewMixin.js +1 -1
- package/views/layers/ImageryLayerViewMixin.d.ts +1 -55
- package/views/layers/LineOfSightLayerView.d.ts +77 -4
- package/views/layers/LineOfSightLayerView.js +1 -1
- package/views/layers/ViewshedLayerView.d.ts +96 -5
- package/views/layers/ViewshedLayerView.js +1 -1
- package/views/navigation/Navigation.d.ts +1 -22
- package/views/navigation/Navigation.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/types.d.ts +75 -5
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.d.ts +4 -4
- package/widgets/AreaMeasurement3D.d.ts +2 -2
- package/widgets/BasemapGallery.d.ts +1 -1
- package/widgets/BasemapToggle.d.ts +1 -1
- package/widgets/Bookmarks.d.ts +1 -1
- package/widgets/BuildingExplorer/BuildingExplorerViewModel.d.ts +2 -2
- package/widgets/BuildingExplorer/BuildingLevel.d.ts +2 -2
- package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.d.ts +2 -2
- package/widgets/BuildingExplorer/BuildingPhase.d.ts +2 -2
- package/widgets/BuildingExplorer.d.ts +3 -3
- package/widgets/Compass.d.ts +1 -1
- package/widgets/CoordinateConversion.d.ts +1 -1
- package/widgets/Daylight/DaylightViewModel.d.ts +3 -3
- package/widgets/Daylight/VisibleElements.d.ts +2 -2
- package/widgets/Daylight/types.d.ts +2 -2
- package/widgets/Daylight.d.ts +3 -3
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.d.ts +4 -4
- package/widgets/DirectLineMeasurement3D.d.ts +2 -2
- package/widgets/DirectionalPad.d.ts +1 -1
- package/widgets/ElevationProfile/ElevationProfileLine.d.ts +2 -2
- package/widgets/ElevationProfile/ElevationProfileLineGround.d.ts +2 -2
- package/widgets/ElevationProfile/ElevationProfileLineInput.d.ts +2 -2
- package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +2 -2
- package/widgets/ElevationProfile/ElevationProfileLineView.d.ts +3 -3
- package/widgets/ElevationProfile/ElevationProfileViewModel.d.ts +2 -2
- package/widgets/ElevationProfile/ElevationProfileVisibleElements.d.ts +2 -2
- package/widgets/ElevationProfile/types.d.ts +9 -9
- package/widgets/ElevationProfile.d.ts +2 -2
- package/widgets/Expand/ExpandViewModel.d.ts +1 -1
- package/widgets/Expand.d.ts +1 -1
- package/widgets/Feature.d.ts +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -1
- package/widgets/Features.d.ts +1 -1
- package/widgets/Fullscreen/FullscreenViewModel.d.ts +1 -1
- package/widgets/Fullscreen.d.ts +1 -1
- package/widgets/Home.d.ts +1 -1
- package/widgets/LayerList.d.ts +12 -0
- package/widgets/Legend.d.ts +1 -1
- package/widgets/LineOfSight/LineOfSightTarget.d.ts +2 -2
- package/widgets/LineOfSight/LineOfSightViewModel.d.ts +2 -2
- package/widgets/LineOfSight.d.ts +2 -2
- package/widgets/Locate/LocateViewModel.d.ts +1 -1
- package/widgets/Locate.d.ts +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.d.ts +1 -1
- package/widgets/NavigationToggle.d.ts +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/Arrow.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationNode.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUIViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManagerPanoramic.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
- package/widgets/OrientedImageryViewer/support/MediaPrefetcher.js +5 -0
- package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
- package/widgets/OrientedImageryViewer/support/NonPanoramicMediaCollection.js +1 -1
- package/widgets/OrientedImageryViewer/support/resolveMediaProps.js +5 -0
- package/widgets/OrientedImageryViewer/utils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Print/CustomTemplate.d.ts +1 -1
- package/widgets/Print/PrintViewModel.d.ts +1 -1
- package/widgets/Print.d.ts +1 -1
- package/widgets/ScaleBar.d.ts +1 -1
- package/widgets/Search.d.ts +1 -1
- package/widgets/ShadowCast/DiscreteOptions.d.ts +2 -2
- package/widgets/ShadowCast/DurationOptions.d.ts +2 -2
- package/widgets/ShadowCast/ShadowCastViewModel.d.ts +3 -3
- package/widgets/ShadowCast/ShadowCastVisibleElements.d.ts +2 -2
- package/widgets/ShadowCast/ThresholdOptions.d.ts +2 -2
- package/widgets/ShadowCast/types.d.ts +2 -2
- package/widgets/ShadowCast.d.ts +1 -1
- package/widgets/Slice/SliceViewModel.d.ts +2 -2
- package/widgets/Slice.d.ts +2 -2
- package/widgets/Swipe.d.ts +1 -1
- package/widgets/TimeZoneLabel.d.ts +1 -1
- package/widgets/Track.d.ts +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/VideoPlayer.d.ts +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/Weather/VisibleElements.d.ts +2 -2
- package/widgets/Weather/WeatherViewModel.d.ts +2 -2
- package/widgets/Weather/types.d.ts +1 -1
- package/widgets/Weather.d.ts +2 -2
- package/widgets/Zoom.d.ts +1 -1
- package/widgets/support/GridControls.d.ts +1 -1
- package/assets/esri/core/workers/chunks/35961e71f69ae1d24b9e.js +0 -1
- package/assets/esri/core/workers/chunks/3cce8e894bf37c3e598e.js +0 -1
- package/assets/esri/core/workers/chunks/7ee68f67f9cc48a328f0.js +0 -1
- package/assets/esri/core/workers/chunks/a931515a2569713e743b.js +0 -1
- package/assets/esri/core/workers/chunks/bb4574a87ca21e719f0d.js +0 -1
- package/assets/esri/core/workers/chunks/c9f868f85d740ee32715.js +0 -1
- package/geometry.d.ts +0 -136
- package/geometry.js +0 -5
- package/pointCloudRenderers.d.ts +0 -112
- package/pointCloudRenderers.js +0 -5
- package/rasterRenderers.d.ts +0 -151
- package/rasterRenderers.js +0 -5
- package/renderers.d.ts +0 -166
- package/renderers.js +0 -5
- package/views/layers/DimensionLayerViewMixin.d.ts +0 -1
- package/views/layers/DimensionLayerViewMixin.js +0 -5
- package/views/layers/LineOfSightLayerViewMixin.d.ts +0 -1
- package/views/layers/LineOfSightLayerViewMixin.js +0 -5
- package/views/layers/ViewshedLayerViewMixin.d.ts +0 -98
- package/views/layers/ViewshedLayerViewMixin.js +0 -5
package/views/SceneView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/units.js";import{property as R,cast as T,subclass as x}from"../core/accessorSupport/decorators.js";import{ensureType as O,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as E}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as L}from"../core/accessorSupport/trackingUtils.js";import{create as H}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as I}from"../core/libs/rbush/PooledRBush.js";import{initialize as P}from"../core/workers/workers.js";import F from"../geometry/Extent.js";import D from"../geometry/HeightModelInfo.js";import U from"../geometry/Point.js";import{project as G,canProjectWithoutEngine as W}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as q}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as k}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as B}from"../geometry/projection/projectPointToVector.js";import{toExtent as N,create as Q}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Y}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Z}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as $}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as J,isTiledLayer as K,isVoxelLayer as X,isIntegratedMeshLayer as ee}from"../layers/support/layerUtils.js";import{TilemapCache as te}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as ie}from"../portal/portalDefault.js";import{WebSceneTag as re}from"../support/tagSymbols.js";import{BreakpointsOwner as se}from"./BreakpointsOwner.js";import{DOMContainer as ne}from"./DOMContainer.js";import{PopupView as ae}from"./PopupView.js";import oe from"./View.js";import le from"./ViewAnimation.js";import{stringFromViewingMode as pe,viewingModeFromString as he}from"./ViewingMode.js";import{GroundView3D as de}from"./3d/GroundView3D.js";import{layerView3DImporter as ue}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as ce}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ge}from"./3d/camera/intersectionUtils.js";import me from"./3d/constraints/Constraints.js";import{EnvironmentManager as ye}from"./3d/environment/EnvironmentManager.js";import fe from"./3d/environment/SceneViewEnvironment.js";import we from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as ve}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as _e}from"./3d/layers/graphics/Labeler.js";import be from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Me}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as Se}from"./3d/state/ScreenSizePerspective.js";import Ve from"./3d/state/ViewState.js";import{ViewStateManager as je,cleanupViewStateManager as Ce}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Re}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Te}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as xe}from"./3d/state/utils/navigationUtils.js";import Oe from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Ae}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Ee}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Le}from"./3d/support/ElevationProvider.js";import{toMap as He,hitTest as Ie}from"./3d/support/hitTest.js";import{popupHitTest as Pe}from"./3d/support/popupHitTest.js";import{getQualityProfileSettings as Fe,getDefaultQualityProfileName as De}from"./3d/support/QualityProfile.js";import Ue from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ge}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as We}from"./3d/support/ResourceController.js";import ze from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as qe}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ke}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Be}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ne from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Qe,getTiledLayerInfo as Ye,checkIfTileInfoSupportedForView as Ze}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as $e}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Je}from"./3d/terrain/TileRenderer.js";import{Stage as Ke}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Xe}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as et}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as tt}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as it}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as rt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as st}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import nt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as at}from"./support/drapedUtils.js";import{defaultHighlightName as ot}from"./support/HighlightDefaults.js";import lt from"./support/HighlightOptions.js";import{occludeesSupported as pt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as ht,createScreenPointFromSupportedEvent as dt}from"./support/screenUtils.js";import{isSpatialReferenceSupported as ut}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as ct,destroyTextureCompressionWorker as gt}from"./support/TextureCompressionHelper.js";import mt from"./ui/DefaultUI.js";import yt from"./ui/3d/DefaultUI3D.js";import ft from"../webscene/Environment.js";import{clearVNodeCache as wt}from"../widgets/support/vnodeCache.js";var vt;const _t=Symbol(),bt=Symbol();let Mt=class extends(se(ae(ne(oe)))){static{vt=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=We(this),this.deconflictor=new ve({view:this}),this.attribution3D=new Oe({view:this}),this.labeler=new _e({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.basemapTerrain=null,this.elevationProvider=new Ae({view:this}),this._canvas=null,this.constraints=new me,this._environment=new fe,this.environmentManager=new ye,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new nt({importAnalysisViewModule:e=>ce(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new Ve({view:this}),this.slice=new ke,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new yt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,P();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new we({view:this}),this.stateManager=new je({view:this}),this.screenSizePerspective=new Se({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=ct(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new de({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(gt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),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.basemapTerrain?.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=O(U,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof F?this.spatialReference&&(t=St(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==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&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:St(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=St(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=St(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new F({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(e)),null==t)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);const o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof fe?e:e instanceof ft?this.environment?.cloneWithWebsceneEnvironment(e)??fe.fromWebsceneEnvironment(e):O(fe,e):new fe}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 vt._layerToLayerview}static{this._layerToLayerview=oe._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&&re 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){const t=Fe(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new Ue(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||De()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?Z(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?D.deriveUnitFromSR(e,this.spatialReference):null}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;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Qe(r))return;++i,e+=r.updatingProgress}}else++i});for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return pe(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?pe(this.defaultsFromMap.viewingMode):ut(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 highlightOptions(){return this.highlights.find(({name:e})=>e===ot)??new lt}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===ot)return void this.highlights.items[t].assignFrom(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 ze(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||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;const i=ht(e)?dt(this,e):e;return He(this,i,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 null==e.z&&(t=Rt,t.x=e.x,t.y=e.y,t.z=Le(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),B(t,Vt,this.renderSpatialReference),this.state.camera.projectToScreen(Vt,jt),V(jt[0],jt[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;const i=this.renderSpatialReference;B(e,Vt,i);const r=this.state.camera.computeScreenPixelSizeAt(Vt);return t&&i!==t?r*C(i)/C(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;const i=ht(e)?dt(this,e):e;return Ie(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Pe(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("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){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!Xe())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("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 ue.importLayerView(e)}hasLayerViewModule(e){return ue.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?he(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!ut(e,i)&&(null==t||(!!J(t)||(!K(t)||null!=Ye(t,e,i))&&(!X(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(J(t)&&(r||s)){return!s||2===i||null===Ze(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return K(t)||X(t)||!r&&!s?K(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${pe(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),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;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&pt(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await Tt[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.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 Ne({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{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 Be({view:this})),this.addHandles([this.updatingHandles.add(()=>Ee.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Ee.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?G(N(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.addPromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},w)],_t),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const 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(bt),this.removeHandles(_t),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Y(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ge.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!k(e,this.groundView.spatialReference,Ct,t)||(this.renderCoordsHelper.extent=Ct)},w),bt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(tt/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(bt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Te(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Ke({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(tt/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new qe({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")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.groundView?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===he(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?E(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(rt);for(const t of this.allLayerViews)ee(t.layer)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(rt);for(const t of this.allLayerViews)ee(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){wt(),L(),j(),st(),Ce(),ge(),Me(),q(),at(),ie(),Je(),it(),Re(),xe(),I(),M(),et(),$e(),be.cleanupI3SLodHandling(),te.cleanupTilemapCache(),Ve.cleanupViewstate(),Ne.cleanupTerrainSurface()}};function St(e,t){return null!=e&&W(e.spatialReference,t)?G(e,t):null}e([R()],Mt.prototype,"_userClippingArea",void 0),e([R()],Mt.prototype,"_resourceController",void 0),e([R()],Mt.prototype,"stage",null),e([R({readOnly:!0})],Mt.prototype,"deconflictor",void 0),e([R({readOnly:!0})],Mt.prototype,"labeler",void 0),e([R({type:le,readOnly:!0})],Mt.prototype,"animation",null),e([R({readOnly:!0})],Mt.prototype,"basemapTerrain",void 0),e([R({readOnly:!0})],Mt.prototype,"overlayManager",null),e([R({readOnly:!0})],Mt.prototype,"elevationProvider",void 0),e([R()],Mt.prototype,"camera",null),e([R({type:t})],Mt.prototype,"contentCamera",null),e([R({readOnly:!0})],Mt.prototype,"canvas",null),e([R({type:U,useTypeForAutocast:!1})],Mt.prototype,"center",null),e([R({type:F})],Mt.prototype,"clippingArea",null),e([R({type:me,nonNullable:!0})],Mt.prototype,"constraints",void 0),e([R({type:F,readOnly:!0})],Mt.prototype,"renderDataExtent",null),e([R({readOnly:!0})],Mt.prototype,"tileInfo",null),e([R({type:F,readOnly:!0})],Mt.prototype,"dataExtent",null),e([R({type:F,readOnly:!0})],Mt.prototype,"_groundAndLayersExtent",null),e([R({type:fe})],Mt.prototype,"environment",null),e([T("environment")],Mt.prototype,"castEnvironment",null),e([R({readOnly:!0})],Mt.prototype,"environmentManager",void 0),e([R({type:F})],Mt.prototype,"extent",null),e([R({type:r})],Mt.prototype,"floors",void 0),e([R()],Mt.prototype,"screenCenter",null),e([R()],Mt.prototype,"frustum",null),e([R({type:Number,readOnly:!0})],Mt.prototype,"fullOpacity",void 0),e([R({readOnly:!0})],Mt.prototype,"graphicsView",void 0),e([R()],Mt.prototype,"analysisViewManager",void 0),e([R()],Mt.prototype,"groundView",void 0),e([R({readOnly:!0})],Mt.prototype,"layerviewCollections",null),e([R({type:Boolean})],Mt.prototype,"initialExtentRequired",null),e([R()],Mt.prototype,"defaultsFromMapSettings",null),e([R()],Mt.prototype,"interacting",null),e([R()],Mt.prototype,"stationary",null),e([R()],Mt.prototype,"navigating",null),e([R()],Mt.prototype,"map",void 0),e([R()],Mt.prototype,"padding",null),e([R({type:Be,readOnly:!0})],Mt.prototype,"pointsOfInterest",void 0),e([R()],Mt.prototype,"_featureTiles",void 0),e([R()],Mt.prototype,"featureTiles",null),e([R()],Mt.prototype,"_featureTreeDebugger",void 0),e([R({constructOnly:!0})],Mt.prototype,"deactivatedWebGLExtensions",void 0),e([R({constructOnly:!0})],Mt.prototype,"debugWebGLExtensions",void 0),e([R({constructOnly:!0})],Mt.prototype,"renderCanvas",void 0),e([R({constructOnly:!0})],Mt.prototype,"state",void 0),e([R()],Mt.prototype,"screenSizePerspective",void 0),e([R({readOnly:!0})],Mt.prototype,"inputManager",void 0),e([R({readOnly:!0})],Mt.prototype,"stateManager",void 0),e([R({type:["low","medium","high"]})],Mt.prototype,"qualityProfile",null),e([R({type:Ue,get(){let e=this._get("qualitySettings");if(!e){const t=Fe(this.qualityProfile);e=new Ue(t)}return e}})],Mt.prototype,"qualitySettings",void 0),e([R()],Mt.prototype,"slice",void 0),e([R({readOnly:!0})],Mt.prototype,"typeSpecificPreconditionsReady",null),e([R({readOnly:!0})],Mt.prototype,"renderCoordsHelper",void 0),e([R({readOnly:!0})],Mt.prototype,"sceneIntersectionHelper",void 0),e([R({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],Mt.prototype,"resolution",null),e([R({type:Number})],Mt.prototype,"scale",null),e([R({readOnly:!0,type:Number})],Mt.prototype,"terrainLevel",null),e([R()],Mt.prototype,"heightModelInfo",null),e([R({type:z})],Mt.prototype,"spatialReference",void 0),e([R({type:Boolean,value:!1})],Mt.prototype,"alphaCompositingEnabled",null),e([R({constructOnly:!0})],Mt.prototype,"preserveDrawingBufferEnabled",void 0),e([R({type:Boolean})],Mt.prototype,"supersampleScreenshotsEnabled",void 0),e([R({readOnly:!0})],Mt.prototype,"type",void 0),e([R(),T(e=>e instanceof mt?e:A(yt,e))],Mt.prototype,"ui",void 0),e([R({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],Mt.prototype,"updating",null),e([R()],Mt.prototype,"_updatingObjects",null),e([R()],Mt.prototype,"_updatingObjectsWithProgress",null),e([R({type:Number,readOnly:!0,dependsOn:["updating"]})],Mt.prototype,"updatingProgress",void 0),e([R({type:["global","local"]})],Mt.prototype,"viewingMode",null),e([R({type:i})],Mt.prototype,"viewpoint",null),e([R({readOnly:!0})],Mt.prototype,"visibleArea",null),e([R({type:Number})],Mt.prototype,"zoom",null),e([R({type:lt})],Mt.prototype,"highlightOptions",null),e([R({readOnly:!0})],Mt.prototype,"quality",null),e([R({readOnly:!0})],Mt.prototype,"resolutionScale",null),e([R()],Mt.prototype,"focusAreasView",void 0),e([R()],Mt.prototype,"_defaultToMapOptions",null),e([R()],Mt.prototype,"_defaultHitTestOptions",null),Mt=vt=e([x("esri.views.SceneView")],Mt);const Vt=H(),jt=S(),Ct=Q(),Rt=$(0,0,0,z.WebMercator),Tt={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},xt=Mt;export{xt as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/units.js";import{property as R,cast as T,subclass as x}from"../core/accessorSupport/decorators.js";import{ensureType as O,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as E}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as L}from"../core/accessorSupport/trackingUtils.js";import{create as H}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as I}from"../core/libs/rbush/PooledRBush.js";import{initialize as P}from"../core/workers/workers.js";import F from"../geometry/Extent.js";import D from"../geometry/HeightModelInfo.js";import U from"../geometry/Point.js";import{project as G,canProjectWithoutEngine as W}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as q}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as k}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as B}from"../geometry/projection/projectPointToVector.js";import{toExtent as N,create as Q}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Y}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Z}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as $}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as J,isTiledLayer as K,isVoxelLayer as X,isIntegratedMeshLayer as ee}from"../layers/support/layerUtils.js";import{TilemapCache as te}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as ie}from"../portal/portalDefault.js";import{WebSceneTag as re}from"../support/tagSymbols.js";import{BreakpointsOwner as se}from"./BreakpointsOwner.js";import{DOMContainer as ne}from"./DOMContainer.js";import{PopupView as ae}from"./PopupView.js";import oe from"./View.js";import le from"./ViewAnimation.js";import{stringFromViewingMode as pe,viewingModeFromString as he}from"./ViewingMode.js";import{GroundView3D as de}from"./3d/GroundView3D.js";import{layerView3DImporter as ue}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as ce}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ge}from"./3d/camera/intersectionUtils.js";import me from"./3d/constraints/Constraints.js";import{EnvironmentManager as ye}from"./3d/environment/EnvironmentManager.js";import fe from"./3d/environment/SceneViewEnvironment.js";import we from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as ve}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as _e}from"./3d/layers/graphics/Labeler.js";import be from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Me}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as Se}from"./3d/state/ScreenSizePerspective.js";import Ve from"./3d/state/ViewState.js";import{ViewStateManager as je,cleanupViewStateManager as Ce}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Re}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Te}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as xe}from"./3d/state/utils/navigationUtils.js";import Oe from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Ae}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Ee}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Le}from"./3d/support/ElevationProvider.js";import{toMap as He,hitTest as Ie}from"./3d/support/hitTest.js";import{popupHitTest as Pe}from"./3d/support/popupHitTest.js";import{getQualityProfileSettings as Fe,getDefaultQualityProfileName as De}from"./3d/support/QualityProfile.js";import Ue from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ge}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as We}from"./3d/support/ResourceController.js";import ze from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as qe}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ke}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Be}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ne from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Qe,getTiledLayerInfo as Ye,checkIfTileInfoSupportedForView as Ze}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as $e}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Je}from"./3d/terrain/TileRenderer.js";import{Stage as Ke}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Xe}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as et}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as tt}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as it}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as rt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as st}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import nt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as at}from"./support/drapedUtils.js";import{occludeesSupported as ot}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as lt,createScreenPointFromSupportedEvent as pt}from"./support/screenUtils.js";import{isSpatialReferenceSupported as ht}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as dt,destroyTextureCompressionWorker as ut}from"./support/TextureCompressionHelper.js";import ct from"./ui/DefaultUI.js";import gt from"./ui/3d/DefaultUI3D.js";import mt from"../webscene/Environment.js";import{clearVNodeCache as yt}from"../widgets/support/vnodeCache.js";var ft;const wt=Symbol(),vt=Symbol();let _t=class extends(se(ae(ne(oe)))){static{ft=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=We(this),this.deconflictor=new ve({view:this}),this.attribution3D=new Oe({view:this}),this.labeler=new _e({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.basemapTerrain=null,this.elevationProvider=new Ae({view:this}),this._canvas=null,this.constraints=new me,this._environment=new fe,this.environmentManager=new ye,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new nt({importAnalysisViewModule:e=>ce(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new Ve({view:this}),this.slice=new ke,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new gt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,P();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new we({view:this}),this.stateManager=new je({view:this}),this.screenSizePerspective=new Se({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=dt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new de({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(ut(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),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.basemapTerrain?.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=O(U,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof F?this.spatialReference&&(t=bt(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==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&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:bt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=bt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=bt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new F({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(e)),null==t)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);const o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof fe?e:e instanceof mt?this.environment?.cloneWithWebsceneEnvironment(e)??fe.fromWebsceneEnvironment(e):O(fe,e):new fe}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 ft._layerToLayerview}static{this._layerToLayerview=oe._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&&re 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){const t=Fe(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new Ue(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||De()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?Z(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?D.deriveUnitFromSR(e,this.spatialReference):null}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;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Qe(r))return;++i,e+=r.updatingProgress}}else++i});for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return pe(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?pe(this.defaultsFromMap.viewingMode):ht(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 ze(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||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;const i=lt(e)?pt(this,e):e;return He(this,i,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 null==e.z&&(t=jt,t.x=e.x,t.y=e.y,t.z=Le(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),B(t,Mt,this.renderSpatialReference),this.state.camera.projectToScreen(Mt,St),V(St[0],St[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;const i=this.renderSpatialReference;B(e,Mt,i);const r=this.state.camera.computeScreenPixelSizeAt(Mt);return t&&i!==t?r*C(i)/C(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;const i=lt(e)?pt(this,e):e;return Ie(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Pe(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("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){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!Xe())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("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 ue.importLayerView(e)}hasLayerViewModule(e){return ue.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?he(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!ht(e,i)&&(null==t||(!!J(t)||(!K(t)||null!=Ye(t,e,i))&&(!X(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(J(t)&&(r||s)){return!s||2===i||null===Ze(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return K(t)||X(t)||!r&&!s?K(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${pe(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),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;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&ot(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await Ct[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.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 Ne({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{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 Be({view:this})),this.addHandles([this.updatingHandles.add(()=>Ee.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Ee.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?G(N(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.addPromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},w)],wt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const 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(vt),this.removeHandles(wt),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Y(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ge.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!k(e,this.groundView.spatialReference,Vt,t)||(this.renderCoordsHelper.extent=Vt)},w),vt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(tt/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(vt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Te(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Ke({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(tt/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new qe({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")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.groundView?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===he(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?E(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(rt);for(const t of this.allLayerViews)ee(t.layer)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(rt);for(const t of this.allLayerViews)ee(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){yt(),L(),j(),st(),Ce(),ge(),Me(),q(),at(),ie(),Je(),it(),Re(),xe(),I(),M(),et(),$e(),be.cleanupI3SLodHandling(),te.cleanupTilemapCache(),Ve.cleanupViewstate(),Ne.cleanupTerrainSurface()}};function bt(e,t){return null!=e&&W(e.spatialReference,t)?G(e,t):null}e([R()],_t.prototype,"_userClippingArea",void 0),e([R()],_t.prototype,"_resourceController",void 0),e([R()],_t.prototype,"stage",null),e([R({readOnly:!0})],_t.prototype,"deconflictor",void 0),e([R({readOnly:!0})],_t.prototype,"labeler",void 0),e([R({type:le,readOnly:!0})],_t.prototype,"animation",null),e([R({readOnly:!0})],_t.prototype,"basemapTerrain",void 0),e([R({readOnly:!0})],_t.prototype,"overlayManager",null),e([R({readOnly:!0})],_t.prototype,"elevationProvider",void 0),e([R()],_t.prototype,"camera",null),e([R({type:t})],_t.prototype,"contentCamera",null),e([R({readOnly:!0})],_t.prototype,"canvas",null),e([R({type:U,useTypeForAutocast:!1})],_t.prototype,"center",null),e([R({type:F})],_t.prototype,"clippingArea",null),e([R({type:me,nonNullable:!0})],_t.prototype,"constraints",void 0),e([R({type:F,readOnly:!0})],_t.prototype,"renderDataExtent",null),e([R({readOnly:!0})],_t.prototype,"tileInfo",null),e([R({type:F,readOnly:!0})],_t.prototype,"dataExtent",null),e([R({type:F,readOnly:!0})],_t.prototype,"_groundAndLayersExtent",null),e([R({type:fe})],_t.prototype,"environment",null),e([T("environment")],_t.prototype,"castEnvironment",null),e([R({readOnly:!0})],_t.prototype,"environmentManager",void 0),e([R({type:F})],_t.prototype,"extent",null),e([R({type:r})],_t.prototype,"floors",void 0),e([R()],_t.prototype,"screenCenter",null),e([R()],_t.prototype,"frustum",null),e([R({type:Number,readOnly:!0})],_t.prototype,"fullOpacity",void 0),e([R({readOnly:!0})],_t.prototype,"graphicsView",void 0),e([R()],_t.prototype,"analysisViewManager",void 0),e([R()],_t.prototype,"groundView",void 0),e([R({readOnly:!0})],_t.prototype,"layerviewCollections",null),e([R({type:Boolean})],_t.prototype,"initialExtentRequired",null),e([R()],_t.prototype,"defaultsFromMapSettings",null),e([R()],_t.prototype,"interacting",null),e([R()],_t.prototype,"stationary",null),e([R()],_t.prototype,"navigating",null),e([R()],_t.prototype,"map",void 0),e([R()],_t.prototype,"padding",null),e([R({type:Be,readOnly:!0})],_t.prototype,"pointsOfInterest",void 0),e([R()],_t.prototype,"_featureTiles",void 0),e([R()],_t.prototype,"featureTiles",null),e([R()],_t.prototype,"_featureTreeDebugger",void 0),e([R({constructOnly:!0})],_t.prototype,"deactivatedWebGLExtensions",void 0),e([R({constructOnly:!0})],_t.prototype,"debugWebGLExtensions",void 0),e([R({constructOnly:!0})],_t.prototype,"renderCanvas",void 0),e([R({constructOnly:!0})],_t.prototype,"state",void 0),e([R()],_t.prototype,"screenSizePerspective",void 0),e([R({readOnly:!0})],_t.prototype,"inputManager",void 0),e([R({readOnly:!0})],_t.prototype,"stateManager",void 0),e([R({type:["low","medium","high"]})],_t.prototype,"qualityProfile",null),e([R({type:Ue,get(){let e=this._get("qualitySettings");if(!e){const t=Fe(this.qualityProfile);e=new Ue(t)}return e}})],_t.prototype,"qualitySettings",void 0),e([R()],_t.prototype,"slice",void 0),e([R({readOnly:!0})],_t.prototype,"typeSpecificPreconditionsReady",null),e([R({readOnly:!0})],_t.prototype,"renderCoordsHelper",void 0),e([R({readOnly:!0})],_t.prototype,"sceneIntersectionHelper",void 0),e([R({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],_t.prototype,"resolution",null),e([R({type:Number})],_t.prototype,"scale",null),e([R({readOnly:!0,type:Number})],_t.prototype,"terrainLevel",null),e([R()],_t.prototype,"heightModelInfo",null),e([R({type:z})],_t.prototype,"spatialReference",void 0),e([R({type:Boolean,value:!1})],_t.prototype,"alphaCompositingEnabled",null),e([R({constructOnly:!0})],_t.prototype,"preserveDrawingBufferEnabled",void 0),e([R({type:Boolean})],_t.prototype,"supersampleScreenshotsEnabled",void 0),e([R({readOnly:!0})],_t.prototype,"type",void 0),e([R(),T(e=>e instanceof ct?e:A(gt,e))],_t.prototype,"ui",void 0),e([R({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],_t.prototype,"updating",null),e([R()],_t.prototype,"_updatingObjects",null),e([R()],_t.prototype,"_updatingObjectsWithProgress",null),e([R({type:Number,readOnly:!0,dependsOn:["updating"]})],_t.prototype,"updatingProgress",void 0),e([R({type:["global","local"]})],_t.prototype,"viewingMode",null),e([R({type:i})],_t.prototype,"viewpoint",null),e([R({readOnly:!0})],_t.prototype,"visibleArea",null),e([R({type:Number})],_t.prototype,"zoom",null),e([R({readOnly:!0})],_t.prototype,"quality",null),e([R({readOnly:!0})],_t.prototype,"resolutionScale",null),e([R()],_t.prototype,"focusAreasView",void 0),e([R()],_t.prototype,"_defaultToMapOptions",null),e([R()],_t.prototype,"_defaultHitTestOptions",null),_t=ft=e([x("esri.views.SceneView")],_t);const Mt=H(),St=S(),Vt=Q(),jt=$(0,0,0,z.WebMercator),Ct={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Rt=_t;export{Rt as default};
|
package/views/View2D.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ import type ViewAnimation from "./ViewAnimation.js";
|
|
|
13
13
|
import type MapViewConstraints from "./2d/MapViewConstraints.js";
|
|
14
14
|
import type ElevationProfileAnalysisView2D from "./2d/analysis/ElevationProfileAnalysisView2D.js";
|
|
15
15
|
import type LayerView from "./layers/LayerView.js";
|
|
16
|
-
import type HighlightOptions from "./support/HighlightOptions.js";
|
|
17
16
|
import type ColorBackground from "../webmap/background/ColorBackground.js";
|
|
18
17
|
import type { ViewpointProperties } from "../Viewpoint.js";
|
|
19
18
|
import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
|
|
@@ -31,7 +30,6 @@ import type { LayerView2DFor, ResizeAlign } from "./2d/types.js";
|
|
|
31
30
|
import type { AnalysisView2DUnion } from "./2d/analysis/types.js";
|
|
32
31
|
import type { ColorBackgroundProperties } from "../webmap/background/ColorBackground.js";
|
|
33
32
|
import type { PointProperties } from "../geometry/Point.js";
|
|
34
|
-
import type { HighlightOptionsProperties } from "./support/HighlightOptions.js";
|
|
35
33
|
import type { ViewProperties } from "./View.js";
|
|
36
34
|
|
|
37
35
|
export interface View2DProperties extends ViewProperties, DOMContainerProperties, PopupViewProperties, BreakpointsOwnerProperties, Viewport2DMixinProperties, Partial<Pick<View2D, "resizeAlign" | "rotation" | "scale" | "spatialReferenceLocked" | "timeZone" | "zoom">> {
|
|
@@ -227,23 +225,6 @@ export interface View2DProperties extends ViewProperties, DOMContainerProperties
|
|
|
227
225
|
* @since 4.19
|
|
228
226
|
*/
|
|
229
227
|
floors?: ReadonlyArrayOrCollection<string>;
|
|
230
|
-
/**
|
|
231
|
-
* Options for configuring the highlight. Use the highlight method on the
|
|
232
|
-
* appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature.
|
|
233
|
-
*
|
|
234
|
-
* @deprecated since version 4.32. Use the [highlights](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#highlights) property instead.
|
|
235
|
-
* @see [Sample: Highlight SceneLayer](https://developers.arcgis.com/javascript/latest/sample-code/highlight-scenelayer/)
|
|
236
|
-
* @example
|
|
237
|
-
* const view = new MapView({
|
|
238
|
-
* map: map,
|
|
239
|
-
* highlightOptions: {
|
|
240
|
-
* color: [255, 255, 0, 1],
|
|
241
|
-
* haloOpacity: 0.9,
|
|
242
|
-
* fillOpacity: 0.2
|
|
243
|
-
* }
|
|
244
|
-
* });
|
|
245
|
-
*/
|
|
246
|
-
highlightOptions?: HighlightOptionsProperties;
|
|
247
228
|
/**
|
|
248
229
|
* The spatial reference of the view. This indicates the projected or geographic coordinate system used to locate geographic features in the map.
|
|
249
230
|
* Starting at version 4.23, you can change the spatialReference of the MapView after it is initialized by either directly changing
|
|
@@ -571,24 +552,6 @@ export default abstract class View2D extends View2DSuperclass {
|
|
|
571
552
|
*/
|
|
572
553
|
get floors(): Collection<string>;
|
|
573
554
|
set floors(value: ReadonlyArrayOrCollection<string>);
|
|
574
|
-
/**
|
|
575
|
-
* Options for configuring the highlight. Use the highlight method on the
|
|
576
|
-
* appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature.
|
|
577
|
-
*
|
|
578
|
-
* @deprecated since version 4.32. Use the [highlights](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#highlights) property instead.
|
|
579
|
-
* @see [Sample: Highlight SceneLayer](https://developers.arcgis.com/javascript/latest/sample-code/highlight-scenelayer/)
|
|
580
|
-
* @example
|
|
581
|
-
* const view = new MapView({
|
|
582
|
-
* map: map,
|
|
583
|
-
* highlightOptions: {
|
|
584
|
-
* color: [255, 255, 0, 1],
|
|
585
|
-
* haloOpacity: 0.9,
|
|
586
|
-
* fillOpacity: 0.2
|
|
587
|
-
* }
|
|
588
|
-
* });
|
|
589
|
-
*/
|
|
590
|
-
get highlightOptions(): HighlightOptions;
|
|
591
|
-
set highlightOptions(value: HighlightOptionsProperties);
|
|
592
555
|
/**
|
|
593
556
|
* Defines which anchor stays still while resizing the browser window. The default, `center`, ensures the view's center point remains constantly visible as the window size changes. The other
|
|
594
557
|
* options allow the respective portion of the view to remain visible when the window's size is changed.
|
package/views/View2D.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as p,cast as h,subclass as g}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import{initialize as u}from"../core/workers/workers.js";import c from"../geometry/Point.js";import m from"../geometry/Polygon.js";import{isLoadedOrLoadFor as y}from"../geometry/projectionUtils.js";import w from"../layers/support/TileInfo.js";import{BreakpointsOwner as f}from"./BreakpointsOwner.js";import{DOMContainer as V}from"./DOMContainer.js";import{PopupView as M}from"./PopupView.js";import v from"./View.js";import{Viewport2DBaseMixin as b}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as _}from"./Viewport2DMixin.js";import j from"./2d/AnimationManager.js";import{layerView2DImporter as R}from"./2d/layerViewModuleImportUtils.js";import S from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as L}from"./2d/viewpointUtils.js";import{importAnalysisViewModule as O}from"./2d/analysis/analysisViewModuleImportUtils.js";import{ManagedCanvas as T}from"./2d/engine/ManagedCanvas.js";import k from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as C}from"./2d/layers/support/util.js";import{clipContainsPoint as x}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as D,setDefaultHighlightOptions as P}from"./2d/support/highlightOptionsUtils.js";import{hitTest as A}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as E,takeScreenshot as z}from"./2d/support/screenshotUtils.js";import{Timeline as U}from"./2d/support/Timeline.js";import G from"./navigation/Navigation.js";import I from"./navigation/NavigationActionMap.js";import N from"./support/AnalysisViewManager.js";import q from"./support/HighlightOptions.js";import $ from"./ui/DefaultUI.js";import W from"./ui/2d/DefaultUI2D.js";import{RenderingContextOptions as F}from"./webgl/RenderingContextOptions.js";import{isWebMap as B}from"../webmap/utils.js";import H from"../webmap/background/ColorBackground.js";let Z,J,K,Q,X,Y,ee;async function te(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);J=e,K=t,Q=i,X=r,Y=s,ee=a,Z=n}let ie=class extends(_(b(f(M(V(v)))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new G({actionMap:new I({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analysisViewManager=new N({importAnalysisViewModule:e=>O(e),view:this}),this.floors=new i,this.grid=null,this.map=null,this.timeline=new U,this.type="2d",this.view2dType=null,this.ui=new W,this.test={takeScreenshot:async e=>E(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},u()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new k(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return y(t.spatialReference,i)}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get background(){return B(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get highlightOptions(){return D(this)}set highlightOptions(e){P(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get("spatialReferenceLocked")}set spatialReferenceLocked(e){this.stage&&a.getLogger(this).warn("spatialReferenceLocked cannot be changed after the view has become ready"),this._set("spatialReferenceLocked",e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.analysisViewManager.updating||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some(e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating}),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){const e=this.stateManager.visibleArea;return e?new m({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return A(this,e,t)}async takeScreenshot(e){return z(this._getScreenshotView(e),e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(null==e.parent)throw new s("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return B(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return B(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return R.hasLayerViewModule(e)}importLayerView(e){return R.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter(i=>i.clips.every(i=>x(this,i,e,t))).reverse(),s=new globalThis.Map(r.map(e=>[e.layer.uid,e])),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return te()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&L(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new T(this.surface),i=new Z(this.surface,{canvas:this.renderCanvas,contextOptions:new F(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),renderingOptions:this.renderingOptions,timeline:this.timeline},t);this.stage=i,this._magnifierView=new Y,this._magnifierView.magnifier=this.magnifier,this._gridView=new ee;const r=new Q({view:this});this._set("labelManager",r);const s=new j({view:this});this._set("animationManager",s);const a=new X({view:this,animationManager:s});this._set("mapViewNavigation",a),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),i.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>i.stationary=e,l),o(()=>this.background,e=>{i.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>i.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{i.highlightGradient=C(i.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>i.state=this.state,l),o(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,l)],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new S(w.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new J({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new K(e,!0)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([p({constructOnly:!0})],ie.prototype,"deactivatedWebGLExtensions",void 0),e([p({constructOnly:!0})],ie.prototype,"debugWebGLExtensions",void 0),e([p({readOnly:!0})],ie.prototype,"featuresTilingScheme",void 0),e([p({readOnly:!0})],ie.prototype,"graphicsTileStore",null),e([p()],ie.prototype,"graphicsView",void 0),e([p()],ie.prototype,"constraintsInfo",null),e([p()],ie.prototype,"initialExtentRequired",null),e([p()],ie.prototype,"labelManager",void 0),e([p({type:G,nonNullable:!0})],ie.prototype,"navigation",void 0),e([p({constructOnly:!0})],ie.prototype,"renderCanvas",void 0),e([p()],ie.prototype,"renderingOptions",void 0),e([p({constructOnly:!0})],ie.prototype,"supersampleScreenshotsEnabled",void 0),e([p()],ie.prototype,"defaultsFromMapSettings",null),e([p({readOnly:!0})],ie.prototype,"typeSpecificPreconditionsReady",null),e([p()],ie.prototype,"analysisViewManager",void 0),e([p({type:H})],ie.prototype,"background",null),e([p({type:c})],ie.prototype,"center",null),e([p({type:i})],ie.prototype,"floors",void 0),e([p()],ie.prototype,"grid",void 0),e([p({type:q})],ie.prototype,"highlightOptions",null),e([p()],ie.prototype,"map",void 0),e([p()],ie.prototype,"padding",null),e([p({readOnly:!0})],ie.prototype,"rendering",null),e([p({readOnly:!0})],ie.prototype,"resolution",null),e([p()],ie.prototype,"scale",null),e([p({type:Boolean,value:!1})],ie.prototype,"spatialReferenceLocked",null),e([p({readOnly:!0})],ie.prototype,"tileInfo",null),e([p({type:U,readOnly:!0})],ie.prototype,"timeline",void 0),e([p({readOnly:!0})],ie.prototype,"type",void 0),e([p({readOnly:!0})],ie.prototype,"updating",null),e([p({readOnly:!0})],ie.prototype,"view2dType",void 0),e([p({readOnly:!0})],ie.prototype,"visibleArea",null),e([p()],ie.prototype,"zoom",null),e([p({readOnly:!0})],ie.prototype,"navigating",null),e([p(),h(e=>e instanceof $?e:d(W,e))],ie.prototype,"ui",void 0),ie=e([g("esri.views.View2D")],ie);const re=ie;export{re as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as p,cast as h,subclass as g}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import{initialize as u}from"../core/workers/workers.js";import c from"../geometry/Point.js";import m from"../geometry/Polygon.js";import{isLoadedOrLoadFor as y}from"../geometry/projectionUtils.js";import w from"../layers/support/TileInfo.js";import{BreakpointsOwner as f}from"./BreakpointsOwner.js";import{DOMContainer as V}from"./DOMContainer.js";import{PopupView as M}from"./PopupView.js";import v from"./View.js";import{Viewport2DBaseMixin as b}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as _}from"./Viewport2DMixin.js";import R from"./2d/AnimationManager.js";import{layerView2DImporter as j}from"./2d/layerViewModuleImportUtils.js";import S from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as L}from"./2d/viewpointUtils.js";import{importAnalysisViewModule as T}from"./2d/analysis/analysisViewModuleImportUtils.js";import{ManagedCanvas as O}from"./2d/engine/ManagedCanvas.js";import k from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as C}from"./2d/layers/support/util.js";import{clipContainsPoint as x}from"./2d/support/clippingUtils.js";import{hitTest as D}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as P,takeScreenshot as A}from"./2d/support/screenshotUtils.js";import{Timeline as E}from"./2d/support/Timeline.js";import z from"./navigation/Navigation.js";import U from"./navigation/NavigationActionMap.js";import G from"./support/AnalysisViewManager.js";import I from"./ui/DefaultUI.js";import N from"./ui/2d/DefaultUI2D.js";import{RenderingContextOptions as q}from"./webgl/RenderingContextOptions.js";import{isWebMap as $}from"../webmap/utils.js";import W from"../webmap/background/ColorBackground.js";let F,B,Z,H,J,K,Q;async function X(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);B=e,Z=t,H=i,J=r,K=s,Q=a,F=n}let Y=class extends(_(b(f(M(V(v)))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new z({actionMap:new U({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analysisViewManager=new G({importAnalysisViewModule:e=>T(e),view:this}),this.floors=new i,this.grid=null,this.map=null,this.timeline=new E,this.type="2d",this.view2dType=null,this.ui=new N,this.test={takeScreenshot:async e=>P(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},u()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new k(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return y(t.spatialReference,i)}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get background(){return $(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get("spatialReferenceLocked")}set spatialReferenceLocked(e){this.stage&&a.getLogger(this).warn("spatialReferenceLocked cannot be changed after the view has become ready"),this._set("spatialReferenceLocked",e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.analysisViewManager.updating||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some(e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating}),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){const e=this.stateManager.visibleArea;return e?new m({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return D(this,e,t)}async takeScreenshot(e){return A(this._getScreenshotView(e),e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(null==e.parent)throw new s("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return $(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return $(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return j.hasLayerViewModule(e)}importLayerView(e){return j.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter(i=>i.clips.every(i=>x(this,i,e,t))).reverse(),s=new globalThis.Map(r.map(e=>[e.layer.uid,e])),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return X()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&L(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new O(this.surface),i=new F(this.surface,{canvas:this.renderCanvas,contextOptions:new q(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),renderingOptions:this.renderingOptions,timeline:this.timeline},t);this.stage=i,this._magnifierView=new K,this._magnifierView.magnifier=this.magnifier,this._gridView=new Q;const r=new H({view:this});this._set("labelManager",r);const s=new R({view:this});this._set("animationManager",s);const a=new J({view:this,animationManager:s});this._set("mapViewNavigation",a),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),i.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>i.stationary=e,l),o(()=>this.background,e=>{i.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>i.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{i.highlightGradient=C(i.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>i.state=this.state,l),o(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,l)],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new S(w.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new B({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Z(e,!0)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([p({constructOnly:!0})],Y.prototype,"deactivatedWebGLExtensions",void 0),e([p({constructOnly:!0})],Y.prototype,"debugWebGLExtensions",void 0),e([p({readOnly:!0})],Y.prototype,"featuresTilingScheme",void 0),e([p({readOnly:!0})],Y.prototype,"graphicsTileStore",null),e([p()],Y.prototype,"graphicsView",void 0),e([p()],Y.prototype,"constraintsInfo",null),e([p()],Y.prototype,"initialExtentRequired",null),e([p()],Y.prototype,"labelManager",void 0),e([p({type:z,nonNullable:!0})],Y.prototype,"navigation",void 0),e([p({constructOnly:!0})],Y.prototype,"renderCanvas",void 0),e([p()],Y.prototype,"renderingOptions",void 0),e([p({constructOnly:!0})],Y.prototype,"supersampleScreenshotsEnabled",void 0),e([p()],Y.prototype,"defaultsFromMapSettings",null),e([p({readOnly:!0})],Y.prototype,"typeSpecificPreconditionsReady",null),e([p()],Y.prototype,"analysisViewManager",void 0),e([p({type:W})],Y.prototype,"background",null),e([p({type:c})],Y.prototype,"center",null),e([p({type:i})],Y.prototype,"floors",void 0),e([p()],Y.prototype,"grid",void 0),e([p()],Y.prototype,"map",void 0),e([p()],Y.prototype,"padding",null),e([p({readOnly:!0})],Y.prototype,"rendering",null),e([p({readOnly:!0})],Y.prototype,"resolution",null),e([p()],Y.prototype,"scale",null),e([p({type:Boolean,value:!1})],Y.prototype,"spatialReferenceLocked",null),e([p({readOnly:!0})],Y.prototype,"tileInfo",null),e([p({type:E,readOnly:!0})],Y.prototype,"timeline",void 0),e([p({readOnly:!0})],Y.prototype,"type",void 0),e([p({readOnly:!0})],Y.prototype,"updating",null),e([p({readOnly:!0})],Y.prototype,"view2dType",void 0),e([p({readOnly:!0})],Y.prototype,"visibleArea",null),e([p()],Y.prototype,"zoom",null),e([p({readOnly:!0})],Y.prototype,"navigating",null),e([p(),h(e=>e instanceof I?e:d(N,e))],Y.prototype,"ui",void 0),Y=e([g("esri.views.View2D")],Y);const ee=Y;export{ee as default};
|
package/views/ViewAnimation.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type Viewpoint from "../Viewpoint.js";
|
|
2
2
|
import type { EsriPromise, EsriPromiseMixinProperties } from "../core/Promise.js";
|
|
3
|
+
import type { ViewAnimationStateType } from "./animation/types.js";
|
|
3
4
|
|
|
4
5
|
export interface ViewAnimationProperties extends EsriPromiseMixinProperties, Partial<Pick<ViewAnimation, "target">> {}
|
|
5
6
|
|
|
@@ -69,6 +70,4 @@ export default class ViewAnimation extends EsriPromise {
|
|
|
69
70
|
* the animation to `stopped`.
|
|
70
71
|
*/
|
|
71
72
|
stop(): void;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export type ViewAnimationStateType = "running" | "finished" | "stopped" | "waiting-for-target";
|
|
73
|
+
}
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import type Graphic from "../../../Graphic.js";
|
|
8
8
|
import type { LengthUnit } from "../../../core/units.js";
|
|
9
9
|
|
|
10
|
+
/** Represents a single sampled point along the generated elevation profile. */
|
|
10
11
|
export interface ElevationProfileSample {
|
|
11
12
|
/**
|
|
12
|
-
* Horizontal (2D) distance from the beginning of the path, in the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* WebMercator, the distance is computed in a Euclidean manner (in the respective PCS).
|
|
13
|
+
* Horizontal (2D) distance from the beginning of the path, expressed in the effective units selected for the
|
|
14
|
+
* analysis. In geographic coordinate systems (GCS) and WebMercator, the value is the geodesic distance. In projected
|
|
15
|
+
* coordinate systems (PCS) other than WebMercator, the value is calculated using Euclidean distance in the PCS.
|
|
16
16
|
*/
|
|
17
17
|
readonly distance: number;
|
|
18
18
|
/** The elevation of the sample, in the effective units selected by the user. */
|
|
@@ -25,6 +25,7 @@ export interface ElevationProfileSample {
|
|
|
25
25
|
readonly z?: number | null;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/** Combined statistics of all the computed elevation profile lines. */
|
|
28
29
|
export interface ElevationProfileStatistics {
|
|
29
30
|
/** The average elevation along the path. */
|
|
30
31
|
readonly avgElevation?: number | null;
|
|
@@ -85,8 +86,8 @@ export interface ElevationProfilePickResult {
|
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
/**
|
|
88
|
-
* Effective units for the elevation profile analysis, determined
|
|
89
|
-
*
|
|
89
|
+
* Effective units for the elevation profile analysis, determined from the magnitudes of all computed values and the
|
|
90
|
+
* display preferences selected by the user.
|
|
90
91
|
*/
|
|
91
92
|
export interface ElevationProfileEffectiveDisplayUnits {
|
|
92
93
|
/** The effective distance unit used for the results and statistics of the elevation profile analysis. */
|
|
@@ -12,4 +12,5 @@ import type { AnalysisView3DUnion } from "../3d/analysis/types.js";
|
|
|
12
12
|
*/
|
|
13
13
|
export type AnalysisViewUnion = AnalysisView2DUnion | AnalysisView3DUnion;
|
|
14
14
|
|
|
15
|
+
/** Describes how measurements are computed for analysis tools. */
|
|
15
16
|
export type MeasurementMode = "euclidean" | "geodesic";
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
/** @deprecated */
|
|
3
3
|
export type DeprecatedEasingName = "in-cubic" | "out-cubic" | "in-out-cubic" | "in-expo" | "out-expo" | "in-out-expo" | "in-out-coast-quad";
|
|
4
4
|
|
|
5
|
-
export type EasingName = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "cubic-in" | "cubic-out" | "cubic-in-out" | "expo-in" | "expo-out" | "expo-in-out" | "quad-in-out-coast" | DeprecatedEasingName;
|
|
5
|
+
export type EasingName = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "cubic-in" | "cubic-out" | "cubic-in-out" | "expo-in" | "expo-out" | "expo-in-out" | "quad-in-out-coast" | DeprecatedEasingName;
|
|
6
|
+
|
|
7
|
+
export type ViewAnimationStateType = "running" | "finished" | "stopped" | "waiting-for-target";
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import type LengthDimension from "../../analysis/LengthDimension.js";
|
|
2
|
+
import type DimensionLayer from "../../layers/DimensionLayer.js";
|
|
3
|
+
import type LengthDimensionResult from "../analysis/LengthDimensionResult.js";
|
|
1
4
|
import type LayerView from "./LayerView.js";
|
|
5
|
+
import type { ReadonlyCollection } from "../../core/Collection.js";
|
|
6
|
+
import type { AbortOptions } from "../../core/promiseUtils.js";
|
|
7
|
+
import type { DimensionPlacementResult } from "../3d/analysis/Dimension/types.js";
|
|
2
8
|
import type { LayerViewProperties } from "./LayerView.js";
|
|
3
9
|
|
|
4
|
-
export interface DimensionLayerViewProperties extends LayerViewProperties {}
|
|
10
|
+
export interface DimensionLayerViewProperties extends LayerViewProperties, Partial<Pick<DimensionLayerView, "interactive" | "selectedDimension">> {}
|
|
5
11
|
|
|
6
12
|
/**
|
|
7
13
|
* Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [DimensionLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DimensionLayer.html)
|
|
@@ -10,8 +16,8 @@ export interface DimensionLayerViewProperties extends LayerViewProperties {}
|
|
|
10
16
|
* The dimension layer view controls whether the dimensions in its associated
|
|
11
17
|
* [DimensionLayer#source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DimensionLayer.html#source) can be created or edited interactively.
|
|
12
18
|
*
|
|
13
|
-
* It allows to create new dimensions interactively using the
|
|
14
|
-
* or to make existing dimensions selectable and editable by enabling the
|
|
19
|
+
* It allows to create new dimensions interactively using the [place()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#place) method, query measured [results](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#results),
|
|
20
|
+
* or to make existing dimensions selectable and editable by enabling the [interactive](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#interactive) property.
|
|
15
21
|
* To select a dimension, hover and click on its offset manipulator.
|
|
16
22
|
*
|
|
17
23
|
* The view for the layer can be retrieved using [SceneView#whenLayerView()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#whenLayerView).
|
|
@@ -41,4 +47,91 @@ export interface DimensionLayerViewProperties extends LayerViewProperties {}
|
|
|
41
47
|
* @see [DimensionAnalysisView3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-DimensionAnalysisView3D.html)
|
|
42
48
|
* @see [Sample - Length dimensioning](https://developers.arcgis.com/javascript/latest/sample-code/layers-dimension/)
|
|
43
49
|
*/
|
|
44
|
-
export default abstract class DimensionLayerView extends LayerView {
|
|
50
|
+
export default abstract class DimensionLayerView extends LayerView {
|
|
51
|
+
/**
|
|
52
|
+
* Enables interactivity for the [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#layer). When set to `true` and the layer's
|
|
53
|
+
* [DimensionLayer#source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DimensionLayer.html#source) includes any
|
|
54
|
+
* valid [DimensionAnalysis#dimensions](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-DimensionAnalysis.html#dimensions), they become selectable and editable.
|
|
55
|
+
*
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
accessor interactive: boolean;
|
|
59
|
+
/** The layer being viewed. */
|
|
60
|
+
get layer(): DimensionLayer;
|
|
61
|
+
/**
|
|
62
|
+
* Results for each dimension in the layer [DimensionLayer#source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DimensionLayer.html#source).
|
|
63
|
+
*
|
|
64
|
+
* Given a [dimension](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-LengthDimension.html) object, the results collection can be searched:
|
|
65
|
+
*
|
|
66
|
+
* ```js
|
|
67
|
+
* const result = dimensionLayerView.results.find((result) => result.dimension === dimensionObject);
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
get results(): ReadonlyCollection<LengthDimensionResult>;
|
|
71
|
+
/**
|
|
72
|
+
* The selected dimension. If [interactive](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#interactive) is `true`, any dimension in the
|
|
73
|
+
* [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#layer) can be selected by clicking on it in the view. As long as [interactive](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#interactive)
|
|
74
|
+
* remains `true`, the properties of the selected dimension can be edited by interacting with
|
|
75
|
+
* manipulators in the view.
|
|
76
|
+
*/
|
|
77
|
+
accessor selectedDimension: LengthDimension | null | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Starts the interactive creation of new dimensions and adds them to the [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#layer)'s
|
|
80
|
+
* [DimensionLayer#source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DimensionLayer.html#source).
|
|
81
|
+
*
|
|
82
|
+
* The creation process will finish when the user double-clicks the mouse or presses the escape key.
|
|
83
|
+
* To stop the creation programmatically, pass an abort signal as an argument when calling the method.
|
|
84
|
+
*
|
|
85
|
+
* This method is similar to the [place()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#place) method, but it allows to create multiple dimensions in a row.
|
|
86
|
+
*
|
|
87
|
+
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#interactive) to `true`.
|
|
88
|
+
*
|
|
89
|
+
* @param options - An object specifying additional options.
|
|
90
|
+
* @returns A promise which resolves when creation is completed successfully or rejected if it is
|
|
91
|
+
* canceled.
|
|
92
|
+
* @example
|
|
93
|
+
* const abortController = new AbortController();
|
|
94
|
+
*
|
|
95
|
+
* try {
|
|
96
|
+
* await layerView.createLengthDimensions({ signal: abortController.signal });
|
|
97
|
+
* } catch (error) {
|
|
98
|
+
* if (error.name === "AbortError") {
|
|
99
|
+
* console.log("Creation operation was cancelled.");
|
|
100
|
+
* }
|
|
101
|
+
* }
|
|
102
|
+
*
|
|
103
|
+
* // cancel the placement operation at some later point
|
|
104
|
+
* abortController.abort();
|
|
105
|
+
*/
|
|
106
|
+
createLengthDimensions(options?: AbortOptions | null | undefined): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Starts the interactive placement of a single dimension, adding it to the [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#layer)'s
|
|
109
|
+
* [DimensionLayer#source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DimensionLayer.html#source).
|
|
110
|
+
*
|
|
111
|
+
* The first click places start point and the second sets end point.
|
|
112
|
+
*
|
|
113
|
+
* The placement operation will finish when the user presses the escape key.
|
|
114
|
+
* To stop the placing programmatically, pass an abort signal as an argument when calling the method.
|
|
115
|
+
*
|
|
116
|
+
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#interactive) to `true`.
|
|
117
|
+
*
|
|
118
|
+
* @param options - An object specifying additional options.
|
|
119
|
+
* @returns A promise which
|
|
120
|
+
* resolves when the operation is completed successfully or rejected if it is canceled.
|
|
121
|
+
* @since 4.33
|
|
122
|
+
* @example
|
|
123
|
+
* const abortController = new AbortController();
|
|
124
|
+
*
|
|
125
|
+
* try {
|
|
126
|
+
* await layerView.place({ signal: abortController.signal });
|
|
127
|
+
* } catch (error) {
|
|
128
|
+
* if (error.name === "AbortError") {
|
|
129
|
+
* console.log("Placement operation was cancelled.");
|
|
130
|
+
* }
|
|
131
|
+
* }
|
|
132
|
+
*
|
|
133
|
+
* // cancel the placement operation at some later point
|
|
134
|
+
* abortController.abort();
|
|
135
|
+
*/
|
|
136
|
+
place(options?: AbortOptions | null | undefined): Promise<DimensionPlacementResult>;
|
|
137
|
+
}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{__decorate as e}from"tslib";import s from"../../core/Collection.js";import{createAbortError as i}from"../../core/promiseUtils.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import r from"./LayerView.js";class n extends r{constructor(){super(...arguments),this.layer=null}get interactive(){return this.analysisView?.interactive??!1}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new s}get selectedDimension(){return this.analysisView?.selectedDimension}set selectedDimension(e){null!=this.analysisView&&(this.analysisView.selectedDimension=e)}async createLengthDimensions(e){await(this.analysisView?.createLengthDimensions(e))}place(e){if(null!=this.analysisView)return this.analysisView.place(e);throw i()}}e([t()],n.prototype,"layer",void 0),e([t()],n.prototype,"interactive",null),e([t({readOnly:!0})],n.prototype,"results",null),e([t()],n.prototype,"selectedDimension",null);export{n as default};
|