@arcgis/core 4.24.0-next.20220607 → 4.24.0-next.20220610
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/Analysis.js +1 -1
- package/analysis/LineOfSightAnalysis.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade.d.ts +4 -0
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{4d2181bde97983ecac8b.js → 03ddf44e6fb8bf9db3ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e2d7f5952934af43fd7.js → 04034dabc8e0a489b0f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7168ff8f26ca2537080.js → 0747c28fce0b344dc89b.js} +1 -1
- package/assets/esri/core/workers/chunks/1e4e5d147263e98536bc.js +1 -0
- package/assets/esri/core/workers/chunks/{cbe98327181d8d7ad9e5.js → 262fabdc409d55831ffa.js} +1 -1
- package/assets/esri/core/workers/chunks/2a52c2c6edd70432f4a5.js +1 -0
- package/assets/esri/core/workers/chunks/{71d445d1e6812e03a1d7.js → 3ce7adaefc9de28d9c87.js} +1 -1
- package/assets/esri/core/workers/chunks/{c165845a117c21246b1e.js → 42aa8ce4eb7bd851475e.js} +1 -1
- package/assets/esri/core/workers/chunks/{a9a4bb1d781b1a995fb3.js → 4824926501e11d04eb4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{e51420d231c286b9c062.js → 540f1ed1ea9cddc739af.js} +1 -1
- package/assets/esri/core/workers/chunks/6196cfdeb91ceba52af3.js +1 -0
- package/assets/esri/core/workers/chunks/71a4618d959a09302c51.js +1 -0
- package/assets/esri/core/workers/chunks/76fbc8eaabba62fd4f9c.js +1 -0
- package/assets/esri/core/workers/chunks/{cb906a3f03dd0805c880.js → 7cc17b716b16a6684023.js} +1 -1
- package/assets/esri/core/workers/chunks/871681c1353026cb6d4b.js +1 -0
- package/assets/esri/core/workers/chunks/{13e9e6f0b4942d79b0eb.js → 88942e9f60687ac006dc.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c5b80ba3dbfe6f6cafb.js → acb1e649cda99d4f69a5.js} +1 -1
- package/assets/esri/core/workers/chunks/b71a0a8a2f446c671161.js +1 -0
- package/assets/esri/core/workers/chunks/b8002aaa665712299121.js +1 -0
- package/assets/esri/core/workers/chunks/{e4ca3f04ca7f71b46240.js → bb3480e231934b7bb34e.js} +1 -1
- package/assets/esri/core/workers/chunks/{185da42e7cc8e440c0f0.js → c157b46b0724f3f0947e.js} +1 -1
- package/assets/esri/core/workers/chunks/{1aba8c73c62a64e0658c.js → c6af8b0903d8d934d542.js} +1 -1
- package/assets/esri/core/workers/chunks/c8402e32307a7b7eaaeb.js +1 -0
- package/assets/esri/core/workers/chunks/c8e08a956b16034d9819.js +1 -0
- package/assets/esri/core/workers/chunks/d0d2566bedc493ed0a3b.js +1 -0
- package/assets/esri/core/workers/chunks/{8152cd26ebeae910b753.js → d3c73da9c2abb59e762a.js} +1 -1
- package/assets/esri/core/workers/chunks/d828a0656e7351a74fc4.js +1 -0
- package/assets/esri/core/workers/chunks/{172368d4eb6e6f8d2bdb.js → d8b9551df1bd196d0126.js} +1 -1
- package/assets/esri/core/workers/chunks/e5c8584ae764892c324d.js +1 -0
- package/assets/esri/core/workers/chunks/{1d893ebc6f203ff1fc3d.js → efe605ff4ba2a95c14c5.js} +1 -1
- package/assets/esri/core/workers/chunks/f54d5abbb9668c45bd19.js +1 -0
- package/assets/esri/core/workers/chunks/{bd2f4a01cb71e25837ba.js → f7ba74fc4eb541c424fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{1ebed6d6f561f926bd36.js → faf6e48f9f1205fb2e43.js} +1 -1
- package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BasemapToggle.scss +6 -23
- package/assets/esri/themes/base/widgets/_Directions.scss +0 -3
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +10 -2
- package/assets/esri/themes/base/widgets/_Slider.scss +8 -3
- package/assets/esri/themes/base/widgets/_Tooltip.scss +8 -8
- package/assets/esri/themes/base/widgets/_Weather.scss +5 -1
- 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/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ar.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_bg.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_bs.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ca.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_cs.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_da.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_de.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_el.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_en.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_es.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_et.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_fi.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_fr.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_he.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_hr.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_hu.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_id.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_it.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ja.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ko.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_lt.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_lv.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_nb.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_nl.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pl.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pt-BR.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pt-PT.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ro.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ru.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sk.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sl.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sr.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sv.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_th.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_tr.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_uk.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_vi.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-CN.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-HK.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-TW.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_en.json +1 -1
- package/chunks/RasterColorizer.glsl.js +22 -18
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/i3s.js +1 -1
- package/chunks/lclayout.js +1 -1
- package/chunks/lerc-wasm.js +1 -1
- package/chunks/libtess-asm.js +1 -1
- package/chunks/libtess.js +1 -1
- package/chunks/pe-wasm.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/quantityUtils.js +1 -1
- package/geometry/projection.js +1 -1
- package/geometry/support/geodesicUtils.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +471 -52
- package/layers/LineOfSightLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/RasterInfo.js +1 -1
- package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
- package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/layers/support/rasterFormats/JpgPlus.js +1 -1
- package/layers/support/rasterFormats/RasterCodec.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/package.json +1 -1
- package/portal/support/urlUtils.js +5 -0
- package/renderers/support/colorRampUtils.js +1 -1
- package/rest/imageService/fetchRasterInfo.js +1 -1
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/elevationInfoUtils.js +1 -1
- package/support/persistableUrlUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/webgl/Utils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/graphics/GraphicStoreItem.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionComputation.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/BlendOptions.js +1 -1
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/tooltip/TranslateTooltipInfos.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/views/interactive/tooltip/support/measurements.js +1 -1
- package/views/support/areaMeasurementUtils.js +1 -1
- package/views/support/automaticLengthMeasurementUtils.js +5 -0
- package/views/support/euclideanLengthMeasurementUtils.js +5 -0
- package/views/support/geodesicLengthMeasurementUtils.js +5 -0
- package/views/support/measurementUtils.js +5 -0
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/AnalysisViewModel.js +1 -1
- package/widgets/support/AnchorElementViewModel.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/2ac6c99aacb873134f7c.js +0 -1
- package/assets/esri/core/workers/chunks/471beeb6924599209567.js +0 -1
- package/assets/esri/core/workers/chunks/5242c9badca17ba2ab25.js +0 -1
- package/assets/esri/core/workers/chunks/72c7d48408d1f8050026.js +0 -1
- package/assets/esri/core/workers/chunks/770cf0a66102100abe74.js +0 -1
- package/assets/esri/core/workers/chunks/96ff15d6c2bfca0c6061.js +0 -1
- package/assets/esri/core/workers/chunks/9c4c721d890b49697132.js +0 -1
- package/assets/esri/core/workers/chunks/af3766a2d27419c7766c.js +0 -1
- package/assets/esri/core/workers/chunks/b50bbfd75768d9a8de88.js +0 -1
- package/assets/esri/core/workers/chunks/b577ec80647cf2ece397.js +0 -1
- package/assets/esri/core/workers/chunks/c1653b6cb201ecbaabaa.js +0 -1
- package/assets/esri/core/workers/chunks/e99b58d07475bffce7ea.js +0 -1
- package/assets/esri/core/workers/chunks/f3d885aec4bca18928d4.js +0 -1
- package/assets/esri/core/workers/chunks/fc0da1dfeef041182ddf.js +0 -1
- package/views/support/lengthMeasurementUtils.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/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.js";import i from"../Graphic.js";import r from"../Viewpoint.js";import s from"../core/Collection.js";import{byId as n}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{handlesGroup as l,makeHandle as p}from"../core/handleUtils.js";import h from"../core/has.js";import{isIterable as d}from"../core/iteratorUtils.js";import c from"../core/Logger.js";import{destroyMaybe as u,isNone as g,isSome as m,unwrapOr as f}from"../core/maybe.js";import{ObservableChangesType as y}from"../core/ObservableChangesType.js";import{throwIfAborted as w}from"../core/promiseUtils.js";import{on as v,watch as _,initial as b,syncAndInitial as S,whenOnce as M,sync as R}from"../core/reactiveUtils.js";import{setFrameDuration as V}from"../core/scheduling.js";import{screenPointObjectToArray as T,createScreenPoint as C,createScreenPointArray as x}from"../core/screenUtils.js";import{initialize as O}from"../core/workers/workers.js";import{property as E}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import{subclass as P}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as I}from"../core/accessorSupport/ensureType.js";import{c as L}from"../chunks/vec3f64.js";import{owningCollectionProperty as G}from"../core/support/OwningCollection.js";import H from"../geometry/HeightModelInfo.js";import{canProjectWithoutEngine as U,project as A,projectPointToVector as D,projectVectorToVector as W,projectBoundingRect as F}from"../geometry/projection.js";import{create as k,toExtent as q}from"../geometry/support/aaBoundingRect.js";import{B as z,a as B}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as N}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Q}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as $,isTiledLayer as X,isVoxelLayer as Y}from"../layers/support/layerUtils.js";import{AnalysesCollection as Z}from"../support/AnalysesCollection.js";import{BreakpointsOwner as J}from"./BreakpointsOwner.js";import{DOMContainer as K}from"./DOMContainer.js";import ee from"./GroundView.js";import{PopupView as te}from"./PopupView.js";import ie from"./View.js";import re from"./ViewAnimation.js";import{ViewingMode as se,stringFromViewingMode as ne,viewingModeFromString as ae}from"./ViewingMode.js";import{layerView3DImporter as oe}from"./3d/layerViewModuleImportUtils.js";import le from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as pe}from"./3d/constraints/Constraints.js";import he from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as de}from"./3d/environment/SceneViewEnvironmentManager.js";import ce from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as ue}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ge}from"./3d/layers/graphics/Labeler.js";import{ObjectResourceCache as me}from"./3d/layers/graphics/ObjectResourceCache.js";import{FeatureTileTree3D as fe}from"./3d/layers/support/FeatureTileTree3D.js";import ye from"./3d/state/ViewState.js";import we from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ve}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as _e}from"./3d/support/CombinedElevationProvider.js";import be from"./3d/support/debugFlags.js";import Se from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Me}from"./3d/support/ElevationProvider.js";import Re from"./3d/support/HighlightOptions.js";import{MapCoordsHelper as Ve}from"./3d/support/MapCoordsHelper.js";import{PropertiesPool as Te}from"./3d/support/PropertiesPool.js";import Ce from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as xe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Oe}from"./3d/support/ResourceController.js";import Ee from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as je}from"./3d/support/SharedSymbolResources.js";import{PointsOfInterest as Pe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ie from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Le,getTiledLayerInfo as Ge,checkIfTileInfoSupportedForView as He}from"./3d/terrain/terrainUtils.js";import{Stage as Ue}from"./3d/webgl-engine/Stage.js";import{newIntersector as Ae,DEFAULT_TOLERANCE as De}from"./3d/webgl-engine/lib/Intersector.js";import{StoreResults as We,IntersectorType as Fe}from"./3d/webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as ke}from"./3d/webgl-engine/lib/intersectorUtils.js";import{toHit as qe,toOwner as ze}from"./3d/webgl-engine/lib/intersectorUtilsConversions.js";import{TERRAIN_ID as Be}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{hitTestSelectSimilarDistance as Ne}from"./support/hitTestSelectUtils.js";import{occludeesSupported as Qe}from"./support/layerViewUtils.js";import{encode as $e,encodeData as Xe,toRenderSettings as Ye,screenshotSuperSampleSettings as Ze}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as Je,createScreenPointFromSupportedEvent as Ke}from"./support/screenUtils.js";import{isSpatialReferenceSupported as et}from"./support/spatialReferenceSupport.js";import{check as tt}from"./support/WebGLRequirements.js";import it from"./ui/3d/DefaultUI3D.js";import rt from"../webscene/Environment.js";import st from"../geometry/Extent.js";import nt from"../geometry/SpatialReference.js";import at from"../geometry/Point.js";const ot=c.getLogger("esri.views.SceneView");let lt=class extends(J(K(te(ie)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this.propertiesPool=new Te({slicePlane:z},this),this._resourceController=Oe(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new ue({view:this}),this.labeler=new ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new Z,this.basemapTerrain=null,this.elevationProvider=null,this.camera=null,this.canvas=null,this.center=null,this.constraints=new pe,this.environmentManager=new de,this.extent=null,this.floors=new s,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new le({view:this}),this.groundView=null,this.navigating=!1,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ye,this.scale=null,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new it,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.viewpoint=null,this.zoom=null,this.highlightOptions=new Re,this.voxelWasm=null,this.voxelWasmPromise=null,O(),e&&e.environment||(this._defaults.environment=new he,this.environment=this._defaults.environment);const t=(e=null)=>{m(e)&&e.type===y.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.handles.add([v((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),_((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new ce({view:this}),this.stateManager=new we({view:this})}initialize(){this.groundView=new ee({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.handles.add(v((()=>this.map?.allLayers),"after-changes",e,{onListenerAdd:e,onListenerRemove:e})),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),b),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),b),this.updatingHandles.add((()=>this.qualitySettings.frameRate),(e=>V(e>0?1e3/Math.ceil(e):0)),b),this.updatingHandles.add((()=>this.map?.ground),e,S),this.updatingHandles.add((()=>this.map?.ground?.opacity),(()=>this._updateDefaultHitTestOptions()),S),this.handles.add(_((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),R))}destroy(){this.destroyed||(this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this.labeler.destroy(),this._set("labeler",null),this.deconflictor.destroy(),this._set("deconflictor",null),this._resourceController=u(this._resourceController),this.stateManager.destroy(),this._set("stateManager",null),this.inputManager.destroy(),this._set("inputManager",null),this.propertiesPool.destroy(),this.handles.remove("updatingMonitors"),this.environmentManager.destroy(),this._set("environmentManager",null),this.groundView=u(this.groundView))}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get clippingArea(){if("global"===this.viewingMode)return null;let e=this._userClippingArea||this.get("map.clippingArea");return!(!!this._userClippingArea||this.get("map.clippingEnabled"))||g(e)?(this._clippingArea=null,null):e instanceof st?this.spatialReference&&(e=dt(e,this.spatialReference),g(e))?(ot.error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(e=e.clone(),g(e.intersection(this.groundAndLayersExtent))&&(e.xmin=e.xmax,e.ymin=e.ymax),e.zmin=void 0,e.zmax=void 0,e.equals(this._clippingArea)||(this._clippingArea=e),this._clippingArea):(ot.error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&m(e)?ot.error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===se.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return g(t)||g(e)||t.spatialReference.equals(e)?t:dt(t,e)}get dataExtent(){let e=this.groundAndLayersExtent;const t=this.spatialReference||nt.WGS84,i=dt(this.clippingArea,t);m(i)&&(e=m(e)?e.intersection(i):i);const r=this._get("dataExtent");return m(e)&&e.equals(r)?r:e}get groundAndLayersExtent(){const e=this.spatialReference||nt.WGS84;let t;const i=i=>{const r=dt(i,e);g(r)||(m(t)?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new st({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{!m(e.fullExtent)||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(g(t))return null;t.hasZ?(t.zmin=Math.min(0,t.zmin),t.zmax=Math.max(0,t.zmax)):(t.zmin=0,t.zmax=0);const s=this._get("groundAndLayersExtent");return t.equals(s)?s:t}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof he?e:e instanceof rt?null!=this.environment?this.environment.cloneWithWebsceneEnvironment(e):he.fromWebsceneEnvironment(e):I(he,e):new he}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||m(this.activeTool)}get stationary(){return!this.animation&&!this.resizing&&(g(this.state)||this.state.stationary)}set qualityProfile(e){Se.isValidProfile(e)&&(Se.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Se.getDefaultProfile()}set slicePlane(e){if(m(this._stage)&&this._stage.renderView.setRenderParameters({slicePlane:e}),g(e))return void this._set("slicePlane",null);const t=this.propertiesPool.get("slicePlane");B(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return null!=this.spatialReference?Q(this.scale,this.spatialReference):0}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?H.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(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||Le(r))return;++i,e+=r.updatingProgress}}else++i}));for(const r of[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this.featureTreeDebugger,this.toolViewManager,this.analysisViewManager])if(m(r)&&r.updating){const t=.1;i+=t,e+=.5*t}for(const r of[this.deconflictor,this.labeler,this.basemapTerrain])m(r)&&r.updating&&(++i,e+=r.updatingProgress);if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||this._createGraphicsViewController||this.inputManager?.hasPendingInputs||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 viewingMode(){const e=this._predeterminedViewingMode;if(m(e))return ne(e);const t=this.spatialReference;return t?m(this.defaultsFromMap?.viewingMode)&&t.equals(this.defaultsFromMap.spatialReference)?ne(this.defaultsFromMap.viewingMode):et(t,se.Global)?"global":"local":"global"}set viewingMode(e){this.ready?ot.error("#viewingMode","viewingMode cannot be set once view is ready"):e?this._override("viewingMode",e):void 0===e&&this._clearOverride("viewingMode")}get resourceController(){return this._resourceController}get performanceInfo(){return new Ee(this)}forceAnimationTime(e){this._stage.renderView.forcedAnimationTime=this.basemapTerrain.overlayManager.forcedAnimationTime=e}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 ot.error("#toMap()","Scene view cannot be used before it is ready"),null;const i=t?this.externalToInternalIntersectOptions(t):this._defaultToMapOptions,r=m(i.graphics)&&(m(i.graphics.include)||m(i.graphics.exclude)),s=Je(e)?Ke(this,e):e,n=T(s);i.enableDraped=i.include&&!i.include.has(Be)||i.exclude&&i.exclude.has(Be);const a=this.sceneIntersectionHelper,o=Ae(this.state.viewingMode);if(o.options.selectionMode=!0,o.options.store=r?We.ALL:We.MIN,a.intersectIntersectorScreen(n,o,i),r){for(const e of o.results.all){const t=qe(e,this);if(g(t))return this._intersectResultToMapPoint(e);if("graphic"!==t.type||this._testGraphicUidFilter(i.graphics,t.graphic))return this._intersectResultToMapPoint(e)}return null}return this._intersectResultToMapPoint(o.results.min)}toScreen(e){if(!this.ready)return ot.error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=f(null==e.z&&Me(this.elevationProvider,e),0);return D(e,ut,this.renderSpatialReference,t),this.state.camera.projectToScreen(ut,gt),C(gt[0],gt[1])}pixelSizeAt(e){return this.ready?e?(D(e,ut,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(ut)):0:(ot.error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e):1}hitTest(e,t){if(!this.ready)return ot.error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=Je(e)?Ke(this,e):e,r=x(i.x,i.y),s=t?this.externalToInternalIntersectOptions(t):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const n=Ae(this.state.viewingMode);n.options.selectionMode=!0,n.options.store=We.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(r,n,s);const a=this._intersectResultsToHits(n.results.all,s.graphics),o=n.results.ground,l=ze(o,this),p=m(l)&&"type"in l&&"integrated-mesh"===l.type?l:null,h={screenPoint:i,results:a,ground:{mapPoint:this._intersectResultToMapPoint(o),distance:ke(o)?o.distanceInRenderSpace:0,layer:p}};return be.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=n),Promise.resolve(h)}async popupHitTest(e){const{results:t,ground:i}=await Ne(this,e);let r=null;return!(0===t.length||Math.abs(f(t[0].distance,0)-i.distance)<1e-5)||i.layer&&"integrated-mesh"===i.layer.type||(r=i.mapPoint),{results:t,screenPoint:e,mapPoint:r}}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(await this.whenReady(),g(e.parent))throw new a("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});if("line-of-sight"===e.parent.type){return(await this.whenLayerView(e.parent)).whenAnalysisView()}return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return $e(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return Xe(i,this._pixelFormat())}_completeSettings(e){const t=Ye(e,this);return t.pixelRatio/=this.state.pixelRatio,Ze(t,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){return{takeScreenshot:e=>this._takeScreenshot(e)}}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return oe.importLayerView(e)}hasLayerViewModule(e){return oe.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=tt(this.type);if(h("safari")&&h("safari")<9&&(e=new a("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:h("safari")})),m(e))throw ot.warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return m(e)?ae(e):null}getSpatialReferenceSupport({spatialReference:e,layer:t}){const i=this._predeterminedViewingMode;if(m(i))return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,se.Local),s=this._validateSpatialReferenceForViewingMode(e,t,se.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,se.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,se.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!et(e,i)&&(!!g(t)||(!!$(t)||(!X(t)||!g(Ge(t,e,i)))&&(!Y(t)||i!==se.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(g(t))return[{spatialReference:e,viewingMode:i}];const r=e.isWebMercator,s=e.isWGS84;if($(t)&&(r||s)){return!s||i===se.Local||null===He(t.tileInfo,t.fullExtent,e,se.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:nt.WebMercator,viewingMode:i}]:[{spatialReference:r?nt.WGS84:nt.WebMercator,viewingMode:i}]}return X(t)||Y(t)||!r&&!s?X(t)&&r&&i!==se.Global?[{spatialReference:e,viewingMode:i},{spatialReference:nt.WGS84,viewingMode:se.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?nt.WGS84:nt.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=m(this.getSpatialReferenceSupport({spatialReference:e})),i=this._predeterminedViewingMode;return t||(m(i)?ot.warnOnce(`Spatial reference defined on view not supported in ${ne(i)} viewing mode.`):e.isGeographic&&ot.warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}computeMapPointFromVec3d(e,t){let i=this.spatialReference||nt.WGS84;return W(e,this.renderSpatialReference,e,i)||(i=nt.WGS84,W(e,this.renderSpatialReference,e,i)),t?(t.x=e[0],t.y=e[1],t.z=e[2],t.spatialReference=i):t=new at(e,i),t}trackGraphicState(e){if(!e.graphic)return ot.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&&m(t)&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return m(t)?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,m(i)&&(i.remove(),i=null)}}}highlight(e){if(Array.isArray(e))return l(e.map((e=>this.highlight(e))));if(s.isCollection(e))return l(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):p()}maskOccludee(e){if(!e)return ot.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&&m(t)&&Qe(t)&&(i=t.maskOccludee(e))};return m(t)?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,m(i)&&(i.remove(),i=null)}}}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){m(this.graphicsView)&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await M((()=>this.graphicsView)),this.graphicsView;if(!e.layer||!this.map)throw new a("no-view-for-graphic");return 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)}externalToInternalIntersectOptions(e){const t=this._externalToInternalRenderItems(e.include,ct.INCLUDE),i=this._externalToInternalRenderItems(e.exclude,ct.EXCLUDE);return{include:t.layerUids,exclude:i.layerUids,graphics:{include:t.graphicUids,exclude:i.graphicUids}}}_intersectResultToMapPoint(e,t){return e.getIntersectionPoint(ut)?(t=this.computeMapPointFromVec3d(ut,t),e.intersector===Fe.TERRAIN&&this.basemapTerrain&&(t.z=f(Me(this.basemapTerrain,t),0)),t):null}_intersectResultsToHits(e,t){const i=new Array;let r=null;for(let s=0;s<e.length;s++){const n=e[s],a=ze(n,this);if(m(a)&&(a===this.map.ground||"type"in a&&"integrated-mesh"===a.type))break;const o=qe(n,this);if(g(o))continue;if("graphic"===o.type){if(g(r)&&s!==e.length-1&&(r=new Set),m(r)){const e=this._getGraphicFilterUid(o.graphic);if(r.has(e))continue;r.add(e)}if(!this._testGraphicUidFilter(t,o.graphic))continue}const l=this._intersectResultToMapPoint(n),p=n.distanceInRenderSpace;i.push({...o,mapPoint:l,distance:p})}return i}_getGraphicFilterUid(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}_testGraphicUidFilter(e,t){const i=this._getGraphicFilterUid(t);return g(e)||(g(e.include)||e.include.has(i))&&(g(e.exclude)||!e.exclude.has(i))}_externalToInternalRenderItems(e,t,r={layerUids:null,graphicUids:null}){if(!e)return r;if(e instanceof i)ht(r,this._getGraphicFilterUid(e)),t===ct.INCLUDE&&(m(this.graphicsView)&&e.layer===this?pt(r,this.graphicsView.processor.layer.id):e.layer&&pt(r,e.layer.uid));else if(d(e))for(const i of e)i===this.graphics&&m(this.graphicsView)?pt(r,this.graphicsView.processor.layer.id):i===this.map.ground?pt(r,Be):this._externalToInternalRenderItems(i,t,r);else"uid"in e&&pt(r,e.uid);return r}_initBasemapTerrain(){this._set("basemapTerrain",new Ie({view:this})),this._set("elevationProvider",new _e({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Pe({view:this})),this._set("featureTiles",new fe({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.contentCameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=m(this.basemapTerrain.extent)?A(q(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;m(this.clippingArea)?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.handles.add([this.updatingHandles.add((()=>be.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this.featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this.featureTreeDebugger&&be.FEATURE_TILE_TREE_SHOW_TILES&&(this.featureTreeDebugger=new e({view:this}))})):e||!this.featureTreeDebugger||be.FEATURE_TILE_TREE_SHOW_TILES||(this.featureTreeDebugger.destroy(),this.featureTreeDebugger=null)}),S),this.updatingHandles.add((()=>this.clippingArea),e,S),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,S)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.deinit(),this.handles.remove("render-coords-helper"),this.handles.remove("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new Ve(this.map,e));const t=this.state.isGlobal,i=N(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",xe.create(this.state.viewingMode,i)),t||this.handles.add(_((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;e&&(0!==e[0]||0!==e[1]||0!==e[2]||0!==e[3])&&F(e,this.basemapTerrain.spatialReference,mt,t)&&(this.renderCoordsHelper.extent=mt)}),R),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.handles.remove("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){m(e)&&e.type===y.MOVE||(this.handles.remove("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.handles.add(_((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),R),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}_renderScreenshotOverlay(e,t){if(!this.overlay||!this.overlay.hasVisibleItems)return t;const i=e.getContext("2d");return i.putImageData(t,0,0),this.overlay.renderCanvas(e),i.getImageData(0,0,t.width,t.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{renderOverlay:(e,t)=>this._renderScreenshotOverlay(e,t)}},t=new ve(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=n(this.surface),{resourceController:r,state:s,renderSpatialReference:l}=this;this._stage=new Ue({options:e,container:i,resourceController:r,state:s,sceneIntersectionHelper:t,renderSR:l}),this._stage.renderView.setRenderParameters({slicePlane:this.slicePlane}),this._lostWebGLContextHandle=o(this._stage.renderView.canvas,"webglcontextlost",(()=>this.fatalError=new a("webgl-context-lost"))),this.handles.add([this.updatingHandles.add((()=>this.qualitySettings.antialiasingEnabled),(()=>this._stage.renderView.setRenderParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})),b),this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(()=>this._stage.renderView.setRenderParameters({highQualityTransparency:this.qualitySettings.highQualityTransparency})),b),_((()=>this.magnifier),(e=>this._stage.renderView.magnifier=e),S)],"stage");const p=()=>{this._stage.renderView.setRenderParameters({defaultHighlightOptions:Re.toEngineOptions(this.highlightOptions)})};this.handles.add(this.updatingHandles.add((()=>[this.highlightOptions.color,this.highlightOptions.haloColor,this.highlightOptions.haloOpacity,this.highlightOptions.fillOpacity,this.highlightOptions.shadowOpacity,this.highlightOptions.shadowColor,this.highlightOptions.shadowDifference]),p),"stage"),p(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage.destroy(),this._stage=null,this._lostWebGLContextHandle.remove(),this._lostWebGLContextHandle=null,this.handles.remove("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new je({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state,objectResourceCache:new me})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.handles.remove("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;w(e),await M((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.handles.remove("graphics-view"),m(this.graphicsView)&&(this.handles.remove(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=ae(this.viewingMode);if(e===se.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.handles.add(v((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const e=this.get("map.initialViewProperties.environment");e&&(this.environment=e)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const t=this._resolveWhenReady;this._resolveWhenReady=[],t.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.handles.remove("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(Be);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(Be);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&e.opacity<1&&this._defaultToMapOptions.exclude.add(e.uid)}}addVoxelLayerViewToWasm(e){return g(this.voxelWasm)?(g(this.voxelWasmPromise)&&(this.voxelWasmPromise=import("../layers/VoxelWasmPerSceneView.js").then((e=>(this.voxelWasm=new e.default(this),this.voxelWasm)))),this.voxelWasmPromise.then((t=>t.addVoxelLayer(e)))):this.voxelWasm.addVoxelLayer(e)}removeVoxelLayerViewFromWasm(e){if(m(this.voxelWasm)){this.voxelWasm.removeVoxelLayer(e)<1&&(this.voxelWasm=null,this.voxelWasmPromise=null)}}};function pt(e,t){e.layerUids||(e.layerUids=new Set),e.layerUids.add(t)}function ht(e,t){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(t)}function dt(e,t){return m(e)&&U(e.spatialReference,t)?A(e,t):null}var ct;lt.type="3d",e([E()],lt.prototype,"_userClippingArea",void 0),e([E()],lt.prototype,"_resourceController",void 0),e([E()],lt.prototype,"_stage",void 0),e([E({readOnly:!0})],lt.prototype,"deconflictor",void 0),e([E({readOnly:!0})],lt.prototype,"labeler",void 0),e([E(G(Z,"analyses"))],lt.prototype,"analyses",void 0),e([E({type:re,readOnly:!0,aliasOf:"state.animation"})],lt.prototype,"animation",void 0),e([E({readOnly:!0})],lt.prototype,"basemapTerrain",void 0),e([E({readOnly:!0})],lt.prototype,"elevationProvider",void 0),e([E({type:t,aliasOf:"stateManager.camera"})],lt.prototype,"camera",void 0),e([E({type:t,aliasOf:"stateManager.contentCamera"})],lt.prototype,"contentCamera",void 0),e([E({readOnly:!0})],lt.prototype,"canvas",void 0),e([E({type:at,aliasOf:"stateManager.center"})],lt.prototype,"center",void 0),e([E({type:st})],lt.prototype,"clippingArea",null),e([E({type:pe})],lt.prototype,"constraints",void 0),e([E({type:st,readOnly:!0})],lt.prototype,"renderDataExtent",null),e([E({type:st,readOnly:!0})],lt.prototype,"dataExtent",null),e([E({type:st,readOnly:!0})],lt.prototype,"groundAndLayersExtent",null),e([E({value:null,type:he})],lt.prototype,"environment",null),e([j("environment")],lt.prototype,"castEnvironment",null),e([E({readOnly:!0})],lt.prototype,"environmentManager",void 0),e([E({type:st,aliasOf:"stateManager.extent"})],lt.prototype,"extent",void 0),e([E()],lt.prototype,"floors",void 0),e([E({readOnly:!0,aliasOf:"stateManager.screenCenter"})],lt.prototype,"screenCenter",void 0),e([E({aliasOf:"stateManager.frustum"})],lt.prototype,"frustum",void 0),e([E({type:Number,readOnly:!0})],lt.prototype,"fullOpacity",void 0),e([E({readOnly:!0})],lt.prototype,"graphicsView",void 0),e([E({readOnly:!0})],lt.prototype,"analysisViewManager",void 0),e([E()],lt.prototype,"groundView",void 0),e([E({type:Boolean})],lt.prototype,"initialExtentRequired",null),e([E()],lt.prototype,"_defaultsFromMapSettings",null),e([E({type:Boolean,readOnly:!0})],lt.prototype,"interacting",null),e([E()],lt.prototype,"stationary",null),e([E({aliasOf:"state.navigating"})],lt.prototype,"navigating",void 0),e([E()],lt.prototype,"map",void 0),e([E({readOnly:!0})],lt.prototype,"mapCoordsHelper",void 0),e([E({aliasOf:"stateManager.padding"})],lt.prototype,"padding",void 0),e([E({type:Pe,readOnly:!0})],lt.prototype,"pointsOfInterest",void 0),e([E({type:fe,readOnly:!0})],lt.prototype,"featureTiles",void 0),e([E()],lt.prototype,"featureTreeDebugger",void 0),e([E({type:Boolean})],lt.prototype,"screenSizePerspectiveEnabled",void 0),e([E({constructOnly:!0})],lt.prototype,"deactivatedWebGLExtensions",void 0),e([E({constructOnly:!0})],lt.prototype,"debugWebGLExtensions",void 0),e([E({constructOnly:!0})],lt.prototype,"renderCanvas",void 0),e([E({constructOnly:!0})],lt.prototype,"state",void 0),e([E({readOnly:!0})],lt.prototype,"inputManager",void 0),e([E({readOnly:!0})],lt.prototype,"stateManager",void 0),e([E({type:["low","medium","high"]})],lt.prototype,"qualityProfile",null),e([E({type:Ce,get(){let e=this._get("qualitySettings");return e||(e=new Ce,Se.apply(this.qualityProfile,e)),e}})],lt.prototype,"qualitySettings",void 0),e([E()],lt.prototype,"slicePlane",null),e([E({readOnly:!0})],lt.prototype,"typeSpecificPreconditionsReady",null),e([E({readOnly:!0})],lt.prototype,"renderCoordsHelper",void 0),e([E({readOnly:!0})],lt.prototype,"sceneIntersectionHelper",void 0),e([E({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],lt.prototype,"resolution",null),e([E({type:Number,aliasOf:"stateManager.scale"})],lt.prototype,"scale",void 0),e([E()],lt.prototype,"heightModelInfo",null),e([E()],lt.prototype,"spatialReference",void 0),e([E({type:Boolean,constructOnly:!0})],lt.prototype,"alphaCompositingEnabled",void 0),e([E({constructOnly:!0})],lt.prototype,"preserveDrawingBufferEnabled",void 0),e([E({type:Boolean})],lt.prototype,"supersampleScreenshotsEnabled",void 0),e([E({readOnly:!0})],lt.prototype,"type",void 0),e([E({type:it})],lt.prototype,"ui",void 0),e([E({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.hasPendingInputs","toolViewManager.updating","analysisViewManager.updating"]})],lt.prototype,"updating",null),e([E({type:Number,readOnly:!0,dependsOn:["updating"]})],lt.prototype,"updatingProgress",void 0),e([E({type:["global","local"]})],lt.prototype,"viewingMode",null),e([E({type:r,aliasOf:"stateManager.viewpoint"})],lt.prototype,"viewpoint",void 0),e([E({type:Number,aliasOf:"stateManager.zoom"})],lt.prototype,"zoom",void 0),e([E({type:Re})],lt.prototype,"highlightOptions",void 0),lt=e([P("esri.views.SceneView")],lt),function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(ct||(ct={}));const ut=L(),gt=x(),mt=k(),ft=lt;export{ft as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.js";import i from"../Graphic.js";import r from"../Viewpoint.js";import s from"../core/Collection.js";import{byId as n}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{handlesGroup as l,makeHandle as p}from"../core/handleUtils.js";import h from"../core/has.js";import{isIterable as d}from"../core/iteratorUtils.js";import c from"../core/Logger.js";import{destroyMaybe as u,isNone as g,isSome as m,unwrapOr as f}from"../core/maybe.js";import{ObservableChangesType as y}from"../core/ObservableChangesType.js";import{throwIfAborted as w}from"../core/promiseUtils.js";import{on as v,watch as _,initial as b,syncAndInitial as S,whenOnce as M,sync as R}from"../core/reactiveUtils.js";import{setFrameDuration as V}from"../core/scheduling.js";import{screenPointObjectToArray as T,createScreenPoint as C,createScreenPointArray as x}from"../core/screenUtils.js";import{initialize as O}from"../core/workers/workers.js";import{property as E}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import{subclass as P}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as I}from"../core/accessorSupport/ensureType.js";import{c as L}from"../chunks/vec3f64.js";import{owningCollectionProperty as G}from"../core/support/OwningCollection.js";import H from"../geometry/HeightModelInfo.js";import{canProjectWithoutEngine as U,project as A,projectPointToVector as D,projectVectorToVector as W,projectBoundingRect as F}from"../geometry/projection.js";import{create as k,toExtent as q}from"../geometry/support/aaBoundingRect.js";import{B as z,a as B}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as N}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Q}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as $,isTiledLayer as X,isVoxelLayer as Y}from"../layers/support/layerUtils.js";import{AnalysesCollection as Z}from"../support/AnalysesCollection.js";import{BreakpointsOwner as J}from"./BreakpointsOwner.js";import{DOMContainer as K}from"./DOMContainer.js";import ee from"./GroundView.js";import{PopupView as te}from"./PopupView.js";import ie from"./View.js";import re from"./ViewAnimation.js";import{ViewingMode as se,stringFromViewingMode as ne,viewingModeFromString as ae}from"./ViewingMode.js";import{layerView3DImporter as oe}from"./3d/layerViewModuleImportUtils.js";import le from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as pe}from"./3d/constraints/Constraints.js";import he from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as de}from"./3d/environment/SceneViewEnvironmentManager.js";import ce from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as ue}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ge}from"./3d/layers/graphics/Labeler.js";import{ObjectResourceCache as me}from"./3d/layers/graphics/ObjectResourceCache.js";import{FeatureTileTree3D as fe}from"./3d/layers/support/FeatureTileTree3D.js";import ye from"./3d/state/ViewState.js";import we from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ve}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as _e}from"./3d/support/CombinedElevationProvider.js";import be from"./3d/support/debugFlags.js";import Se from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Me}from"./3d/support/ElevationProvider.js";import Re from"./3d/support/HighlightOptions.js";import{MapCoordsHelper as Ve}from"./3d/support/MapCoordsHelper.js";import{PropertiesPool as Te}from"./3d/support/PropertiesPool.js";import Ce from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as xe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Oe}from"./3d/support/ResourceController.js";import Ee from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as je}from"./3d/support/SharedSymbolResources.js";import{PointsOfInterest as Pe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ie from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Le,getTiledLayerInfo as Ge,checkIfTileInfoSupportedForView as He}from"./3d/terrain/terrainUtils.js";import{Stage as Ue}from"./3d/webgl-engine/Stage.js";import{newIntersector as Ae,DEFAULT_TOLERANCE as De}from"./3d/webgl-engine/lib/Intersector.js";import{StoreResults as We,IntersectorType as Fe}from"./3d/webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as ke}from"./3d/webgl-engine/lib/intersectorUtils.js";import{toHit as qe,toOwner as ze}from"./3d/webgl-engine/lib/intersectorUtilsConversions.js";import{TERRAIN_ID as Be}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{hitTestSelectSimilarDistance as Ne}from"./support/hitTestSelectUtils.js";import{occludeesSupported as Qe}from"./support/layerViewUtils.js";import{encode as $e,encodeData as Xe,toRenderSettings as Ye,screenshotSuperSampleSettings as Ze}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as Je,createScreenPointFromSupportedEvent as Ke}from"./support/screenUtils.js";import{isSpatialReferenceSupported as et}from"./support/spatialReferenceSupport.js";import{check as tt}from"./support/WebGLRequirements.js";import it from"./ui/3d/DefaultUI3D.js";import rt from"../webscene/Environment.js";import st from"../geometry/Extent.js";import nt from"../geometry/SpatialReference.js";import at from"../geometry/Point.js";const ot=c.getLogger("esri.views.SceneView");let lt=class extends(J(K(te(ie)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this.propertiesPool=new Te({slicePlane:z},this),this._resourceController=Oe(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new ue({view:this}),this.labeler=new ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new Z,this.basemapTerrain=null,this.elevationProvider=null,this.camera=null,this.canvas=null,this.center=null,this.constraints=new pe,this.environmentManager=new de,this.extent=null,this.floors=new s,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new le({view:this}),this.groundView=null,this.navigating=!1,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ye,this.scale=null,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new it,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.viewpoint=null,this.zoom=null,this.highlightOptions=new Re,this.voxelWasm=null,this.voxelWasmPromise=null,O(),e&&e.environment||(this._defaults.environment=new he,this.environment=this._defaults.environment);const t=(e=null)=>{m(e)&&e.type===y.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.handles.add([v((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),_((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new ce({view:this}),this.stateManager=new we({view:this})}initialize(){this.groundView=new ee({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.handles.add(v((()=>this.map?.allLayers),"after-changes",e,{onListenerAdd:e,onListenerRemove:e})),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),b),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),b),this.updatingHandles.add((()=>this.qualitySettings.frameRate),(e=>V(e>0?1e3/Math.ceil(e):0)),b),this.updatingHandles.add((()=>this.map?.ground),e,S),this.updatingHandles.add((()=>this.map?.ground?.opacity),(()=>this._updateDefaultHitTestOptions()),S),this.handles.add(_((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),R))}destroy(){this.destroyed||(this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this.labeler.destroy(),this._set("labeler",null),this.deconflictor.destroy(),this._set("deconflictor",null),this._resourceController=u(this._resourceController),this.stateManager.destroy(),this._set("stateManager",null),this.inputManager.destroy(),this._set("inputManager",null),this.propertiesPool.destroy(),this.handles.remove("updatingMonitors"),this.environmentManager.destroy(),this._set("environmentManager",null),this.groundView=u(this.groundView))}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get clippingArea(){if("global"===this.viewingMode)return null;let e=this._userClippingArea||this.get("map.clippingArea");return!(!!this._userClippingArea||this.get("map.clippingEnabled"))||g(e)?(this._clippingArea=null,null):e instanceof st?this.spatialReference&&(e=dt(e,this.spatialReference),g(e))?(ot.error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(e=e.clone(),g(e.intersection(this.groundAndLayersExtent))&&(e.xmin=e.xmax,e.ymin=e.ymax),e.zmin=void 0,e.zmax=void 0,e.equals(this._clippingArea)||(this._clippingArea=e),this._clippingArea):(ot.error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&m(e)?ot.error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===se.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return g(t)||g(e)||t.spatialReference.equals(e)?t:dt(t,e)}get dataExtent(){let e=this.groundAndLayersExtent;const t=this.spatialReference||nt.WGS84,i=dt(this.clippingArea,t);m(i)&&(e=m(e)?e.intersection(i):i);const r=this._get("dataExtent");return m(e)&&e.equals(r)?r:e}get groundAndLayersExtent(){const e=this.spatialReference||nt.WGS84;let t;const i=i=>{const r=dt(i,e);g(r)||(m(t)?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new st({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{!m(e.fullExtent)||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(g(t))return null;t.hasZ?(t.zmin=Math.min(0,t.zmin),t.zmax=Math.max(0,t.zmax)):(t.zmin=0,t.zmax=0);const s=this._get("groundAndLayersExtent");return t.equals(s)?s:t}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof he?e:e instanceof rt?null!=this.environment?this.environment.cloneWithWebsceneEnvironment(e):he.fromWebsceneEnvironment(e):I(he,e):new he}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||m(this.activeTool)}get stationary(){return!this.animation&&!this.resizing&&(g(this.state)||this.state.stationary)}set qualityProfile(e){Se.isValidProfile(e)&&(Se.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Se.getDefaultProfile()}set slicePlane(e){if(m(this._stage)&&this._stage.renderView.setRenderParameters({slicePlane:e}),g(e))return void this._set("slicePlane",null);const t=this.propertiesPool.get("slicePlane");B(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return null!=this.spatialReference?Q(this.scale,this.spatialReference):0}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?H.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(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||Le(r))return;++i,e+=r.updatingProgress}}else++i}));for(const r of[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this.featureTreeDebugger,this.toolViewManager,this.analysisViewManager])if(m(r)&&r.updating){const t=.1;i+=t,e+=.5*t}for(const r of[this.deconflictor,this.labeler,this.basemapTerrain])m(r)&&r.updating&&(++i,e+=r.updatingProgress);if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||this._createGraphicsViewController||this.inputManager?.hasPendingInputs||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 viewingMode(){const e=this._predeterminedViewingMode;if(m(e))return ne(e);const t=this.spatialReference;return t?m(this.defaultsFromMap?.viewingMode)&&t.equals(this.defaultsFromMap.spatialReference)?ne(this.defaultsFromMap.viewingMode):et(t,se.Global)?"global":"local":"global"}set viewingMode(e){this.ready?ot.error("#viewingMode","viewingMode cannot be set once view is ready"):e?this._override("viewingMode",e):void 0===e&&this._clearOverride("viewingMode")}get resourceController(){return this._resourceController}get performanceInfo(){return new Ee(this)}forceAnimationTime(e){this._stage.renderView.forcedAnimationTime=this.basemapTerrain.overlayManager.forcedAnimationTime=e}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 ot.error("#toMap()","Scene view cannot be used before it is ready"),null;const i=t?this.externalToInternalIntersectOptions(t):this._defaultToMapOptions,r=m(i.graphics)&&(m(i.graphics.include)||m(i.graphics.exclude)),s=Je(e)?Ke(this,e):e,n=T(s);i.enableDraped=i.include&&!i.include.has(Be)||i.exclude&&i.exclude.has(Be);const a=this.sceneIntersectionHelper,o=Ae(this.state.viewingMode);if(o.options.selectionMode=!0,o.options.store=r?We.ALL:We.MIN,a.intersectIntersectorScreen(n,o,i),r){for(const e of o.results.all){const t=qe(e,this);if(g(t))return this._intersectResultToMapPoint(e);if("graphic"!==t.type||this._testGraphicUidFilter(i.graphics,t.graphic))return this._intersectResultToMapPoint(e)}return null}return this._intersectResultToMapPoint(o.results.min)}toScreen(e){if(!this.ready)return ot.error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=f(null==e.z&&Me(this.elevationProvider,e),0);return D(e,ut,this.renderSpatialReference,t),this.state.camera.projectToScreen(ut,gt),C(gt[0],gt[1])}pixelSizeAt(e){return this.ready?e?(D(e,ut,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(ut)):0:(ot.error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e):1}hitTest(e,t){if(!this.ready)return ot.error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=Je(e)?Ke(this,e):e,r=x(i.x,i.y),s=t?this.externalToInternalIntersectOptions(t):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const n=Ae(this.state.viewingMode);n.options.selectionMode=!0,n.options.store=We.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(r,n,s);const a=this._intersectResultsToHits(n.results.all,s.graphics),o=n.results.ground,l=ze(o,this),p=m(l)&&"type"in l&&"integrated-mesh"===l.type?l:null,h={screenPoint:i,results:a,ground:{mapPoint:this._intersectResultToMapPoint(o),distance:ke(o)?o.distanceInRenderSpace:0,layer:p}};return be.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=n),Promise.resolve(h)}async popupHitTest(e){const{results:t,ground:i}=await Ne(this,e);let r=null;return!(0===t.length||Math.abs(f(t[0].distance,0)-i.distance)<1e-5)||i.layer&&"integrated-mesh"===i.layer.type||(r=i.mapPoint),{results:t,screenPoint:e,mapPoint:r}}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(g(e.parent))throw new a("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});if("line-of-sight"===e.parent.type){return(await this.whenLayerView(e.parent)).whenAnalysisView()}return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return $e(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return Xe(i,this._pixelFormat())}_completeSettings(e){const t=Ye(e,this);return t.pixelRatio/=this.state.pixelRatio,Ze(t,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){return{takeScreenshot:e=>this._takeScreenshot(e)}}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return oe.importLayerView(e)}hasLayerViewModule(e){return oe.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=tt(this.type);if(h("safari")&&h("safari")<9&&(e=new a("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:h("safari")})),m(e))throw ot.warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return m(e)?ae(e):null}getSpatialReferenceSupport({spatialReference:e,layer:t}){const i=this._predeterminedViewingMode;if(m(i))return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,se.Local),s=this._validateSpatialReferenceForViewingMode(e,t,se.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,se.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,se.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!et(e,i)&&(!!g(t)||(!!$(t)||(!X(t)||!g(Ge(t,e,i)))&&(!Y(t)||i!==se.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(g(t))return[{spatialReference:e,viewingMode:i}];const r=e.isWebMercator,s=e.isWGS84;if($(t)&&(r||s)){return!s||i===se.Local||null===He(t.tileInfo,t.fullExtent,e,se.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:nt.WebMercator,viewingMode:i}]:[{spatialReference:r?nt.WGS84:nt.WebMercator,viewingMode:i}]}return X(t)||Y(t)||!r&&!s?X(t)&&r&&i!==se.Global?[{spatialReference:e,viewingMode:i},{spatialReference:nt.WGS84,viewingMode:se.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?nt.WGS84:nt.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=m(this.getSpatialReferenceSupport({spatialReference:e})),i=this._predeterminedViewingMode;return t||(m(i)?ot.warnOnce(`Spatial reference defined on view not supported in ${ne(i)} viewing mode.`):e.isGeographic&&ot.warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}computeMapPointFromVec3d(e,t){let i=this.spatialReference||nt.WGS84;return W(e,this.renderSpatialReference,e,i)||(i=nt.WGS84,W(e,this.renderSpatialReference,e,i)),t?(t.x=e[0],t.y=e[1],t.z=e[2],t.spatialReference=i):t=new at(e,i),t}trackGraphicState(e){if(!e.graphic)return ot.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&&m(t)&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return m(t)?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,m(i)&&(i.remove(),i=null)}}}highlight(e){if(Array.isArray(e))return l(e.map((e=>this.highlight(e))));if(s.isCollection(e))return l(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):p()}maskOccludee(e){if(!e)return ot.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&&m(t)&&Qe(t)&&(i=t.maskOccludee(e))};return m(t)?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,m(i)&&(i.remove(),i=null)}}}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){m(this.graphicsView)&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await M((()=>this.graphicsView)),this.graphicsView;if(!e.layer||!this.map)throw new a("no-view-for-graphic");return 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)}externalToInternalIntersectOptions(e){const t=this._externalToInternalRenderItems(e.include,ct.INCLUDE),i=this._externalToInternalRenderItems(e.exclude,ct.EXCLUDE);return{include:t.layerUids,exclude:i.layerUids,graphics:{include:t.graphicUids,exclude:i.graphicUids}}}_intersectResultToMapPoint(e,t){return e.getIntersectionPoint(ut)?(t=this.computeMapPointFromVec3d(ut,t),e.intersector===Fe.TERRAIN&&this.basemapTerrain&&(t.z=f(Me(this.basemapTerrain,t),0)),t):null}_intersectResultsToHits(e,t){const i=new Array;let r=null;for(let s=0;s<e.length;s++){const n=e[s],a=ze(n,this);if(m(a)&&(a===this.map.ground||"type"in a&&"integrated-mesh"===a.type))break;const o=qe(n,this);if(g(o))continue;if("graphic"===o.type){if(g(r)&&s!==e.length-1&&(r=new Set),m(r)){const e=this._getGraphicFilterUid(o.graphic);if(r.has(e))continue;r.add(e)}if(!this._testGraphicUidFilter(t,o.graphic))continue}const l=this._intersectResultToMapPoint(n),p=n.distanceInRenderSpace;i.push({...o,mapPoint:l,distance:p})}return i}_getGraphicFilterUid(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}_testGraphicUidFilter(e,t){const i=this._getGraphicFilterUid(t);return g(e)||(g(e.include)||e.include.has(i))&&(g(e.exclude)||!e.exclude.has(i))}_externalToInternalRenderItems(e,t,r={layerUids:null,graphicUids:null}){if(!e)return r;if(e instanceof i)ht(r,this._getGraphicFilterUid(e)),t===ct.INCLUDE&&(m(this.graphicsView)&&e.layer===this?pt(r,this.graphicsView.processor.layer.id):e.layer&&pt(r,e.layer.uid));else if(d(e))for(const i of e)i===this.graphics&&m(this.graphicsView)?pt(r,this.graphicsView.processor.layer.id):i===this.map.ground?pt(r,Be):this._externalToInternalRenderItems(i,t,r);else"uid"in e&&pt(r,e.uid);return r}_initBasemapTerrain(){this._set("basemapTerrain",new Ie({view:this})),this._set("elevationProvider",new _e({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Pe({view:this})),this._set("featureTiles",new fe({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.contentCameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=m(this.basemapTerrain.extent)?A(q(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;m(this.clippingArea)?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.handles.add([this.updatingHandles.add((()=>be.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this.featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this.featureTreeDebugger&&be.FEATURE_TILE_TREE_SHOW_TILES&&(this.featureTreeDebugger=new e({view:this}))})):e||!this.featureTreeDebugger||be.FEATURE_TILE_TREE_SHOW_TILES||(this.featureTreeDebugger.destroy(),this.featureTreeDebugger=null)}),S),this.updatingHandles.add((()=>this.clippingArea),e,S),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,S)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.deinit(),this.handles.remove("render-coords-helper"),this.handles.remove("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new Ve(this.map,e));const t=this.state.isGlobal,i=N(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",xe.create(this.state.viewingMode,i)),t||this.handles.add(_((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;e&&(0!==e[0]||0!==e[1]||0!==e[2]||0!==e[3])&&F(e,this.basemapTerrain.spatialReference,mt,t)&&(this.renderCoordsHelper.extent=mt)}),R),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.handles.remove("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){m(e)&&e.type===y.MOVE||(this.handles.remove("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.handles.add(_((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),R),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}_renderScreenshotOverlay(e,t){if(!this.overlay||!this.overlay.hasVisibleItems)return t;const i=e.getContext("2d");return i.putImageData(t,0,0),this.overlay.renderCanvas(e),i.getImageData(0,0,t.width,t.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{renderOverlay:(e,t)=>this._renderScreenshotOverlay(e,t)}},t=new ve(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=n(this.surface),{resourceController:r,state:s,renderSpatialReference:l}=this;this._stage=new Ue({options:e,container:i,resourceController:r,state:s,sceneIntersectionHelper:t,renderSR:l}),this._stage.renderView.setRenderParameters({slicePlane:this.slicePlane}),this._lostWebGLContextHandle=o(this._stage.renderView.canvas,"webglcontextlost",(()=>this.fatalError=new a("webgl-context-lost"))),this.handles.add([this.updatingHandles.add((()=>this.qualitySettings.antialiasingEnabled),(()=>this._stage.renderView.setRenderParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})),b),this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(()=>this._stage.renderView.setRenderParameters({highQualityTransparency:this.qualitySettings.highQualityTransparency})),b),_((()=>this.magnifier),(e=>this._stage.renderView.magnifier=e),S)],"stage");const p=()=>{this._stage.renderView.setRenderParameters({defaultHighlightOptions:Re.toEngineOptions(this.highlightOptions)})};this.handles.add(this.updatingHandles.add((()=>[this.highlightOptions.color,this.highlightOptions.haloColor,this.highlightOptions.haloOpacity,this.highlightOptions.fillOpacity,this.highlightOptions.shadowOpacity,this.highlightOptions.shadowColor,this.highlightOptions.shadowDifference]),p),"stage"),p(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage.destroy(),this._stage=null,this._lostWebGLContextHandle.remove(),this._lostWebGLContextHandle=null,this.handles.remove("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new je({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state,objectResourceCache:new me})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.handles.remove("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;w(e),await M((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.handles.remove("graphics-view"),m(this.graphicsView)&&(this.handles.remove(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=ae(this.viewingMode);if(e===se.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.handles.add(v((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const e=this.get("map.initialViewProperties.environment");e&&(this.environment=e)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const t=this._resolveWhenReady;this._resolveWhenReady=[],t.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.handles.remove("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(Be);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(Be);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&e.opacity<1&&this._defaultToMapOptions.exclude.add(e.uid)}}addVoxelLayerViewToWasm(e){return g(this.voxelWasm)?(g(this.voxelWasmPromise)&&(this.voxelWasmPromise=import("../layers/VoxelWasmPerSceneView.js").then((e=>(this.voxelWasm=new e.default(this),this.voxelWasm)))),this.voxelWasmPromise.then((t=>t.addVoxelLayer(e)))):this.voxelWasm.addVoxelLayer(e)}removeVoxelLayerViewFromWasm(e){if(m(this.voxelWasm)){this.voxelWasm.removeVoxelLayer(e)<1&&(this.voxelWasm=null,this.voxelWasmPromise=null)}}};function pt(e,t){e.layerUids||(e.layerUids=new Set),e.layerUids.add(t)}function ht(e,t){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(t)}function dt(e,t){return m(e)&&U(e.spatialReference,t)?A(e,t):null}var ct;lt.type="3d",e([E()],lt.prototype,"_userClippingArea",void 0),e([E()],lt.prototype,"_resourceController",void 0),e([E()],lt.prototype,"_stage",void 0),e([E({readOnly:!0})],lt.prototype,"deconflictor",void 0),e([E({readOnly:!0})],lt.prototype,"labeler",void 0),e([E(G(Z,"analyses"))],lt.prototype,"analyses",void 0),e([E({type:re,readOnly:!0,aliasOf:"state.animation"})],lt.prototype,"animation",void 0),e([E({readOnly:!0})],lt.prototype,"basemapTerrain",void 0),e([E({readOnly:!0})],lt.prototype,"elevationProvider",void 0),e([E({type:t,aliasOf:"stateManager.camera"})],lt.prototype,"camera",void 0),e([E({type:t,aliasOf:"stateManager.contentCamera"})],lt.prototype,"contentCamera",void 0),e([E({readOnly:!0})],lt.prototype,"canvas",void 0),e([E({type:at,aliasOf:"stateManager.center"})],lt.prototype,"center",void 0),e([E({type:st})],lt.prototype,"clippingArea",null),e([E({type:pe})],lt.prototype,"constraints",void 0),e([E({type:st,readOnly:!0})],lt.prototype,"renderDataExtent",null),e([E({type:st,readOnly:!0})],lt.prototype,"dataExtent",null),e([E({type:st,readOnly:!0})],lt.prototype,"groundAndLayersExtent",null),e([E({value:null,type:he})],lt.prototype,"environment",null),e([j("environment")],lt.prototype,"castEnvironment",null),e([E({readOnly:!0})],lt.prototype,"environmentManager",void 0),e([E({type:st,aliasOf:"stateManager.extent"})],lt.prototype,"extent",void 0),e([E()],lt.prototype,"floors",void 0),e([E({readOnly:!0,aliasOf:"stateManager.screenCenter"})],lt.prototype,"screenCenter",void 0),e([E({aliasOf:"stateManager.frustum"})],lt.prototype,"frustum",void 0),e([E({type:Number,readOnly:!0})],lt.prototype,"fullOpacity",void 0),e([E({readOnly:!0})],lt.prototype,"graphicsView",void 0),e([E({readOnly:!0})],lt.prototype,"analysisViewManager",void 0),e([E()],lt.prototype,"groundView",void 0),e([E({type:Boolean})],lt.prototype,"initialExtentRequired",null),e([E()],lt.prototype,"_defaultsFromMapSettings",null),e([E({type:Boolean,readOnly:!0})],lt.prototype,"interacting",null),e([E()],lt.prototype,"stationary",null),e([E({aliasOf:"state.navigating"})],lt.prototype,"navigating",void 0),e([E()],lt.prototype,"map",void 0),e([E({readOnly:!0})],lt.prototype,"mapCoordsHelper",void 0),e([E({aliasOf:"stateManager.padding"})],lt.prototype,"padding",void 0),e([E({type:Pe,readOnly:!0})],lt.prototype,"pointsOfInterest",void 0),e([E({type:fe,readOnly:!0})],lt.prototype,"featureTiles",void 0),e([E()],lt.prototype,"featureTreeDebugger",void 0),e([E({type:Boolean})],lt.prototype,"screenSizePerspectiveEnabled",void 0),e([E({constructOnly:!0})],lt.prototype,"deactivatedWebGLExtensions",void 0),e([E({constructOnly:!0})],lt.prototype,"debugWebGLExtensions",void 0),e([E({constructOnly:!0})],lt.prototype,"renderCanvas",void 0),e([E({constructOnly:!0})],lt.prototype,"state",void 0),e([E({readOnly:!0})],lt.prototype,"inputManager",void 0),e([E({readOnly:!0})],lt.prototype,"stateManager",void 0),e([E({type:["low","medium","high"]})],lt.prototype,"qualityProfile",null),e([E({type:Ce,get(){let e=this._get("qualitySettings");return e||(e=new Ce,Se.apply(this.qualityProfile,e)),e}})],lt.prototype,"qualitySettings",void 0),e([E()],lt.prototype,"slicePlane",null),e([E({readOnly:!0})],lt.prototype,"typeSpecificPreconditionsReady",null),e([E({readOnly:!0})],lt.prototype,"renderCoordsHelper",void 0),e([E({readOnly:!0})],lt.prototype,"sceneIntersectionHelper",void 0),e([E({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],lt.prototype,"resolution",null),e([E({type:Number,aliasOf:"stateManager.scale"})],lt.prototype,"scale",void 0),e([E()],lt.prototype,"heightModelInfo",null),e([E()],lt.prototype,"spatialReference",void 0),e([E({type:Boolean,constructOnly:!0})],lt.prototype,"alphaCompositingEnabled",void 0),e([E({constructOnly:!0})],lt.prototype,"preserveDrawingBufferEnabled",void 0),e([E({type:Boolean})],lt.prototype,"supersampleScreenshotsEnabled",void 0),e([E({readOnly:!0})],lt.prototype,"type",void 0),e([E({type:it})],lt.prototype,"ui",void 0),e([E({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.hasPendingInputs","toolViewManager.updating","analysisViewManager.updating"]})],lt.prototype,"updating",null),e([E({type:Number,readOnly:!0,dependsOn:["updating"]})],lt.prototype,"updatingProgress",void 0),e([E({type:["global","local"]})],lt.prototype,"viewingMode",null),e([E({type:r,aliasOf:"stateManager.viewpoint"})],lt.prototype,"viewpoint",void 0),e([E({type:Number,aliasOf:"stateManager.zoom"})],lt.prototype,"zoom",void 0),e([E({type:Re})],lt.prototype,"highlightOptions",void 0),lt=e([P("esri.views.SceneView")],lt),function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(ct||(ct={}));const ut=L(),gt=x(),mt=k(),ft=lt;export{ft as default};
|
package/views/View.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/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Map.js";import i from"../TimeExtent.js";import r from"../core/Accessor.js";import a from"../core/Collection.js";import s from"../core/CollectionFlattener.js";import o from"../core/Error.js";import n from"../core/Evented.js";import{HandleOwnerMixin as l}from"../core/HandleOwner.js";import{makeHandle as p}from"../core/handleUtils.js";import d from"../core/Loadable.js";import h from"../core/Logger.js";import{destroyMaybe as y,isSome as c,abortMaybe as u}from"../core/maybe.js";import{EsriPromiseMixin as m}from"../core/Promise.js";import{createTask as f,after as g}from"../core/promiseUtils.js";import{watch as w,whenOnce as v,when as M,sync as V}from"../core/reactiveUtils.js";import{aliasOf as R}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as _}from"../core/accessorSupport/decorators/property.js";import{subclass as S}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as j}from"../core/support/OwningCollection.js";import F from"../geometry/Extent.js";import O from"../geometry/HeightModelInfo.js";import L from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as b}from"../support/AnalysesCollection.js";import{GraphicsCollection as C}from"../support/GraphicsCollection.js";import{BasemapView as x}from"./BasemapView.js";import I from"./LayerViewManager.js";import q from"./Magnifier.js";import D from"./ToolViewManager.js";import T from"./input/Input.js";import{ViewEvents as k}from"./input/ViewEvents.js";import z from"./navigation/Navigation.js";import{DefaultsFromMap as P}from"./support/DefaultsFromMap.js";var U;const W=h.getLogger("esri.views.View");let A=U=class extends(l(n.EventedMixin(m(r)))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.allLayerViews=new s({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:e=>e.layerViews}),this.groundView=null,this.animation=null,this.basemapView=null,this.fatalError=null,this.extent=null,this.graphics=new C,this.analyses=new b,this.navigating=!1,this.typeSpecificPreconditionsReady=!0,this.layerViews=new a,this.magnifier=new q,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new T,this.navigation=new z,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new k(this),this.persistableViewModels=new a,this._isValid=!1,this._readyCycleForced=!1,this.handles.add(w((()=>this.preconditionsReady),(e=>{e?(this._currentSpatialReference=this.spatialReference,U.views.add(this)):(this._currentSpatialReference=null,U.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?(this.layerViewManager?.clear(),this.toolViewManager?.detach(),c(this.analysisViewManager)&&this.analysisViewManager.detach(),this._teardown()):e&&!this.ready&&(c(this.analysisViewManager)&&this.analysisViewManager.attach(),this._startup(),this.toolViewManager.attach())}),V))}initialize(){this.addResolvingPromise(this.validate().then((()=>(this._isValid=!0,v((()=>this.ready)))))),this.basemapView=new x({view:this}),this.layerViewManager=new I({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new D({view:this}),this._setupSpatialReferenceLogger(),this.handles.add([w((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),{sync:!0,initial:!0}),w((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),{sync:!0}),w((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let e=null;this.handles.add([w((()=>this.defaultsFromMap?.ready),(t=>{const i=this.map?.allLayers.length>0;if(t&&!this.spatialReference&&i){if(c(e))return;const t=p((()=>e=u(e)));e=f((async t=>{try{await g(this.spatialReferenceWarningDelay,null,t)}catch{return}finally{e=null}W.warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})),this.handles.add(t,"spatial-reference-logger-task")}else this.handles.remove("spatial-reference-logger-task")}),{sync:!0})])}destroy(){if(this.destroyed)return;this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.handles.remove("defaultsFromMap"),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.basemapView=y(this.basemapView),this.invalidate(),this._emitter.clear(),this.handles.removeAll();const e=this.map;this.map=null,e?.destroy()}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return W.error("#toMap()","Not implemented on this instance of View"),null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new P({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._currentSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}set map(e){e!==this._get("map")&&(e?.destroyed&&(W.warn("#map","The provided map is already destroyed",{map:e}),e=null),d.isLoadable(e)&&e.load().catch((()=>{})),this.initialized&&(this.forceReadyCycle(),this._currentSpatialReference=null),this._set("map",e))}get spatialReference(){let e=this._userSpatialReference||this._currentSpatialReference||this.getDefaultSpatialReference()||null;return e&&this.defaultsFromMap?.required?.heightModelInfo&&(e=e.clone(),e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),e}set spatialReference(e){const t=!E(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){const e=this.toolViewManager?this.toolViewManager.cursor:null;return c(e)?e:this._cursor||"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}whenLayerView(e){return this.layerViewManager.whenLayerView(e)}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}importLayerView(e){throw new o("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return c(this.getSpatialReferenceSupport({spatialReference:e}))}when(e,t){return this.isResolved()&&!this.ready&&W.warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(M((()=>!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};A.views=new a,e([_()],A.prototype,"_userSpatialReference",void 0),e([R("toolViewManager.activeTool")],A.prototype,"activeTool",void 0),e([_({readOnly:!0})],A.prototype,"allLayerViews",void 0),e([_()],A.prototype,"groundView",void 0),e([_()],A.prototype,"animation",void 0),e([_()],A.prototype,"basemapView",void 0),e([_({readOnly:!0})],A.prototype,"_defaultsFromMapSettings",null),e([_()],A.prototype,"defaultsFromMap",null),e([_()],A.prototype,"fatalError",void 0),e([_({type:F})],A.prototype,"extent",void 0),e([_(j(C,"graphics"))],A.prototype,"graphics",void 0),e([_(j(b,"analyses"))],A.prototype,"analyses",void 0),e([_({readOnly:!0,type:O})],A.prototype,"heightModelInfo",null),e([_({readOnly:!0})],A.prototype,"interacting",null),e([_({readOnly:!0})],A.prototype,"navigating",void 0),e([_({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_currentSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],A.prototype,"preconditionsReady",null),e([_({readOnly:!0})],A.prototype,"typeSpecificPreconditionsReady",void 0),e([_({type:a,readOnly:!0})],A.prototype,"layerViews",void 0),e([_({type:q})],A.prototype,"magnifier",void 0),e([_({value:null,type:t})],A.prototype,"map",null),e([_()],A.prototype,"padding",void 0),e([_({readOnly:!0})],A.prototype,"ready",void 0),e([_({type:L})],A.prototype,"spatialReference",null),e([_()],A.prototype,"spatialReferenceWarningDelay",void 0),e([_()],A.prototype,"stationary",null),e([_({readOnly:!0})],A.prototype,"supportsGround",void 0),e([_({type:i})],A.prototype,"timeExtent",void 0),e([R("toolViewManager.tools")],A.prototype,"tools",void 0),e([_()],A.prototype,"toolViewManager",void 0),e([_({readOnly:!0})],A.prototype,"type",void 0),e([_({type:Number})],A.prototype,"scale",void 0),e([_({readOnly:!0})],A.prototype,"updating",void 0),e([_({readOnly:!0})],A.prototype,"initialExtentRequired",void 0),e([_({readOnly:!0})],A.prototype,"initialExtent",null),e([_()],A.prototype,"cursor",null),e([_({readOnly:!0})],A.prototype,"input",void 0),e([_({type:z,nonNullable:!0})],A.prototype,"navigation",void 0),e([_()],A.prototype,"layerViewManager",void 0),e([_()],A.prototype,"analysisViewManager",void 0),e([_()],A.prototype,"width",void 0),e([_()],A.prototype,"height",void 0),e([_({readOnly:!0})],A.prototype,"resizing",void 0),e([_({value:null,readOnly:!0})],A.prototype,"size",null),e([_({readOnly:!0})],A.prototype,"suspended",void 0),e([_({readOnly:!0})],A.prototype,"viewEvents",void 0),e([_({readOnly:!0})],A.prototype,"persistableViewModels",void 0),e([_()],A.prototype,"_isValid",void 0),e([_()],A.prototype,"_readyCycleForced",void 0),e([_()],A.prototype,"_currentSpatialReference",void 0),A=U=e([S("esri.views.View")],A);const G=A;export{G as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Map.js";import i from"../TimeExtent.js";import r from"../core/Accessor.js";import a from"../core/Collection.js";import s from"../core/CollectionFlattener.js";import o from"../core/Error.js";import n from"../core/Evented.js";import{HandleOwnerMixin as l}from"../core/HandleOwner.js";import{makeHandle as p}from"../core/handleUtils.js";import d from"../core/Loadable.js";import h from"../core/Logger.js";import{destroyMaybe as y,isSome as c,abortMaybe as u}from"../core/maybe.js";import{EsriPromiseMixin as m}from"../core/Promise.js";import{createTask as f,after as g}from"../core/promiseUtils.js";import{watch as w,whenOnce as v,when as M,sync as V}from"../core/reactiveUtils.js";import{aliasOf as R}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as _}from"../core/accessorSupport/decorators/property.js";import{subclass as S}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as j}from"../core/support/OwningCollection.js";import F from"../geometry/Extent.js";import O from"../geometry/HeightModelInfo.js";import L from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as b}from"../support/AnalysesCollection.js";import{GraphicsCollection as C}from"../support/GraphicsCollection.js";import{BasemapView as x}from"./BasemapView.js";import I from"./LayerViewManager.js";import q from"./Magnifier.js";import D from"./ToolViewManager.js";import T from"./input/Input.js";import{ViewEvents as k}from"./input/ViewEvents.js";import z from"./navigation/Navigation.js";import{DefaultsFromMap as P}from"./support/DefaultsFromMap.js";var U;const W=h.getLogger("esri.views.View");let A=U=class extends(l(n.EventedMixin(m(r)))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.allLayerViews=new s({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:e=>e.layerViews}),this.groundView=null,this.animation=null,this.basemapView=null,this.fatalError=null,this.extent=null,this.graphics=new C,this.analyses=new b,this.navigating=!1,this.typeSpecificPreconditionsReady=!0,this.layerViews=new a,this.magnifier=new q,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new T,this.navigation=new z,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new k(this),this.persistableViewModels=new a,this._isValid=!1,this._readyCycleForced=!1,this.handles.add(w((()=>this.preconditionsReady),(e=>{e?(this._currentSpatialReference=this.spatialReference,U.views.add(this)):(this._currentSpatialReference=null,U.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?(this.layerViewManager?.clear(),this.toolViewManager?.detach(),c(this.analysisViewManager)&&this.analysisViewManager.detach(),this._teardown()):e&&!this.ready&&(this._startup(),c(this.analysisViewManager)&&this.analysisViewManager.attach(),this.toolViewManager.attach())}),V))}initialize(){this.addResolvingPromise(this.validate().then((()=>(this._isValid=!0,v((()=>this.ready)))))),this.basemapView=new x({view:this}),this.layerViewManager=new I({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new D({view:this}),this._setupSpatialReferenceLogger(),this.handles.add([w((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),{sync:!0,initial:!0}),w((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),{sync:!0}),w((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let e=null;this.handles.add([w((()=>this.defaultsFromMap?.ready),(t=>{const i=this.map?.allLayers.length>0;if(t&&!this.spatialReference&&i){if(c(e))return;const t=p((()=>e=u(e)));e=f((async t=>{try{await g(this.spatialReferenceWarningDelay,null,t)}catch{return}finally{e=null}W.warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})),this.handles.add(t,"spatial-reference-logger-task")}else this.handles.remove("spatial-reference-logger-task")}),{sync:!0})])}destroy(){if(this.destroyed)return;this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.handles.remove("defaultsFromMap"),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.basemapView=y(this.basemapView),this.invalidate(),this._emitter.clear(),this.handles.removeAll();const e=this.map;this.map=null,e?.destroy()}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return W.error("#toMap()","Not implemented on this instance of View"),null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new P({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._currentSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}set map(e){e!==this._get("map")&&(e?.destroyed&&(W.warn("#map","The provided map is already destroyed",{map:e}),e=null),d.isLoadable(e)&&e.load().catch((()=>{})),this.initialized&&(this.forceReadyCycle(),this._currentSpatialReference=null),this._set("map",e))}get spatialReference(){let e=this._userSpatialReference||this._currentSpatialReference||this.getDefaultSpatialReference()||null;return e&&this.defaultsFromMap?.required?.heightModelInfo&&(e=e.clone(),e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),e}set spatialReference(e){const t=!E(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){const e=this.toolViewManager?this.toolViewManager.cursor:null;return c(e)?e:this._cursor||"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}whenLayerView(e){return this.layerViewManager.whenLayerView(e)}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}importLayerView(e){throw new o("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return c(this.getSpatialReferenceSupport({spatialReference:e}))}when(e,t){return this.isResolved()&&!this.ready&&W.warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(M((()=>!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};A.views=new a,e([_()],A.prototype,"_userSpatialReference",void 0),e([R("toolViewManager.activeTool")],A.prototype,"activeTool",void 0),e([_({readOnly:!0})],A.prototype,"allLayerViews",void 0),e([_()],A.prototype,"groundView",void 0),e([_()],A.prototype,"animation",void 0),e([_()],A.prototype,"basemapView",void 0),e([_({readOnly:!0})],A.prototype,"_defaultsFromMapSettings",null),e([_()],A.prototype,"defaultsFromMap",null),e([_()],A.prototype,"fatalError",void 0),e([_({type:F})],A.prototype,"extent",void 0),e([_(j(C,"graphics"))],A.prototype,"graphics",void 0),e([_(j(b,"analyses"))],A.prototype,"analyses",void 0),e([_({readOnly:!0,type:O})],A.prototype,"heightModelInfo",null),e([_({readOnly:!0})],A.prototype,"interacting",null),e([_({readOnly:!0})],A.prototype,"navigating",void 0),e([_({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_currentSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],A.prototype,"preconditionsReady",null),e([_({readOnly:!0})],A.prototype,"typeSpecificPreconditionsReady",void 0),e([_({type:a,readOnly:!0})],A.prototype,"layerViews",void 0),e([_({type:q})],A.prototype,"magnifier",void 0),e([_({value:null,type:t})],A.prototype,"map",null),e([_()],A.prototype,"padding",void 0),e([_({readOnly:!0})],A.prototype,"ready",void 0),e([_({type:L})],A.prototype,"spatialReference",null),e([_()],A.prototype,"spatialReferenceWarningDelay",void 0),e([_()],A.prototype,"stationary",null),e([_({readOnly:!0})],A.prototype,"supportsGround",void 0),e([_({type:i})],A.prototype,"timeExtent",void 0),e([R("toolViewManager.tools")],A.prototype,"tools",void 0),e([_()],A.prototype,"toolViewManager",void 0),e([_({readOnly:!0})],A.prototype,"type",void 0),e([_({type:Number})],A.prototype,"scale",void 0),e([_({readOnly:!0})],A.prototype,"updating",void 0),e([_({readOnly:!0})],A.prototype,"initialExtentRequired",void 0),e([_({readOnly:!0})],A.prototype,"initialExtent",null),e([_()],A.prototype,"cursor",null),e([_({readOnly:!0})],A.prototype,"input",void 0),e([_({type:z,nonNullable:!0})],A.prototype,"navigation",void 0),e([_()],A.prototype,"layerViewManager",void 0),e([_()],A.prototype,"analysisViewManager",void 0),e([_()],A.prototype,"width",void 0),e([_()],A.prototype,"height",void 0),e([_({readOnly:!0})],A.prototype,"resizing",void 0),e([_({value:null,readOnly:!0})],A.prototype,"size",null),e([_({readOnly:!0})],A.prototype,"suspended",void 0),e([_({readOnly:!0})],A.prototype,"viewEvents",void 0),e([_({readOnly:!0})],A.prototype,"persistableViewModels",void 0),e([_()],A.prototype,"_isValid",void 0),e([_()],A.prototype,"_readyCycleForced",void 0),e([_()],A.prototype,"_currentSpatialReference",void 0),A=U=e([S("esri.views.View")],A);const G=A;export{G as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Evented.js";import{HandleOwner as i}from"../../core/HandleOwner.js";import{clone as o}from"../../core/lang.js";import{isNone as n,isSome as r,destroyMaybe as s,unwrap as a,unwrapOr as p,equalsMaybe as l}from"../../core/maybe.js";import{ignoreAbortErrors as c}from"../../core/promiseUtils.js";import{createLength as h,createArea as d}from"../../core/quantityUtils.js";import{watch as m,syncAndInitial as g,initial as u}from"../../core/reactiveUtils.js";import{createScreenPoint as v}from"../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as y}from"../../core/unitUtils.js";import{property as _}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as x}from"../../core/accessorSupport/decorators/subclass.js";import{pointEquals as f}from"../../layers/graphics/dehydratedFeatureComparison.js";import{getConvertedElevation as T}from"../../support/elevationInfoUtils.js";import{ViewingMode as O}from"../ViewingMode.js";import{defaultDrawingMode as w}from"./DrawingMode.js";import{DrawManipulator as b}from"./DrawManipulator.js";import{createCoordinateHelper as V}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as S}from"../interactive/dragEventPipeline.js";import{EditGeometry as M,Component as D}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as C}from"../interactive/editGeometry/EditGeometryOperations.js";import I from"../interactive/sketch/SketchLabelOptions.js";import E from"../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as P}from"../interactive/snapping/SnappingContext.js";import{SnappingPipeline as j}from"../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as k}from"../interactive/snapping/SnappingOperation.js";import{DrawPolygonTooltipInfo as G,DrawPolylineTooltipInfo as H,DrawPointTooltipInfo as L}from"../interactive/tooltip/DrawTooltipInfos.js";import{Tooltip as Z}from"../interactive/tooltip/Tooltip.js";import{computeAreaWithStagedVertex as A,computeLengthWithStagedVertex as U}from"../interactive/tooltip/support/measurements.js";let z=class extends(e.EventedMixin(i)){constructor(t){super(t),this._createOperationCompleted=!1,this._pointerDownStates=new Set,this._snappingPipeline=new j,this._tooltip=null,this._tooltipContext={calculateElevation:null,calculateTotalLength:null,calculateArea:null},this.labelOptions=new I,this.tooltipOptions=new E,this.snapToSceneEnabled=null,n(t.elevationInfo)&&(this.elevationInfo={mode:t.hasZ?"absolute-height":"on-the-ground",offset:0})}initialize(){const{geometryType:t,view:e}=this,{spatialReference:i}=e,o="viewingMode"in e.state?e.state.viewingMode:O.Local,a="segment"===t||"multipoint"===t?"polyline":t;this.coordinateHelper=V(this.hasZ,this.hasM,i),this._editGeometryOperations=new C(new M(a,this.coordinateHelper)),this._snappingOperation=new k({view:e}),this.handles.add(m((()=>this.stagedVertex),(t=>{r(this._tooltip)&&this._updateTooltipInfo(),n(t)||this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(t)}],operation:"apply",type:"vertex-update"})}),{sync:!0,equals:(t,e)=>l(t,e,f)})),this._activeComponent=new D(i,o),this._editGeometryOperations.data.components.push(this._activeComponent);const p=this.segmentLabels;r(p)&&(p.context={view:e,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.handles.add([m((()=>this.labelOptions.enabled),(t=>{p.visible=t}),g),this.on("cursor-update",(()=>{const t=this.stagedVertex;p.stagedVertex=r(t)?this.coordinateHelper.pointToVector(t):null}))])),this.handles.add(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],(t=>{const e=t.vertices.map((t=>({componentIndex:0,vertexIndex:t.index,coordinates:this.coordinateHelper.vectorToArray(t.pos)}))),i=e.map((t=>t.coordinates));switch(t.type){case"vertex-add":this.emit(t.type,{...t,added:i,vertices:e});break;case"vertex-update":this.emit(t.type,{...t,updated:i,vertices:e});break;case"vertex-remove":this.emit(t.type,{...t,removed:i,vertices:e})}}))),this._manipulator=new b({grabbableForEvent:t=>"click"!==this.drawingMode||"touch"===t.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size}),this.manipulators.add(this._manipulator),this._manipulator.grabbable="point"!==t,this.handles.add([this._createManipulatorDragPipeline(this._manipulator),this._manipulator.events.on("immediate-click",(t=>this._onImmediateClick(t))),this._manipulator.events.on("immediate-double-click",(t=>this._onImmediateDoubleClick(t))),m((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new Z({view:e,info:this._getTooltipInfo()}):s(this._tooltip)}),u)])}destroy(){s(this.segmentLabels),s(this._snappingOperation),this._tooltip=s(this._tooltip),this._editGeometryOperations=s(this._editGeometryOperations)}get _snappingEnabled(){return r(this.snappingManager)&&this.snappingManager.options.effectiveEnabled}get _defaultElevation(){return h(this.defaultZ,"meters")}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map((t=>this.coordinateHelper.vectorToArray(t.pos)))}set drawingMode(t){this._set("drawingMode",t??w)}get interactive(){return this._manipulator.interactive}set interactive(t){this._manipulator.interactive=t}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get numVertices(){return r(this.stagedVertex)?this._activeComponent.vertices.length+1:this._activeComponent.vertices.length}get stagedVertex(){return this._snappingOperation.stagedPoint}set stagedVertex(t){this._snappingOperation.stagedPoint=o(t)}get updating(){return this.updatingHandles.updating}get vertices(){const t=this.committedVertices;return r(this.stagedVertex)&&t.push(this.coordinateHelper.pointToArray(this.stagedVertex)),t}cancel(){this.complete({aborted:!0})}commitStagedVertex(){if(this._snappingOperation.abort(),r(this.stagedVertex)){const{stagedVertex:t}=this;this.stagedVertex=null,this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(t))}}complete(t){const e=t&&t.aborted||!1;this._snappingOperation.abort(),r(this.snappingManager)&&this.snappingManager.doneSnapping(),"segment"===this.geometryType||"point"===this.geometryType?this.commitStagedVertex():this.stagedVertex=null;const i="multipoint"===this.geometryType&&0===this.numVertices||"polyline"===this.geometryType&&this.numVertices<2||"polygon"===this.geometryType&&this.numVertices<3;this._createOperationCompleted=!i,(this.isCompleted||e)&&this.emit("complete",{vertices:this.vertices.map(((t,e)=>({componentIndex:0,vertexIndex:e,coordinates:t}))),aborted:e,type:"complete"})}onInputEvent(t){switch(t.type){case"pointer-down":this._pointerDownStates.add(t.pointerId);break;case"pointer-up":this._pointerDownStates.delete(t.pointerId)}switch(t.type){case"pointer-move":return this._onPointerMove(t);case"hold":return this._onHold(t)}}redo(){this._editGeometryOperations.redo()}undo(){r(this.snappingManager)&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_closeOnClickVertexIndex(t){const e=this._activeComponent;if("polygon"===this.geometryType&&e.vertices.length>2){if(this._vertexWithinPointerDistance(e.vertices[0].pos,t))return 0;if(this._vertexWithinPointerDistance(e.vertices[e.vertices.length-1].pos,t))return e.vertices.length-1}return null}_createManipulatorDragPipeline(t){switch(a(this.drawingMode)){case"click":return this._createManipulatorDragPipelineClick(t);case"freehand":return this._createManipulatorDragPipelineFreehand(t);case"hybrid":return this._createManipulatorDragPipelineHybrid(t)}}_createManipulatorDragPipelineClick(t){return S(t,((t,e,i,o)=>{const n="touch"===o&&this._snappingEnabled;!this.isCompleted&&n&&(e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(this.stagedVertex=t.mapStart,("segment"===this.geometryType||n&&0===this.numVertices)&&this.commitStagedVertex()),t))).next(this._snappingPipeline.createSnapDragEventPipelineStep({predicate:()=>n,cancel:i,snappingManager:this.snappingManager,snappingContext:new P({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:o,visualizer:this.snappingVisualizer}),updatingHandles:this.updatingHandles}),this._snappingPipeline.next).next((t=>(n&&(this.stagedVertex=t.mapEnd,"end"===t.action&&this.commitStagedVertex()),t))).next((t=>("end"===t.action&&("segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()),t))),i.next((()=>{n&&r(this.snappingManager)&&this.snappingManager.doneSnapping()})))}))}_createManipulatorDragPipelineFreehand(t){return S(t,((t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(n(this.stagedVertex)&&(this.stagedVertex=t.mapStart),"segment"===this.geometryType&&this.commitStagedVertex()),t))).next((t=>{switch(t.action){case"start":case"update":this.stagedVertex=t.mapEnd,"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":this.complete()}return t}))}))}_createManipulatorDragPipelineHybrid(t){return S(t,((t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(n(this.stagedVertex)&&(this.stagedVertex=t.mapStart),this.commitStagedVertex()),t))).next((t=>{switch(t.action){case"start":case"update":this.stagedVertex=t.mapEnd,"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()}return t}))}))}_getDrawSurface(){if(n(this.elevationDrawSurface))return this.drawSurface;if(!this.coordinateHelper.hasZ)return this.elevationDrawSurface.defaultZ=null,this.elevationDrawSurface;let t=this.defaultZ,e=!1;r(this.elevationInfo)&&"absolute-height"===this.elevationInfo.mode&&(e=!0),r(this.snapToSceneEnabled)&&(e=this.snapToSceneEnabled),r(this.elevationInfo)&&"on-the-ground"===this.elevationInfo.mode&&(e=!1);const i=this._activeComponent.vertices.length;return("segment"===this.geometryType||"polygon"===this.geometryType)&&i>0&&(t=this.coordinateHelper.getZ(this._activeComponent.vertices[0].pos),e=!1),e?this.drawSurface:(this.elevationDrawSurface.defaultZ=t,this.elevationDrawSurface)}_mapToScreen(t){return this._getDrawSurface().mapToScreen(t)}_onHold(t){this._snappingOperation.abort(),"click"===this.drawingMode&&"touch"===t.pointerType&&this._snappingEnabled&&(this.stagedVertex=t.mapPoint),t.stopPropagation()}_onImmediateClick(t){if("mouse"===t.pointerType&&2===t.button||this._manipulator.dragging)return;const e=this._activeComponent,i=this._closeOnClickVertexIndex(t.screenPoint);if(r(i))return t.stopPropagation(),void this.complete();const o=this._screenToMap(t.screenPoint);if(r(o))switch(this.drawingMode){case"freehand":"point"===this.geometryType&&(r(this.stagedVertex)?this.commitStagedVertex():this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(o)),this.complete());break;case"click":case"hybrid":this._snappingOperation.abort(),r(this.stagedVertex)?this.commitStagedVertex():this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(o)),("point"===this.geometryType||"segment"===this.geometryType&&2===e.vertices.length||"segment"===this.geometryType&&"hybrid"===this.drawingMode&&1===e.vertices.length)&&this.complete()}t.stopPropagation()}_onImmediateDoubleClick(t){this._manipulator.dragging||"point"===this.geometryType||(this.complete(),t.stopPropagation())}_onPointerMove(t){const e=v(t.x,t.y);if(this._manipulator.dragging||this._pointerDownStates.has(t.pointerId)||this._manipulator.grabbing||!this._manipulator.interactive)return void this._snappingOperation.abort();t.stopPropagation();const i=this._closeOnClickVertexIndex(e);if(r(i))return this._closeOnVertex(i),void this._snappingOperation.abort();const o=this._screenToMap(e);if(this._manipulator.cursor=r(o)?"crosshair":null,n(o))return void this._snappingOperation.abort();if(n(this.snappingManager))return this.stagedVertex=o,void this._snappingOperation.abort();const s=this.snappingManager,a=new P({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:t.pointerType,visualizer:this.snappingVisualizer});this.updatingHandles.addPromise(c(this._snappingOperation.snap(o,s,a)))}_closeOnVertex(t){this.stagedVertex=null;const e={componentIndex:0,vertexIndex:t,coordinates:this.coordinateHelper.vectorToArray(this._activeComponent.vertices[t].pos)};this.emit("cursor-update",{updated:null,vertices:[e],operation:"apply",type:"vertex-update"})}_screenToMap(t){return this._getDrawSurface().screenToMap(t)}_screenToMapDragEventStep(){let t=null;return e=>{if("start"===e.action&&(t=this._screenToMap(e.screenStart)),n(t))return null;const i=this._screenToMap(e.screenEnd);return r(i)?{...e,mapStart:t,mapEnd:i}:null}}_vertexWithinPointerDistance(t,e){const i=25,o=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(t));return!!r(o)&&F(o,e,i)}_calculateVertexTooltipElevation(t){const{tooltipOptions:e,view:i}=this;if(n(t)||"2d"===i.type)return this._defaultElevation;const o=this.elevationInfo,r=e.elevation.mode,{spatialReference:s}=t,a=y(s),p=T(i,t,o,{mode:r,offset:0});return h(p*a,"meters")}_getTooltipInfo(){const{tooltipOptions:t}=this;if(!t.enabled)return null;this._tooltipContext.calculateElevation=t=>this._calculateVertexTooltipElevation(t);const{stagedVertex:e}=this,i=this._elevationTooltipDetail(e);switch(this.geometryType){case"point":return new L({tooltipOptions:t,elevation:i});case"polyline":return this._tooltipContext.calculateTotalLength=t=>U(this._editGeometryOperations.data.geometry)(t),new H({tooltipOptions:t,elevation:i,totalLength:this._totalLengthTooltipDetail(e)});case"polygon":return this._tooltipContext.calculateArea=t=>A(this._editGeometryOperations.data.geometry)(t),new G({tooltipOptions:t,elevation:i,area:this._areaTooltipDetail(e)});default:return null}}_elevationTooltipDetail(t){return{mode:this.elevationInfo.mode,...a(this._tooltipContext.calculateElevation)(t)}}_totalLengthTooltipDetail(t){return{...p(a(this._tooltipContext.calculateTotalLength)(t),h(0,"meters"))}}_areaTooltipDetail(t){return{...p(a(this._tooltipContext.calculateArea)(t),d(0,"square-meters"))}}_updateTooltipInfo(){const t=this._tooltip;if(n(t))return;const{stagedVertex:e}=this,i=this._elevationTooltipDetail(e);switch(this.geometryType){case"point":t.info.elevation=i;break;case"polyline":{const o=t.info;o.elevation=i,o.totalLength=this._totalLengthTooltipDetail(e);break}case"polygon":{const o=t.info;o.elevation=i,o.area=this._areaTooltipDetail(e);break}}}get test(){return{tooltip:this._tooltip}}};function F(t,e,i){const o=t.x-e.x,n=t.y-e.y;return o*o+n*n<=i}t([_()],z.prototype,"_defaultElevation",null),t([_()],z.prototype,"defaultZ",void 0),t([_({value:w})],z.prototype,"drawingMode",null),t([_({constructOnly:!0})],z.prototype,"elevationDrawSurface",void 0),t([_({constructOnly:!0})],z.prototype,"elevationInfo",void 0),t([_({constructOnly:!0,type:I})],z.prototype,"labelOptions",void 0),t([_({constructOnly:!0,type:E})],z.prototype,"tooltipOptions",void 0),t([_({constructOnly:!0})],z.prototype,"geometryType",void 0),t([_({constructOnly:!0})],z.prototype,"hasM",void 0),t([_({constructOnly:!0})],z.prototype,"hasZ",void 0),t([_({constructOnly:!0})],z.prototype,"manipulators",void 0),t([_({constructOnly:!0})],z.prototype,"drawSurface",void 0),t([_({constructOnly:!0})],z.prototype,"segmentLabels",void 0),t([_({constructOnly:!0})],z.prototype,"snappingManager",void 0),t([_({constructOnly:!0})],z.prototype,"snappingVisualizer",void 0),t([_()],z.prototype,"snapToSceneEnabled",void 0),t([_()],z.prototype,"_snappingOperation",void 0),t([_()],z.prototype,"stagedVertex",null),t([_()],z.prototype,"updating",null),t([_({constructOnly:!0})],z.prototype,"view",void 0),z=t([x("esri.views.draw.DrawOperation")],z);export{z as DrawOperation};
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Evented.js";import{HandleOwner as i}from"../../core/HandleOwner.js";import{clone as o}from"../../core/lang.js";import{isNone as n,isSome as r,applySome as s,destroyMaybe as a,unwrap as p,unwrapOr as l,equalsMaybe as c}from"../../core/maybe.js";import{ignoreAbortErrors as h}from"../../core/promiseUtils.js";import{createLength as d,createArea as m}from"../../core/quantityUtils.js";import{watch as g,syncAndInitial as u,initial as v}from"../../core/reactiveUtils.js";import{createScreenPoint as y}from"../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as _}from"../../core/unitUtils.js";import{property as x}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import{pointEquals as T}from"../../layers/graphics/dehydratedFeatureComparison.js";import{getConvertedElevation as O}from"../../support/elevationInfoUtils.js";import{ViewingMode as w}from"../ViewingMode.js";import{defaultDrawingMode as b}from"./DrawingMode.js";import{DrawManipulator as V}from"./DrawManipulator.js";import{createCoordinateHelper as S}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as M}from"../interactive/dragEventPipeline.js";import{EditGeometry as D,Component as I}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as C}from"../interactive/editGeometry/EditGeometryOperations.js";import E from"../interactive/sketch/SketchLabelOptions.js";import P from"../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as j}from"../interactive/snapping/SnappingContext.js";import{SnappingPipeline as k}from"../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as G}from"../interactive/snapping/SnappingOperation.js";import{DrawPolygonTooltipInfo as H,DrawPolylineTooltipInfo as L,DrawPointTooltipInfo as Z}from"../interactive/tooltip/DrawTooltipInfos.js";import{Tooltip as A}from"../interactive/tooltip/Tooltip.js";import{computeAreaWithStagedVertex as U,computeLengthWithStagedVertex as z}from"../interactive/tooltip/support/measurements.js";let F=class extends(e.EventedMixin(i)){constructor(t){super(t),this._createOperationCompleted=!1,this._pointerDownStates=new Set,this._snappingPipeline=new k,this._tooltip=null,this._tooltipContext={calculateElevation:null,calculateTotalLength:null,calculateArea:null},this.labelOptions=new E,this.tooltipOptions=new P,this.snapToSceneEnabled=null,n(t.elevationInfo)&&(this.elevationInfo={mode:t.hasZ?"absolute-height":"on-the-ground",offset:0})}initialize(){const{geometryType:t,view:e}=this,{spatialReference:i}=e,o="viewingMode"in e.state?e.state.viewingMode:w.Local,p="segment"===t||"multipoint"===t?"polyline":t;this.coordinateHelper=S(this.hasZ,this.hasM,i),this._editGeometryOperations=new C(new D(p,this.coordinateHelper)),this._snappingOperation=new G({view:e}),this.handles.add(g((()=>this.stagedVertex),(t=>{r(this._tooltip)&&this._updateTooltipInfo(),n(t)||this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(t)}],operation:"apply",type:"vertex-update"})}),{sync:!0,equals:(t,e)=>c(t,e,T)})),this._activeComponent=new I(i,o),this._editGeometryOperations.data.components.push(this._activeComponent);const l=this.segmentLabels;r(l)&&(l.context={view:e,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.handles.add([g((()=>this.labelOptions.enabled),(t=>{l.visible=t}),u),this.on("cursor-update",(()=>{const t=this.stagedVertex;l.stagedVertex=r(t)?this.coordinateHelper.pointToVector(t):null}))])),this.handles.add(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],(t=>{const e=t.vertices.map((t=>({componentIndex:0,vertexIndex:t.index,coordinates:this.coordinateHelper.vectorToArray(t.pos)}))),i=e.map((t=>t.coordinates));switch(t.type){case"vertex-add":this.emit(t.type,{...t,added:i,vertices:e});break;case"vertex-update":this.emit(t.type,{...t,updated:i,vertices:e});break;case"vertex-remove":this.emit(t.type,{...t,removed:i,vertices:e})}}))),this._manipulator=new V({grabbableForEvent:t=>"click"!==this.drawingMode||"touch"===t.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size}),this.manipulators.add(this._manipulator),this._manipulator.grabbable="point"!==t,this.handles.add([this._createManipulatorDragPipeline(this._manipulator),this._manipulator.events.on("immediate-click",(t=>this._onImmediateClick(t))),this._manipulator.events.on("immediate-double-click",(t=>this._onImmediateDoubleClick(t))),g((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new A({view:e,info:this._getTooltipInfo()}):a(this._tooltip)}),v),this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],(()=>s(this._tooltip,(t=>{t.info=this._getTooltipInfo()}))))])}destroy(){a(this.segmentLabels),a(this._snappingOperation),this._tooltip=a(this._tooltip),this._editGeometryOperations=a(this._editGeometryOperations)}get _snappingEnabled(){return r(this.snappingManager)&&this.snappingManager.options.effectiveEnabled}get _defaultElevation(){return d(this.defaultZ,"meters")}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map((t=>this.coordinateHelper.vectorToArray(t.pos)))}set drawingMode(t){this._set("drawingMode",t??b)}get interactive(){return this._manipulator.interactive}set interactive(t){this._manipulator.interactive=t}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get numVertices(){return r(this.stagedVertex)?this._activeComponent.vertices.length+1:this._activeComponent.vertices.length}get stagedVertex(){return this._snappingOperation.stagedPoint}set stagedVertex(t){this._snappingOperation.stagedPoint=o(t)}get updating(){return this.updatingHandles.updating}get vertices(){const t=this.committedVertices;return r(this.stagedVertex)&&t.push(this.coordinateHelper.pointToArray(this.stagedVertex)),t}cancel(){this.complete({aborted:!0})}commitStagedVertex(){if(this._snappingOperation.abort(),r(this.stagedVertex)){const{stagedVertex:t}=this;this.stagedVertex=null,this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(t))}}complete(t){const e=t&&t.aborted||!1;this._snappingOperation.abort(),r(this.snappingManager)&&this.snappingManager.doneSnapping(),"segment"===this.geometryType||"point"===this.geometryType?this.commitStagedVertex():this.stagedVertex=null;const i="multipoint"===this.geometryType&&0===this.numVertices||"polyline"===this.geometryType&&this.numVertices<2||"polygon"===this.geometryType&&this.numVertices<3;this._createOperationCompleted=!i,(this.isCompleted||e)&&this.emit("complete",{vertices:this.vertices.map(((t,e)=>({componentIndex:0,vertexIndex:e,coordinates:t}))),aborted:e,type:"complete"})}onInputEvent(t){switch(t.type){case"pointer-down":this._pointerDownStates.add(t.pointerId);break;case"pointer-up":this._pointerDownStates.delete(t.pointerId)}switch(t.type){case"pointer-move":return this._onPointerMove(t);case"hold":return this._onHold(t)}}redo(){this._editGeometryOperations.redo()}undo(){r(this.snappingManager)&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_closeOnClickVertexIndex(t){const e=this._activeComponent;if("polygon"===this.geometryType&&e.vertices.length>2){if(this._vertexWithinPointerDistance(e.vertices[0].pos,t))return 0;if(this._vertexWithinPointerDistance(e.vertices[e.vertices.length-1].pos,t))return e.vertices.length-1}return null}_createManipulatorDragPipeline(t){switch(p(this.drawingMode)){case"click":return this._createManipulatorDragPipelineClick(t);case"freehand":return this._createManipulatorDragPipelineFreehand(t);case"hybrid":return this._createManipulatorDragPipelineHybrid(t)}}_createManipulatorDragPipelineClick(t){return M(t,((t,e,i,o)=>{const n="touch"===o&&this._snappingEnabled;!this.isCompleted&&n&&(e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(this.stagedVertex=t.mapStart,("segment"===this.geometryType||n&&0===this.numVertices)&&this.commitStagedVertex()),t))).next(this._snappingPipeline.createSnapDragEventPipelineStep({predicate:()=>n,cancel:i,snappingManager:this.snappingManager,snappingContext:new j({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:o,visualizer:this.snappingVisualizer}),updatingHandles:this.updatingHandles}),this._snappingPipeline.next).next((t=>(n&&(this.stagedVertex=t.mapEnd,"end"===t.action&&this.commitStagedVertex()),t))).next((t=>("end"===t.action&&("segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()),t))),i.next((()=>{n&&r(this.snappingManager)&&this.snappingManager.doneSnapping()})))}))}_createManipulatorDragPipelineFreehand(t){return M(t,((t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(n(this.stagedVertex)&&(this.stagedVertex=t.mapStart),"segment"===this.geometryType&&this.commitStagedVertex()),t))).next((t=>{switch(t.action){case"start":case"update":this.stagedVertex=t.mapEnd,"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":this.complete()}return t}))}))}_createManipulatorDragPipelineHybrid(t){return M(t,((t,e)=>{this.isCompleted||e.next(this._screenToMapDragEventStep()).next((t=>("start"===t.action&&(n(this.stagedVertex)&&(this.stagedVertex=t.mapStart),this.commitStagedVertex()),t))).next((t=>{switch(t.action){case"start":case"update":this.stagedVertex=t.mapEnd,"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()}return t}))}))}_getDrawSurface(){if(n(this.elevationDrawSurface))return this.drawSurface;if(!this.coordinateHelper.hasZ)return this.elevationDrawSurface.defaultZ=null,this.elevationDrawSurface;let t=this.defaultZ,e=!1;r(this.elevationInfo)&&"absolute-height"===this.elevationInfo.mode&&(e=!0),r(this.snapToSceneEnabled)&&(e=this.snapToSceneEnabled),r(this.elevationInfo)&&"on-the-ground"===this.elevationInfo.mode&&(e=!1);const i=this._activeComponent.vertices.length;return("segment"===this.geometryType||"polygon"===this.geometryType)&&i>0&&(t=this.coordinateHelper.getZ(this._activeComponent.vertices[0].pos),e=!1),e?this.drawSurface:(this.elevationDrawSurface.defaultZ=t,this.elevationDrawSurface)}_mapToScreen(t){return this._getDrawSurface().mapToScreen(t)}_onHold(t){this._snappingOperation.abort(),"click"===this.drawingMode&&"touch"===t.pointerType&&this._snappingEnabled&&(this.stagedVertex=t.mapPoint),t.stopPropagation()}_onImmediateClick(t){if("mouse"===t.pointerType&&2===t.button||this._manipulator.dragging)return;const e=this._activeComponent,i=this._closeOnClickVertexIndex(t.screenPoint);if(r(i))return t.stopPropagation(),void this.complete();const o=this._screenToMap(t.screenPoint);if(r(o))switch(this.drawingMode){case"freehand":"point"===this.geometryType&&(r(this.stagedVertex)?this.commitStagedVertex():this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(o)),this.complete());break;case"click":case"hybrid":this._snappingOperation.abort(),r(this.stagedVertex)?this.commitStagedVertex():this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(o)),("point"===this.geometryType||"segment"===this.geometryType&&2===e.vertices.length||"segment"===this.geometryType&&"hybrid"===this.drawingMode&&1===e.vertices.length)&&this.complete()}t.stopPropagation()}_onImmediateDoubleClick(t){this._manipulator.dragging||"point"===this.geometryType||(this.complete(),t.stopPropagation())}_onPointerMove(t){const e=y(t.x,t.y);if(this._manipulator.dragging||this._pointerDownStates.has(t.pointerId)||this._manipulator.grabbing||!this._manipulator.interactive)return void this._snappingOperation.abort();t.stopPropagation();const i=this._closeOnClickVertexIndex(e);if(r(i))return this._closeOnVertex(i),void this._snappingOperation.abort();const o=this._screenToMap(e);if(this._manipulator.cursor=r(o)?"crosshair":null,n(o))return void this._snappingOperation.abort();if(n(this.snappingManager))return this.stagedVertex=o,void this._snappingOperation.abort();const s=this.snappingManager,a=new j({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:t.pointerType,visualizer:this.snappingVisualizer});this.updatingHandles.addPromise(h(this._snappingOperation.snap(o,s,a)))}_closeOnVertex(t){this.stagedVertex=null;const e={componentIndex:0,vertexIndex:t,coordinates:this.coordinateHelper.vectorToArray(this._activeComponent.vertices[t].pos)};this.emit("cursor-update",{updated:null,vertices:[e],operation:"apply",type:"vertex-update"})}_screenToMap(t){return this._getDrawSurface().screenToMap(t)}_screenToMapDragEventStep(){let t=null;return e=>{if("start"===e.action&&(t=this._screenToMap(e.screenStart)),n(t))return null;const i=this._screenToMap(e.screenEnd);return r(i)?{...e,mapStart:t,mapEnd:i}:null}}_vertexWithinPointerDistance(t,e){const i=25,o=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(t));return!!r(o)&&R(o,e,i)}_calculateVertexTooltipElevation(t){const{tooltipOptions:e,view:i}=this;if(n(t)||"2d"===i.type)return this._defaultElevation;const o=this.elevationInfo,r=e.elevation.mode,{spatialReference:s}=t,a=_(s),p=O(i,t,o,{mode:r,offset:0});return d(p*a,"meters")}_getTooltipInfo(){const{tooltipOptions:t}=this;if(!t.enabled)return null;this._tooltipContext.calculateElevation=t=>this._calculateVertexTooltipElevation(t);const{stagedVertex:e}=this,i=this._elevationTooltipDetail(e);switch(this.geometryType){case"point":return new Z({tooltipOptions:t,elevation:i});case"polyline":return this._tooltipContext.calculateTotalLength=z(this._editGeometryOperations.data.geometry),new L({tooltipOptions:t,elevation:i,totalLength:this._totalLengthTooltipDetail(e)});case"polygon":return this._tooltipContext.calculateArea=U(this._editGeometryOperations.data.geometry),new H({tooltipOptions:t,elevation:i,area:this._areaTooltipDetail(e)});default:return null}}_elevationTooltipDetail(t){return{mode:this.elevationInfo.mode,...p(this._tooltipContext.calculateElevation)(t)}}_totalLengthTooltipDetail(t){return{...l(p(this._tooltipContext.calculateTotalLength)(t),d(0,"meters"))}}_areaTooltipDetail(t){return{...l(p(this._tooltipContext.calculateArea)(t),m(0,"square-meters"))}}_updateTooltipInfo(){const t=this._tooltip;if(n(t))return;const{stagedVertex:e}=this,i=this._elevationTooltipDetail(e);switch(this.geometryType){case"point":t.info.elevation=i;break;case"polyline":{const o=t.info;o.elevation=i,o.totalLength=this._totalLengthTooltipDetail(e);break}case"polygon":{const o=t.info;o.elevation=i,o.area=this._areaTooltipDetail(e);break}}}get test(){return{tooltip:this._tooltip}}};function R(t,e,i){const o=t.x-e.x,n=t.y-e.y;return o*o+n*n<=i}t([x()],F.prototype,"_defaultElevation",null),t([x()],F.prototype,"defaultZ",void 0),t([x({value:b})],F.prototype,"drawingMode",null),t([x({constructOnly:!0})],F.prototype,"elevationDrawSurface",void 0),t([x({constructOnly:!0})],F.prototype,"elevationInfo",void 0),t([x({constructOnly:!0,type:E})],F.prototype,"labelOptions",void 0),t([x({constructOnly:!0,type:P})],F.prototype,"tooltipOptions",void 0),t([x({constructOnly:!0})],F.prototype,"geometryType",void 0),t([x({constructOnly:!0})],F.prototype,"hasM",void 0),t([x({constructOnly:!0})],F.prototype,"hasZ",void 0),t([x({constructOnly:!0})],F.prototype,"manipulators",void 0),t([x({constructOnly:!0})],F.prototype,"drawSurface",void 0),t([x({constructOnly:!0})],F.prototype,"segmentLabels",void 0),t([x({constructOnly:!0})],F.prototype,"snappingManager",void 0),t([x({constructOnly:!0})],F.prototype,"snappingVisualizer",void 0),t([x()],F.prototype,"snapToSceneEnabled",void 0),t([x()],F.prototype,"_snappingOperation",void 0),t([x()],F.prototype,"stagedVertex",null),t([x()],F.prototype,"updating",null),t([x({constructOnly:!0})],F.prototype,"view",void 0),F=t([f("esri.views.draw.DrawOperation")],F);export{F as DrawOperation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as i}from"../../../chunks/tslib.es6.js";import"../../../symbols.js";import t from"../../../core/Evented.js";import e from"../../../core/Handles.js";import{clone as s}from"../../../core/lang.js";import{destroyMaybe as r,
|
|
5
|
+
import{_ as i}from"../../../chunks/tslib.es6.js";import"../../../symbols.js";import t from"../../../core/Evented.js";import e from"../../../core/Handles.js";import{clone as s}from"../../../core/lang.js";import{destroyMaybe as r,isSome as h,isNone as a}from"../../../core/maybe.js";import{watch as o,when as c}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../layers/GraphicsLayer.js";import{cloneMove as d}from"./drawUtils.js";import v from"./HighlightHelper.js";import{addUniqueLayer as g,findLayerView as _}from"./layerUtils.js";import{GraphicClickEvent as m,GraphicDoubleClickEvent as y,GraphicPointerDownEvent as u,GraphicPointerUpEvent as f,GraphicPointerOutEvent as w,GraphicMoveStartEvent as G,GraphicMoveEvent as b,GraphicMoveStopEvent as k,GraphicPointerOverEvent as O}from"./input/GraphicMoverEvents.js";import{ViewEventPriorities as H}from"../../input/InputManager.js";import{GraphicManipulator as M}from"../../interactive/GraphicManipulator.js";import{createScreenPointFromEvent as x}from"../../support/screenUtils.js";import E from"../../../symbols/SimpleMarkerSymbol.js";import j from"../../../symbols/SimpleLineSymbol.js";import U from"../../../symbols/SimpleFillSymbol.js";const P="indicator-symbols";let S=class extends t.EventedAccessor{constructor(i){super(i),this._activeGraphic=null,this._dragEvent=null,this._handles=new e,this._hoverGraphic=null,this._indicators=[],this._initialDragGeometry=null,this._viewHandles=new e,this._manipulators=[],this._layerViews=null,this.type="graphic-mover",this.callbacks={onGraphicClick(){},onGraphicDoubleClick(){},onGraphicMoveStart(){},onGraphicMove(){},onGraphicMoveStop(){},onGraphicPointerOver(){},onGraphicPointerOut(){},onGraphicPointerDown(){},onGraphicPointerUp(){}},this.enableMoveAllGraphics=!1,this.graphics=[],this.indicatorsEnabled=!1,this.layer=new p({listMode:"hide",internal:!0,title:"GraphicMover highlight layer"}),this.view=null}initialize(){g(this.view,this.layer),this._highlightHelper=new v({view:this.view}),this.refresh(),this._handles.add([o((()=>[this.graphics,this.graphics?.length]),(()=>this.refresh())),c((()=>this.view?.ready),(()=>{this._viewHandles.add([this.view.on("immediate-click",(i=>this._clickHandler(i)),H.TOOL),this.view.on("double-click",(i=>this._doubleClickHandler(i)),H.TOOL),this.view.on("pointer-down",(i=>this._pointerDownHandler(i)),H.TOOL),this.view.on("pointer-move",(i=>this._pointerMoveHandler(i)),H.TOOL),this.view.on("pointer-up",(i=>this._pointerUpHandler(i)),H.TOOL),this.view.on("drag",(i=>this._dragHandler(i)),H.TOOL),this.view.on("key-down",(i=>this._keyDownHandler(i)),H.TOOL)])}),{once:!0,initial:!0}),o((()=>this.view),(i=>{this._highlightHelper.removeAll(),this._highlightHelper.view=i}))])}destroy(){this._removeIndicators(),this.view.map?.remove(this.layer),this.layer.destroy(),this.reset(),this._manipulators.forEach((i=>i.destroy())),this._manipulators=null,this._handles=r(this._handles),this._viewHandles=r(this._viewHandles)}set highlightsEnabled(i){this._highlightHelper?.removeAll(),this._set("highlightsEnabled",i),i&&this._highlightHelper?.add(this.graphics)}get state(){const i=!!this.get("view.ready"),t=!!this.get("graphics.length"),e=this._activeGraphic;return i&&t?e?"moving":"active":i?"ready":"disabled"}refresh(){this.reset(),this._setup()}reset(){this._activeGraphic=null,this._hoverGraphic=null,this._dragEvent=null,this._highlightHelper.removeAll()}updateGeometry(i,t){const e=this.graphics[i];e&&(e.set("geometry",t),this._setUpIndicators())}_setup(){this._setUpHighlights(),this._setUpIndicators(),this._setUpManipulators(),this._syncLayerViews()}_clickHandler(i){const t=this._findTargetGraphic(x(i));if(t){const e=new m(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e)}}_doubleClickHandler(i){const t=this._findTargetGraphic(x(i));if(t){const e=new y(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-double-click",e),this.callbacks.onGraphicDoubleClick&&this.callbacks.onGraphicDoubleClick(e)}}_pointerDownHandler(i){const t=this._findTargetGraphic(x(i));if(t){this._activeGraphic=t;const{x:e,y:s}=i,r=new u(t,this.graphics.indexOf(t),e,s,i);this.emit("graphic-pointer-down",r),this.callbacks.onGraphicPointerDown&&this.callbacks.onGraphicPointerDown(r)}else this._activeGraphic=null}_pointerUpHandler(i){if(this._activeGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._activeGraphic),r=new f(this._activeGraphic,s,t,e,i);this.emit("graphic-pointer-up",r),this.callbacks.onGraphicPointerUp&&this.callbacks.onGraphicPointerUp(r)}}_pointerMoveHandler(i){if(this._dragEvent)return;const t=this._findTargetGraphic(x(i));if(t){const{x:e,y:s}=i;if(this._hoverGraphic){if(this._hoverGraphic===t)return;const r=this.graphics.indexOf(this._hoverGraphic),h=new w(this.graphics[r],r,e,s,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",h),this.callbacks.onGraphicPointerOut&&this.callbacks.onGraphicPointerOut(h)}const r=this.graphics.indexOf(t),h=new O(t,r,e,s,i);return this._hoverGraphic=t,this.emit("graphic-pointer-over",h),void(this.callbacks.onGraphicPointerOver&&this.callbacks.onGraphicPointerOver(h))}if(this._hoverGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._hoverGraphic),r=new w(this.graphics[s],s,t,e,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",r),this.callbacks.onGraphicPointerOut&&this.callbacks.onGraphicPointerOut(r)}}_dragHandler(i){if("start"!==i.action&&!this._dragEvent||!this._activeGraphic||!this._activeGraphic.geometry)return;"start"===i.action&&this._removeIndicators(),i.stopPropagation();const{action:t,x:e,y:r}=i,h=this.graphics.indexOf(this._activeGraphic),a=this._dragEvent?e-this._dragEvent.x:0,o=this._dragEvent?r-this._dragEvent.y:0,c=e-i.origin.x,n=r-i.origin.y,l="start"===t?this._activeGraphic.geometry:this._initialDragGeometry,p=d(l,c,n,this.view);if(this._activeGraphic.geometry=p,this.enableMoveAllGraphics&&this.graphics.forEach((i=>{i!==this._activeGraphic&&(i.geometry=d(i.geometry,a,o,this.view))})),this._dragEvent=i,"start"===t){this._initialDragGeometry=s(l);const t=new G(this._activeGraphic,this.graphics,h,e,r,a,o,c,n,i);this.emit("graphic-move-start",t),this.callbacks.onGraphicMoveStart&&this.callbacks.onGraphicMoveStart(t),t.defaultPrevented&&this._activeGraphic.set("geometry",l)}else if("update"===t){const t=new b(this._activeGraphic,this.graphics,h,e,r,a,o,c,n,i);this.emit("graphic-move",t),this.callbacks.onGraphicMove&&this.callbacks.onGraphicMove(t),t.defaultPrevented&&(this._activeGraphic.geometry=l)}else{const t=new k(this._activeGraphic,this.graphics,h,e,r,a,o,c,n,i);this._dragEvent=null,this._activeGraphic=null,this._setUpIndicators(),this.emit("graphic-move-stop",t),this.callbacks.onGraphicMoveStop&&this.callbacks.onGraphicMoveStop(t),t.defaultPrevented&&(this.graphics[h].set("geometry",this._initialDragGeometry),this._setUpIndicators()),this._initialDragGeometry=null}}_keyDownHandler(i){"a"!==i.key&&"d"!==i.key&&"n"!==i.key||"moving"!==this.state||i.stopPropagation()}_findTargetGraphic(i){const t=this.view.toMap(i);let e=null,s=Number.MAX_VALUE;this._syncLayerViews();const r=this._layerViews.flatMap((i=>"graphicsViews"in i?Array.from(i.graphicsViews(),(i=>i.hitTest(t))).flat():i.graphicsView.hitTest(t))).filter((i=>this.graphics.includes(i)));return r.length?r[0]:(this._manipulators.forEach((t=>{const r=t.intersectionDistance(i);h(r)&&r<s&&(s=r,e=t.graphic)})),e)}_syncLayerViews(){this._layerViews=[];const i=new Set;for(const t of this.graphics){const e=_(this.view,t.layer);e&&i.add(e)}this._layerViews=[...i]}_setUpManipulators(){const{graphics:i,view:t}=this;this._manipulators.forEach((i=>i.destroy())),this._manipulators=i?.length?i.map((i=>new M({graphic:i,view:t}))):[]}_setUpHighlights(){this.highlightsEnabled&&this._highlightHelper.add(this.graphics)}_setUpIndicators(){if(this._removeIndicators(),this.indicatorsEnabled){for(const i of this.graphics){const t=i.clone();t.symbol=this._getSymbolForIndicator(i),this._indicators.push(t),this._handles.add(o((()=>i.symbol),(()=>this._setUpIndicators())),P)}this.layer.addMany(this._indicators)}}_removeIndicators(){this._handles.remove(P),this._indicators.length&&(this.layer.removeMany(this._indicators),this._indicators.forEach((i=>i.destroy())),this._indicators=[])}_getSymbolForIndicator(i){const t=12;if(a(i.symbol))return null;switch(i.symbol.type){case"cim":return new E({style:"circle",size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}});case"picture-marker":{const{xoffset:t,yoffset:e,height:s,width:r}=i.symbol,h=s===r?r:Math.max(s,r);return new E({xoffset:t,yoffset:e,size:h,style:"square",color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-marker":{const{xoffset:t,yoffset:e,size:s,style:r}=i.symbol;return new E({xoffset:t,yoffset:e,style:"circle"===r?"circle":"square",size:s+2,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-fill":return new U({color:[0,0,0,0],outline:{style:"dash",color:[255,127,0,1],width:1}});case"simple-line":return new j({color:[255,127,0,1],style:"dash",width:1});case"text":{const{xoffset:e,yoffset:s}=i.symbol;return new E({xoffset:e,yoffset:s,size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}default:return null}}};i([n()],S.prototype,"_activeGraphic",void 0),i([n({readOnly:!0})],S.prototype,"type",void 0),i([n()],S.prototype,"callbacks",void 0),i([n()],S.prototype,"enableMoveAllGraphics",void 0),i([n()],S.prototype,"graphics",void 0),i([n({value:!1})],S.prototype,"highlightsEnabled",null),i([n()],S.prototype,"indicatorsEnabled",void 0),i([n()],S.prototype,"layer",void 0),i([n({readOnly:!0})],S.prototype,"state",null),i([n()],S.prototype,"view",void 0),S=i([l("esri.views.draw.support.GraphicMover")],S);const D=S;export{D as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{makeHandle as s}from"../../core/handleUtils.js";import{isNone as o,isSome as i,applySome as r}from"../../core/maybe.js";import{createTask as n,throwIfAborted as a}from"../../core/promiseUtils.js";import{formatLength as l}from"../../core/quantityFormatUtils.js";import{watch as c,on as h}from"../../core/reactiveUtils.js";import{createScreenPointArray as p}from"../../core/screenUtils.js";import{getDefaultUnitForView as d}from"../../core/unitUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as b}from"../../core/accessorSupport/decorators/subclass.js";import{s as u,a as f,i as _,f as g,l as x,b as y}from"../../chunks/vec2.js";import{a as v}from"../../chunks/vec2f64.js";import{z as j}from"../../chunks/vec3.js";import{isClockwise as L}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as U}from"../../intl/messages.js";import I from"../overlay/TextOverlayItem.js";import{euclideanDirectDistance as w}from"../support/euclideanLengthMeasurementUtils.js";const D=3025,O={default:15,far:25};let P=class extends t{constructor(e){super(e),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const e=n((async e=>{const t=await U("esri/core/t9n/Units");a(e),this._messagesUnits=t})),t=()=>r(this.context,(e=>e.editGeometryOperations));this.own([c((()=>[i(this.context)&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((e=>h(t,e,(()=>this._update())))),s((()=>e.abort()))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return o(this._messagesUnits)}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((e=>e.label.text))}}get _edgeDistancePixels(){return O[this.edgeDistance]}_update(){this._nextLabelIndex=0;const e=this.context;if(o(e))return void this._destroyUnusedLabels();const{components:t,geometry:s,coordinateHelper:r}=e.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const n=t.length;for(let o=0;o<n;++o){const a=[];if(t[o].iterateVertices((e=>{a.push(r.toXYZ(e.pos))})),0===o&&i(this.stagedVertex)&&a.push(r.toXYZ(this.stagedVertex)),a.length<2)continue;const l=a[0],c=a[a.length-1];"polygon"===s.type&&a.length>2&&!j(l,c)&&a.push(l);const h=1===n&&!L(a,!1,!1);let p=k,d=C;this.toScreenPointArray(e,l,p);for(let t=1;t<a.length;++t){const s=a[t-1],o=a[t];this.toScreenPointArray(e,o,d),this._addLabel(e,s,p,o,d,h),[p,d]=[d,p]}}this._destroyUnusedLabels()}_addLabel(e,t,s,o,r,n){const{label:a}=this._getOrCreateLabel(e);if(!this.visible||u(s,r)<D)return void(a.visible=!1);const c=w(t,o,e.editGeometryOperations.data.spatialReference),h=this._messagesUnits,p=d(e.view);a.text=i(h)&&i(c)?l(h,c,p):"",a.visible=!0;const m=r[0]-s[0],b=r[1]-s[1];n?f(S,-b,m):f(S,b,-m),_(S,S),g(S,S,this._edgeDistancePixels),x(V,s,r,.5),y(V,V,S),a.position=[V[0],V[1]],Math.abs(S[0])>Math.abs(S[1])?a.anchor=S[0]>0?"left":"right":a.anchor=-S[1]<0?"top":"bottom"}_getOrCreateLabel(e){if(this._labelInfos.length>this._nextLabelIndex)return this._labelInfos[this._nextLabelIndex++];const t=new I({fontSize:10,anchor:"center"});e.view.overlay.items.add(t);const s={label:t};return this._labelInfos.push(s),this._nextLabelIndex=this._labelInfos.length,s}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:e}){r(this.context,(t=>t.view.overlay.items.remove(e))),e.destroy()}};e([m()],P.prototype,"context",void 0),e([m()],P.prototype,"stagedVertex",void 0),e([m()],P.prototype,"visible",void 0),e([m()],P.prototype,"edgeDistance",void 0),e([m()],P.prototype,"updating",null),e([m()],P.prototype,"_messagesUnits",void 0),e([m()],P.prototype,"_edgeDistancePixels",null),P=e([b("esri.views.interactive")],P);const S=v(),V=v(),k=p(),C=p();export{P as SegmentLabels};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{q as
|
|
5
|
+
import{isNone as s}from"../../../../core/maybe.js";import{max as o}from"../../../../core/quantityUtils.js";import{q as i,a as t,h as n,x as r,y as a,g as e,b as c,f as g}from"../../../../chunks/vec2.js";import{a as b,H as f,g as u,b as m,h as p,f as I,n as d,e as N,l as j,C as l}from"../../../../chunks/vec3.js";import{f as h,Z as x}from"../../../../chunks/vec3f64.js";import{c as E,u as T}from"../../../../chunks/boundedPlane.js";import{sv2d as V,sv3d as v}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as C}from"../operations/MoveVertex.js";import{RotateVertex as R}from"../operations/RotateVertex.js";import{ScaleVertex as k}from"../operations/ScaleVertex.js";import{UpdateVertices as y}from"../operations/UpdateVertices.js";import{euclideanHorizontalDistance as F}from"../../../support/euclideanLengthMeasurementUtils.js";function S(s,o){return _(s,o,!1)}function Y(s,o){return _(s,o,!0)}function _(s,o,i){if(s instanceof y){if(s.operation instanceof C)return P(s.operation,o,i),!0;if(s.operation instanceof R)return U(s.operation,o,i),!0;if(s.operation instanceof k)return q(s.operation,o,i),!0}return!1}function P(s,o,i=!1){const t=i?-1:1,n=h(t*s.dx,t*s.dy,t*s.dz);b(o.origin,o.origin,n)}function U(s,o,i=!1){const t=i?-s.angle:s.angle;f(o.basis1,o.basis1,x,t),f(o.basis2,o.basis2,x,t)}function q(s,o,t=!1){const n=t?1/s.factor1:s.factor1,r=t?1/s.factor2:s.factor2;u(o.basis1,o.basis1,n),u(o.basis2,o.basis2,r),i(o.origin,o.origin,s.origin,s.axis1,n),i(o.origin,o.origin,s.origin,s.axis2,r)}function A(s,o,i,b){b||(b=E());const f=t(V.get(),s[1],-s[0]),u=t(V.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),m=t(V.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=V.get();o.components.forEach((o=>o.vertices.forEach((o=>{const i=o.pos;t(p,n(s,i),n(f,i)),r(u,u,p),a(m,m,p)}))));const I=1e-6,d=t(V.get(),m[0]-u[0]<I?i/2:0,m[1]-u[1]<I?i/2:0);return e(u,u,d),c(m,m,d),g(b.basis1,s,(m[0]-u[0])/2),g(b.basis2,f,(m[1]-u[1])/2),t(b.origin,u[0]*s[0]+u[1]*f[0],u[0]*s[1]+u[1]*f[1]),c(b.origin,b.origin,b.basis1),c(b.origin,b.origin,b.basis2),b}function G(s,o,i,t=0,n){n||(n=E()),o.toRenderCoords(s.origin,i,n.origin);const r=v.get();b(r,s.origin,s.basis1),b(r,r,s.basis2),o.toRenderCoords(r,i,r);const a=v.get();b(a,s.origin,s.basis1),m(a,a,s.basis2),o.toRenderCoords(a,i,a);const e=v.get();m(e,s.origin,s.basis1),m(e,e,s.basis2),o.toRenderCoords(e,i,e);const c=v.get();m(c,s.origin,s.basis1),b(c,c,s.basis2),o.toRenderCoords(c,i,c);const g=p(v.get(),r,a,.5);m(g,g,n.origin);const f=p(v.get(),e,c,.5);m(f,n.origin,f),p(n.basis1,g,f,.5);const l=p(v.get(),c,r,.5);m(l,l,n.origin);const h=p(v.get(),a,e,.5);m(h,n.origin,h),p(n.basis2,l,h,.5);const x=I(v.get(),n.basis1,n.basis2),V=I(x,x,n.basis1);return d(V,V),u(n.basis2,V,N(n.basis2,V)),u(n.basis1,n.basis1,1+t/j(n.basis1)),u(n.basis2,n.basis2,1+t/j(n.basis2)),T(n),n}function M(i,t,n){const r=v.get();m(r,m(r,i.origin,i.basis1),i.basis2);const a=v.get();l(a,r,i.basis1,2);const e=v.get();l(e,a,i.basis2,2);const c=v.get();l(c,r,i.basis2,2),r[2]=a[2]=e[2]=c[2]=t;const g=o(F(r,a,n),F(c,e,n)),b=o(F(a,e,n),F(r,c,n));return s(b)||s(g)?null:[g,b]}export{S as apply,A as calculateOrientedBounds,M as mapPlaneEuclideanHorizontalSize,G as mapPlaneToRenderPlane,Y as unapply};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{zeroMeters as o}from"../../../core/quantityUtils.js";import{property as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{zeroMeters as o}from"../../../core/quantityUtils.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as r}from"./SketchTooltipInfo.js";let i=class extends r{constructor(t){super(t),this.type="translate-graphic",this.distance=o}};t([e()],i.prototype,"type",void 0),t([e()],i.prototype,"distance",void 0),i=t([s("esri.views.interactive.tooltip.TranslateGraphicTooltipInfo")],i);let p=class extends r{constructor(t){super(t),this.type="translate-z",this.distance=o}};t([e()],p.prototype,"type",void 0),t([e()],p.prototype,"distance",void 0),p=t([s("esri.views.interactive.tooltip.TranslateZTooltipInfo")],p);let a=class extends r{constructor(t){super(t),this.type="translate-vertex",this.distance=o,this.elevation=null,this.area=null,this.totalLength=null}};t([e()],a.prototype,"type",void 0),t([e()],a.prototype,"distance",void 0),t([e()],a.prototype,"elevation",void 0),t([e()],a.prototype,"area",void 0),t([e()],a.prototype,"totalLength",void 0),a=t([s("esri.views.interactive.tooltip.TranslateVertexTooltipInfo")],a);export{i as TranslateGraphicTooltipInfo,a as TranslateVertexTooltipInfo,p as TranslateZTooltipInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/set.js";import{subclass as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/set.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as a}from"../../../../widgets/support/jsxFactory.js";const p={base:`${s} ${`${s}--translate-vertex`}`};let c=class extends r{render(){const{area:t,distance:o,elevation:s,totalLength:r}=this.info,c=this._messagesTooltip?.sketch;return a("div",{class:p.base},a(i,{title:c?.distance,value:this._formatLength(o)}),e(s)&&a(i,{title:c?.elevation,value:this._formatVerticalLength(s)}),e(t)&&a(i,{title:c?.area,value:this._formatArea(t)}),e(r)&&a(i,{title:c?.totalLength,value:this._formatLength(r)}))}};c=t([o("esri.views.interactive.tooltip.content.TooltipContentTranslateVertex")],c);export{c as TooltipContentTranslateVertex};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t}from"../../../../core/maybe.js";import{createLength as r}from"../../../../core/quantityUtils.js";import{f as n,c as e}from"../../../../chunks/vec3f64.js";import{euclideanPlanarArea as s}from"../../../support/areaMeasurementUtils.js";import{euclideanDirectDistance as
|
|
5
|
+
import{isNone as t}from"../../../../core/maybe.js";import{createLength as r}from"../../../../core/quantityUtils.js";import{f as n,c as e}from"../../../../chunks/vec3f64.js";import{euclideanPlanarArea as s,createEuclideanPlanarAreaCache as o}from"../../../support/areaMeasurementUtils.js";import{euclideanDirectDistance as u,euclideanLength as i}from"../../../support/euclideanLengthMeasurementUtils.js";function a(e){const s=i(e),o=e.paths[0]?.[e.paths[0]?.length-1]??null,{hasZ:a,spatialReference:c}=e,p=o?n(o[0],o[1],a?o[2]:0):null;return n=>{if(t(n)||t(s)||t(p))return s;l[0]=n.x,l[1]=n.y,l[2]=a?n.z:0;const e=u(p,l,c);return t(e)?s:r(s.value+e.value,s.unit)}}function c(r){const n=o();return e=>{if(t(e)||r.rings.length<1||r.rings[0].length<2)return s(r,n);const o=r.clone();return o.rings[0].push([e.x,e.y]),s(o,n)}}const l=e();export{c as computeAreaWithStagedVertex,a as computeLengthWithStagedVertex};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t}from"../../core/maybe.js";import{createArea as
|
|
5
|
+
import{isNone as t}from"../../core/maybe.js";import{createArea as o}from"../../core/quantityUtils.js";import{areaUnitFromSpatialReference as r}from"../../core/unitUtils.js";import{e}from"../../chunks/earcut.js";import{k as n,c as s}from"../../chunks/vec3.js";import{c as i}from"../../chunks/vec3f64.js";import{projectVectorToVector as f}from"../../geometry/projection.js";import{fromPoints as c,wrap as m,projectPointLocal as l}from"../../geometry/support/plane.js";import{areaPoints2d as p}from"../../geometry/support/triangle.js";import{sv3d as u}from"../../geometry/support/vectorStacks.js";import{computeEuclideanMeasurementSR as a}from"./measurementUtils.js";function g(e,g=j()){const y=a(e.spatialReference),k=r(y);if(t(k))return null;let d=0;for(const t of e.rings){if(t.length<3)continue;const{positionsWorldCoords:o}=g;for(;o.length<t.length;)o.push(i());for(let n=0;n<3;n++)if(!f(t[n],e.spatialReference,o[n],y))return null;if(n(o[0],o[1])||n(o[0],o[2])||n(o[1],o[2]))continue;const r=c(o[0],o[1],o[2],m()),a=s(u.get(),o[0]);for(let t=0;t<3;t++)l(r,a,o[t],o[t]);for(let n=3;n<t.length;n++)f(t[n],e.spatialReference,o[n],y),l(r,a,o[n],o[n]);const j=h(o);for(let t=0;t<j.length;t+=3)d+=p(o[j[t]],o[j[t+1]],o[j[t+2]])}return o(d,k)}function j(){return{positionsWorldCoords:[]}}function h(t){return e(y(t),[],2)}function y(t){const o=new Float64Array(2*t.length);for(let r=0;r<t.length;++r){const e=t[r],n=2*r;o[n+0]=e[0],o[n+1]=e[1]}return o}export{j as createEuclideanPlanarAreaCache,g as euclideanPlanarArea,h as triangulate};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{euclideanDirectDistanceBetweenPoints as n,euclideanDirectDistance as t,euclideanHorizontalDistanceBetweenPoints as e,euclideanLength as r}from"./euclideanLengthMeasurementUtils.js";import{geodesicDistanceBetweenPoints as o,geodesicDistance as u,geodesicLength as i}from"./geodesicLengthMeasurementUtils.js";function c(n,t){return a(r,i,t,n)}function f(t,e,r){return a(n,o,r,t,e)}function p(n,e,r,o){return a(t,u,o,n,e,r)}function s(n,t,r){return a(e,o,r,n,t)}function m(n,e,r,o){return a(t,u,o,n,e,r)}function a(n,t,e,...r){return"on-the-ground"===e?t.apply(void 0,r):n.apply(void 0,r)}export{p as autoDirectDistanceByElevationMode,f as autoDirectDistanceByElevationModeBetweenPoints,m as autoHorizontalDistanceByElevationMode,s as autoHorizontalDistanceByElevationModeBetweenPoints,c as autoLengthByElevationMode};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{isSome as t,isNone as n}from"../../core/maybe.js";import{createLength as e}from"../../core/quantityUtils.js";import{lengthUnitFromSpatialReference as r,verticalLengthUnitFromSpatialReference as i}from"../../core/unitUtils.js";import{i as o,s as c}from"../../chunks/vec3.js";import{c as u}from"../../chunks/vec3f64.js";import{projectVectorToVector as l}from"../../geometry/projection.js";import{equals as s}from"../../geometry/support/spatialReferenceUtils.js";import{computeEuclideanMeasurementSR as a}from"./measurementUtils.js";function f(t){const{hasZ:i,spatialReference:o}=t,c=a(o);let u=0;const l=r(c);if(n(l))return null;for(const e of t.paths){if(e.length<2)continue;const t=e.length-1;for(let r=0;r<t;++r){const t=e[r];U[0]=t[0],U[1]=t[1],U[2]=i?t[2]:0;const c=e[r+1];b[0]=c[0],b[1]=c[1],b[2]=i?c[2]:0;const l=R(U,b,o);if(n(l))return null;u+=l.value}}return e(u,l)}function h(t,n){const{spatialReference:e}=t;return s(e,n.spatialReference)?(U[0]=t.x,U[1]=t.y,U[2]=t.hasZ?t.z:0,b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,v(U,b,e)):null}function p(t,n){const{spatialReference:e}=t;return s(e,n.spatialReference)?(U[0]=t.x,U[1]=t.y,U[2]=t.hasZ?t.z:0,b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,R(U,b,e)):null}function m(t,n){const{spatialReference:e}=t;return s(e,n.spatialReference)?(U[0]=t.x,U[1]=t.y,U[2]=t.hasZ?t.z:0,b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,d(U,b,e)):null}function z(t,n){const{spatialReference:e}=t;return s(e,n.spatialReference)?(U[0]=t.x,U[1]=t.y,U[2]=t.hasZ?t.z:0,b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,Z(U,b,e)):null}function y(t){return U[0]=t.x,U[1]=t.y,U[2]=t.hasZ?t.z:0,j(U,t.spatialReference)}function v(n,r,i){const o=g(n,r,i);return t(o)?{direct:e(o.direct,o.unit),horizontal:e(o.horizontal,o.unit),vertical:e(o.vertical,o.unit)}:null}function R(n,r,i){const o=g(n,r,i,"direct");return t(o)?e(o.direct,o.unit):null}function d(n,r,i){const o=g(n,r,i,"horizontal");return t(o)?e(o.horizontal,o.unit):null}function x(n,r,i){const o=g(n,r,i,"vertical");return t(o)?e(Math.abs(o.verticalSigned),o.unit):null}function Z(n,r,i){const o=g(n,r,i,"vertical");return t(o)?e(o.verticalSigned,o.unit):null}function j(n,r){const o=i(r);return t(o)?e(n[2],o):null}function g(t,e,i,u){const s=a(i),f=r(s);if(n(f))return null;const h=e[2]-t[2];if("vertical"===u)return{verticalSigned:h,unit:f};if(!l(t,i,S,s)||!l(e,i,k,s))return null;if("direct"===u){return{direct:o(k,S),unit:f}}if(c(M,t[0],t[1],e[2]),!l(M,i,M,s))return null;const p=o(M,k);if("horizontal"===u)return{horizontal:p,unit:f};return{direct:o(k,S),horizontal:p,vertical:Math.abs(h),unit:f}}const U=u(),b=u(),S=u(),k=u(),M=u();export{j as elevation,y as elevationOfPoint,R as euclideanDirectDistance,p as euclideanDirectDistanceBetweenPoints,v as euclideanDistance,h as euclideanDistanceBetweenPoints,d as euclideanHorizontalDistance,m as euclideanHorizontalDistanceBetweenPoints,f as euclideanLength,x as verticalDistance,Z as verticalSignedDistance,z as verticalSignedDistanceBetweenPoints};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{createLength as e}from"../../core/quantityUtils.js";import{c as t}from"../../chunks/vec3f64.js";import{geodesicLength as r}from"../../geometry/geometryEngine.js";import{projectVectorToWGS84ComparableLonLat as n,projectPolylineToWGS84ComparableLonLat as o}from"../../geometry/projection.js";import{isSupported as s,inverseGeodeticSolver as i,geodesicLengths as c}from"../../geometry/support/geodesicUtils.js";import{isGeographic as u,isWebMercator as f,equals as p}from"../../geometry/support/spatialReferenceUtils.js";function l(e){const{spatialReference:t}=e;return x(t,j,h,R,e)}function m(e,t){if(!p(e.spatialReference,t.spatialReference))return null;const{spatialReference:r}=e;return z[0]=e.x,z[1]=e.y,z[2]=e.hasZ?e.z:0,Z[0]=t.x,Z[1]=t.y,Z[2]=t.hasZ?t.z:0,a(z,Z,r)}function a(e,t,r){return x(r,y,g,d,e,t,r)}function y(t,r,n){return e(i(U,t,r,n).distance,"meters")}function g(t,n,o){return e(r(v(t,n,o),"meters"),"meters")}function d(t,r,o){return n(t,o,k)&&n(r,o,q)?e(i(U,k,q).distance,"meters"):null}function j(t){return e(c([t],"meters")[0],"meters")}function h(t){return e(r(t,"meters"),"meters")}function R(t){const r=[];if(!o(t,r))return null;let n=0;for(const e of r){let t=0;for(let r=1;r<e.length;++r)t+=i(U,e[r-1],e[r]).distance;n+=t}return e(n,"meters")}function v(e,t,r){return{type:"polyline",spatialReference:r,paths:[[[...e],[...t]]]}}function x(e,t,r,n,...o){return u(e)&&s(e)?t.apply(void 0,o):f(e)?r.apply(void 0,o):n.apply(void 0,o)}const U={distance:null},z=t(),Z=t(),k=t(),q=t();export{a as geodesicDistance,m as geodesicDistanceBetweenPoints,l as geodesicLength};
|