@arcgis/core 5.0.0-next.31 → 5.0.0-next.32
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/applications/SceneViewer/sceneViewerUtils.d.ts +3 -0
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/1dd867fa7c58c06b79ea.js +1 -0
- package/assets/esri/core/workers/chunks/22d66d1c8dfccdbbcf30.js +1 -0
- package/assets/esri/core/workers/chunks/27bd88e1101873d4ce12.js +1 -0
- package/assets/esri/core/workers/chunks/{5f2cf73fb2944f82661d.js → 433d249c35c56bf15806.js} +34 -34
- package/assets/esri/core/workers/chunks/{b2fbb44e219232e61cbd.js → 794960ec36e11f4416c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{0bfb7db0a151a5e85dd1.js → 8ad6595ad44c2d60c1ce.js} +1 -1
- package/assets/esri/core/workers/chunks/{11bb437437272d8f3e2c.js → 9252854b512237b6a0ef.js} +1 -1
- package/assets/esri/core/workers/chunks/{e615983fab688d515205.js → 944dfa9309da8f49a616.js} +1 -1
- package/assets/esri/core/workers/chunks/{f2f4e34247882eceb50d.js → a2cee5ac0d4df0108425.js} +3 -3
- package/assets/esri/core/workers/chunks/a4b7ba8aec109beb5b4d.js +1 -0
- package/assets/esri/core/workers/chunks/da517b4b07d4d27ce94c.js +1 -0
- package/assets/esri/core/workers/chunks/defc6b50df5018bd9e86.js +1 -0
- package/assets/esri/core/workers/chunks/ed1dabed10ff9f4e0369.js +1 -0
- package/assets/esri/core/workers/chunks/{14dc21fe66c7b98fb456.js → f3127bdf28a1d9b8db27.js} +1 -1
- package/assets/esri/core/workers/chunks/fee942ef802a162e0248.js +1 -0
- package/assets/esri/themes/base/widgets/_Attribution.scss +8 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/BlendLayers.glsl.js +1 -1
- package/config.js +1 -1
- package/core/deprecate.js +1 -1
- package/core/keyboard.js +5 -0
- package/interfaces.d.ts +55 -3
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
- package/views/3d/support/Attribution3D.js +5 -0
- package/views/3d/terrain/TileBlendTechniqueConfiguration.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +4 -4
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +4 -4
- package/views/Attribution.js +5 -0
- package/views/DOMContainer.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/support/managers/DrawTooltipManager.js +5 -0
- package/views/interactive/tooltip/content/TooltipContentDynamic.js +5 -0
- package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
- package/views/interactive/tooltip/fields/TooltipField.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +5 -0
- package/views/layers/LayerView.js +1 -1
- package/views/support/AttributionItem.d.ts +4 -0
- package/views/support/AttributionItem.js +5 -0
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/attributionUtils.js +5 -0
- package/views/support/geodesicAreaMeasurementUtils.js +1 -1
- package/views/support/geodesicLengthMeasurementUtils.js +1 -1
- package/views/ui/2d/DefaultUI2D.js +1 -1
- package/views/ui/3d/DefaultUI3D.js +1 -1
- package/widgets/Attribution/AttributionViewModel.js +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/decorators/accessibleHandler.js +1 -1
- package/widgets/support/jsxWidgetSupport.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/widgets/support/widgetUtils.js +1 -1
- package/assets/esri/core/workers/chunks/25143b919e75d5d2da05.js +0 -1
- package/assets/esri/core/workers/chunks/2d17ed5321ca05acb8e3.js +0 -1
- package/assets/esri/core/workers/chunks/447b53a9280b2b19b7a6.js +0 -1
- package/assets/esri/core/workers/chunks/6ce7ca6bebdc61d8eada.js +0 -1
- package/assets/esri/core/workers/chunks/8fbda0b85731ac77e1d8.js +0 -1
- package/assets/esri/core/workers/chunks/98c32d10a2344cd7a50b.js +0 -1
- package/assets/esri/core/workers/chunks/d5b464ff83ce29b51968.js +0 -1
- package/assets/esri/core/workers/chunks/d777d7cb8df3f21ac97e.js +0 -1
- package/layers/support/attributionUtils.js +0 -5
package/views/SceneView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/units.js";import{property as T,cast as R,subclass as x}from"../core/accessorSupport/decorators.js";import{ensureType as O,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as E}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as L}from"../core/accessorSupport/trackingUtils.js";import{create as H}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as I}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as P}from"../core/support/OwningCollection.js";import{initialize as F}from"../core/workers/workers.js";import D from"../geometry/Extent.js";import U from"../geometry/HeightModelInfo.js";import G from"../geometry/Point.js";import{project as W,canProjectWithoutEngine as q}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as k}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as B}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as N}from"../geometry/projection/projectPointToVector.js";import{toExtent as Q,create as Y}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as J}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as K,isTiledLayer as X,isVoxelLayer as ee,isIntegratedMeshLayer as te}from"../layers/support/layerUtils.js";import{TilemapCache as ie}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as re}from"../portal/portalDefault.js";import{AnalysesCollection as se}from"../support/AnalysesCollection.js";import{WebSceneTag as ne}from"../support/tagSymbols.js";import{BreakpointsOwner as ae}from"./BreakpointsOwner.js";import{DOMContainer as oe}from"./DOMContainer.js";import{PopupView as le}from"./PopupView.js";import pe from"./View.js";import he from"./ViewAnimation.js";import{stringFromViewingMode as de,viewingModeFromString as ue}from"./ViewingMode.js";import{GroundView3D as ce}from"./3d/GroundView3D.js";import{layerView3DImporter as ge}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as me}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ye}from"./3d/camera/intersectionUtils.js";import{Constraints as fe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as we}from"./3d/environment/EnvironmentManager.js";import ve from"./3d/environment/SceneViewEnvironment.js";import _e from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as be}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Me}from"./3d/layers/graphics/Labeler.js";import Se from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Ve}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as je}from"./3d/state/ScreenSizePerspective.js";import Ce from"./3d/state/ViewState.js";import{ViewStateManager as Te,cleanupViewStateManager as Re}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as xe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Oe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ae}from"./3d/state/utils/navigationUtils.js";import{CombinedElevationProvider as Ee}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Le}from"./3d/support/debugFlags.js";import{getElevationAtPoint as He}from"./3d/support/ElevationProvider.js";import{toMap as Ie,hitTest as Pe}from"./3d/support/hitTest.js";import{popupHitTest as Fe}from"./3d/support/popupHitTest.js";import{getQualityProfileSettings as De,getDefaultQualityProfileName as Ue}from"./3d/support/QualityProfile.js";import Ge from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as We}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as qe}from"./3d/support/ResourceController.js";import ze from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as ke}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Be}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Ne}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Qe from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ye,getTiledLayerInfo as Ze,checkIfTileInfoSupportedForView as $e}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Je}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Ke}from"./3d/terrain/TileRenderer.js";import{Stage as Xe}from"./3d/webgl-engine/Stage.js";import{olidEnabled as et}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as tt}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as it}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as rt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as st}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as nt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import at from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as ot}from"./support/drapedUtils.js";import{defaultHighlightName as lt}from"./support/HighlightDefaults.js";import pt from"./support/HighlightOptions.js";import{occludeesSupported as ht}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as dt,createScreenPointFromSupportedEvent as ut}from"./support/screenUtils.js";import{isSpatialReferenceSupported as ct}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as gt,destroyTextureCompressionWorker as mt}from"./support/TextureCompressionHelper.js";import{check as yt}from"./support/WebGLRequirements.js";import ft from"./ui/DefaultUI.js";import wt from"./ui/3d/DefaultUI3D.js";import vt from"../webscene/Environment.js";import{clearVNodeCache as _t}from"../widgets/support/vnodeCache.js";var bt;const Mt=Symbol(),St=Symbol();let Vt=class extends(ae(le(oe(pe)))){static{bt=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=qe(this),this.deconflictor=new be({view:this}),this.labeler=new Me({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new se,this.basemapTerrain=null,this.elevationProvider=new Ee({view:this}),this._canvas=null,this.constraints=new fe,this._environment=new ve,this.environmentManager=new we,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new at({importAnalysisViewModule:e=>me(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new Ce({view:this}),this.slice=new Be,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new wt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,F();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new _e({view:this}),this.stateManager=new Te({view:this}),this.screenSizePerspective=new je({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=gt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ce({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(mt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=O(G,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof D?this.spatialReference&&(t=jt(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:jt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=jt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=jt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{basemapTerrain:r}=this;if(r?.spatialReference){const e=r.groundExtent;i(new D({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}const s=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>s(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const n=this._get("_groundAndLayersExtent");return t.equals(n)?n:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof ve?e:e instanceof vt?this.environment?.cloneWithWebsceneEnvironment(e)??ve.fromWebsceneEnvironment(e):O(ve,e):new ve}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return bt._layerToLayerview}static{this._layerToLayerview=pe._layerToLayerview.concat([["view.map.ground.layers","view.groundView.layerViews"]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&ne in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){const t=De(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new Ge(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Ue()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?U.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ye(r))return;++i,e+=r.updatingProgress}}else++i});for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return de(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?de(this.defaultsFromMap.viewingMode):ct(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find(({name:e})=>e===lt)??new pt}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===lt)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ze(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=dt(e)?ut(this,e):e;return Ie(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;let t=e;return null==e.z&&(t=xt,t.x=e.x,t.y=e.y,t.z=He(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),N(t,Ct,this.renderSpatialReference),this.state.camera.projectToScreen(Ct,Tt),V(Tt[0],Tt[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;N(e,Ct,i);const r=this.state.camera.computeScreenPixelSizeAt(Ct);return t&&i!==t?r*C(i)/C(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=dt(e)?ut(this,e):e;return Pe(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Fe(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!et())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ge.importLayerView(e)}hasLayerViewModule(e){return ge.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}async validate(){let e=yt(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ue(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!ct(e,i)&&(null==t||(!!K(t)||(!X(t)||null!=Ze(t,e,i))&&(!ee(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(K(t)&&(r||s)){return!s||2===i||null===$e(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return X(t)||ee(t)||!r&&!s?X(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${de(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&ht(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await Ot[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Qe({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Ne({view:this})),this.addHandles([this.updatingHandles.add(()=>Le.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Le.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.basemapTerrain?.extent,basemapSpatialReference:this.basemapTerrain?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?W(Q(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.addPromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},w)],Mt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(St),this.removeHandles(Mt),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",We.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.basemapTerrain?.extent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!B(e,this.basemapTerrain.spatialReference,Rt,t)||(this.renderCoordsHelper.extent=Rt)},w),St),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(it/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(St),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Oe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Xe({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(it/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new ke({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.basemapTerrain?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===ue(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?E(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(st);for(const t of this.allLayerViews)te(t.layer)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(st);for(const t of this.allLayerViews)te(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){_t(),L(),j(),nt(),Re(),ye(),Ve(),k(),ot(),re(),Ke(),rt(),xe(),Ae(),I(),M(),tt(),Je(),Se.cleanupI3SLodHandling(),ie.cleanupTilemapCache(),Ce.cleanupViewstate(),Qe.cleanupTerrainSurface()}};function jt(e,t){return null!=e&&q(e.spatialReference,t)?W(e,t):null}e([T()],Vt.prototype,"_userClippingArea",void 0),e([T()],Vt.prototype,"_resourceController",void 0),e([T()],Vt.prototype,"stage",null),e([T({readOnly:!0})],Vt.prototype,"deconflictor",void 0),e([T({readOnly:!0})],Vt.prototype,"labeler",void 0),e([T(P(se,"analyses"))],Vt.prototype,"analyses",void 0),e([T({type:he,readOnly:!0})],Vt.prototype,"animation",null),e([T({readOnly:!0})],Vt.prototype,"basemapTerrain",void 0),e([T({readOnly:!0})],Vt.prototype,"overlayManager",null),e([T({readOnly:!0})],Vt.prototype,"elevationProvider",void 0),e([T()],Vt.prototype,"camera",null),e([T({type:t})],Vt.prototype,"contentCamera",null),e([T({readOnly:!0})],Vt.prototype,"canvas",null),e([T({type:G,useTypeForAutocast:!1})],Vt.prototype,"center",null),e([T({type:D})],Vt.prototype,"clippingArea",null),e([T({type:fe,nonNullable:!0})],Vt.prototype,"constraints",void 0),e([T({type:D,readOnly:!0})],Vt.prototype,"renderDataExtent",null),e([T({readOnly:!0})],Vt.prototype,"tileInfo",null),e([T({type:D,readOnly:!0})],Vt.prototype,"dataExtent",null),e([T({type:D,readOnly:!0})],Vt.prototype,"_groundAndLayersExtent",null),e([T({type:ve})],Vt.prototype,"environment",null),e([R("environment")],Vt.prototype,"castEnvironment",null),e([T({readOnly:!0})],Vt.prototype,"environmentManager",void 0),e([T({type:D})],Vt.prototype,"extent",null),e([T({type:r})],Vt.prototype,"floors",void 0),e([T()],Vt.prototype,"screenCenter",null),e([T()],Vt.prototype,"frustum",null),e([T({type:Number,readOnly:!0})],Vt.prototype,"fullOpacity",void 0),e([T({readOnly:!0})],Vt.prototype,"graphicsView",void 0),e([T()],Vt.prototype,"analysisViewManager",void 0),e([T()],Vt.prototype,"groundView",void 0),e([T({readOnly:!0})],Vt.prototype,"layerviewCollections",null),e([T({type:Boolean})],Vt.prototype,"initialExtentRequired",null),e([T()],Vt.prototype,"defaultsFromMapSettings",null),e([T()],Vt.prototype,"interacting",null),e([T()],Vt.prototype,"stationary",null),e([T()],Vt.prototype,"navigating",null),e([T()],Vt.prototype,"map",void 0),e([T()],Vt.prototype,"padding",null),e([T({type:Ne,readOnly:!0})],Vt.prototype,"pointsOfInterest",void 0),e([T()],Vt.prototype,"_featureTiles",void 0),e([T()],Vt.prototype,"featureTiles",null),e([T()],Vt.prototype,"_featureTreeDebugger",void 0),e([T({constructOnly:!0})],Vt.prototype,"deactivatedWebGLExtensions",void 0),e([T({constructOnly:!0})],Vt.prototype,"debugWebGLExtensions",void 0),e([T({constructOnly:!0})],Vt.prototype,"renderCanvas",void 0),e([T({constructOnly:!0})],Vt.prototype,"state",void 0),e([T()],Vt.prototype,"screenSizePerspective",void 0),e([T({readOnly:!0})],Vt.prototype,"inputManager",void 0),e([T({readOnly:!0})],Vt.prototype,"stateManager",void 0),e([T({type:["low","medium","high"]})],Vt.prototype,"qualityProfile",null),e([T({type:Ge,get(){let e=this._get("qualitySettings");if(!e){const t=De(this.qualityProfile);e=new Ge(t)}return e}})],Vt.prototype,"qualitySettings",void 0),e([T()],Vt.prototype,"slice",void 0),e([T({readOnly:!0})],Vt.prototype,"typeSpecificPreconditionsReady",null),e([T({readOnly:!0})],Vt.prototype,"renderCoordsHelper",void 0),e([T({readOnly:!0})],Vt.prototype,"sceneIntersectionHelper",void 0),e([T({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],Vt.prototype,"resolution",null),e([T({type:Number})],Vt.prototype,"scale",null),e([T({readOnly:!0,type:Number})],Vt.prototype,"terrainLevel",null),e([T()],Vt.prototype,"heightModelInfo",null),e([T()],Vt.prototype,"spatialReference",void 0),e([T({type:Boolean,value:!1})],Vt.prototype,"alphaCompositingEnabled",null),e([T({constructOnly:!0})],Vt.prototype,"preserveDrawingBufferEnabled",void 0),e([T({type:Boolean})],Vt.prototype,"supersampleScreenshotsEnabled",void 0),e([T({readOnly:!0})],Vt.prototype,"type",void 0),e([T(),R(e=>e instanceof ft?e:A(wt,e))],Vt.prototype,"ui",void 0),e([T({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],Vt.prototype,"updating",null),e([T()],Vt.prototype,"_updatingObjects",null),e([T()],Vt.prototype,"_updatingObjectsWithProgress",null),e([T({type:Number,readOnly:!0,dependsOn:["updating"]})],Vt.prototype,"updatingProgress",void 0),e([T({type:["global","local"]})],Vt.prototype,"viewingMode",null),e([T({type:i})],Vt.prototype,"viewpoint",null),e([T({readOnly:!0})],Vt.prototype,"visibleArea",null),e([T({type:Number})],Vt.prototype,"zoom",null),e([T({type:pt})],Vt.prototype,"highlightOptions",null),e([T({readOnly:!0})],Vt.prototype,"quality",null),e([T({readOnly:!0})],Vt.prototype,"resolutionScale",null),e([T()],Vt.prototype,"focusAreasView",void 0),e([T()],Vt.prototype,"_defaultToMapOptions",null),e([T()],Vt.prototype,"_defaultHitTestOptions",null),Vt=bt=e([x("esri.views.SceneView")],Vt);const Ct=H(),Tt=S(),Rt=Y(),xt=J(0,0,0,z.WebMercator),Ot={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},At=Vt;export{At as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/units.js";import{property as T,cast as R,subclass as x}from"../core/accessorSupport/decorators.js";import{ensureType as O,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as E}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as L}from"../core/accessorSupport/trackingUtils.js";import{create as H}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as I}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as P}from"../core/support/OwningCollection.js";import{initialize as F}from"../core/workers/workers.js";import D from"../geometry/Extent.js";import U from"../geometry/HeightModelInfo.js";import G from"../geometry/Point.js";import{project as W,canProjectWithoutEngine as q}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as k}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as B}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as N}from"../geometry/projection/projectPointToVector.js";import{toExtent as Q,create as Y}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as J}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as K,isTiledLayer as X,isVoxelLayer as ee,isIntegratedMeshLayer as te}from"../layers/support/layerUtils.js";import{TilemapCache as ie}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as re}from"../portal/portalDefault.js";import{AnalysesCollection as se}from"../support/AnalysesCollection.js";import{WebSceneTag as ne}from"../support/tagSymbols.js";import{BreakpointsOwner as ae}from"./BreakpointsOwner.js";import{DOMContainer as oe}from"./DOMContainer.js";import{PopupView as le}from"./PopupView.js";import pe from"./View.js";import he from"./ViewAnimation.js";import{stringFromViewingMode as de,viewingModeFromString as ue}from"./ViewingMode.js";import{GroundView3D as ce}from"./3d/GroundView3D.js";import{layerView3DImporter as ge}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as me}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ye}from"./3d/camera/intersectionUtils.js";import{Constraints as fe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as we}from"./3d/environment/EnvironmentManager.js";import ve from"./3d/environment/SceneViewEnvironment.js";import _e from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as be}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Me}from"./3d/layers/graphics/Labeler.js";import Se from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Ve}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as je}from"./3d/state/ScreenSizePerspective.js";import Ce from"./3d/state/ViewState.js";import{ViewStateManager as Te,cleanupViewStateManager as Re}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as xe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Oe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ae}from"./3d/state/utils/navigationUtils.js";import Ee from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Le}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as He}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Ie}from"./3d/support/ElevationProvider.js";import{toMap as Pe,hitTest as Fe}from"./3d/support/hitTest.js";import{popupHitTest as De}from"./3d/support/popupHitTest.js";import{getQualityProfileSettings as Ue,getDefaultQualityProfileName as Ge}from"./3d/support/QualityProfile.js";import We from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as qe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as ze}from"./3d/support/ResourceController.js";import ke from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Be}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Ne}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Qe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ye from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ze,getTiledLayerInfo as $e,checkIfTileInfoSupportedForView as Je}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Ke}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Xe}from"./3d/terrain/TileRenderer.js";import{Stage as et}from"./3d/webgl-engine/Stage.js";import{olidEnabled as tt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as it}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as rt}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as st}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as nt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as at}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import ot from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as lt}from"./support/drapedUtils.js";import{defaultHighlightName as pt}from"./support/HighlightDefaults.js";import ht from"./support/HighlightOptions.js";import{occludeesSupported as dt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as ut,createScreenPointFromSupportedEvent as ct}from"./support/screenUtils.js";import{isSpatialReferenceSupported as gt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as mt,destroyTextureCompressionWorker as yt}from"./support/TextureCompressionHelper.js";import{check as ft}from"./support/WebGLRequirements.js";import wt from"./ui/DefaultUI.js";import vt from"./ui/3d/DefaultUI3D.js";import _t from"../webscene/Environment.js";import{clearVNodeCache as bt}from"../widgets/support/vnodeCache.js";var Mt;const St=Symbol(),Vt=Symbol();let jt=class extends(ae(le(oe(pe)))){static{Mt=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=ze(this),this.deconflictor=new be({view:this}),this.attribution3D=new Ee({view:this}),this.labeler=new Me({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new se,this.basemapTerrain=null,this.elevationProvider=new Le({view:this}),this._canvas=null,this.constraints=new fe,this._environment=new ve,this.environmentManager=new we,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ot({importAnalysisViewModule:e=>me(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new Ce({view:this}),this.slice=new Ne,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new vt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,F();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new _e({view:this}),this.stateManager=new Te({view:this}),this.screenSizePerspective=new je({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=mt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ce({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(yt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=O(G,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof D?this.spatialReference&&(t=Ct(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Ct(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=Ct(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=Ct(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{basemapTerrain:r}=this;if(r?.spatialReference){const e=r.groundExtent;i(new D({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}const s=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>s(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const n=this._get("_groundAndLayersExtent");return t.equals(n)?n:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof ve?e:e instanceof _t?this.environment?.cloneWithWebsceneEnvironment(e)??ve.fromWebsceneEnvironment(e):O(ve,e):new ve}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return Mt._layerToLayerview}static{this._layerToLayerview=pe._layerToLayerview.concat([["view.map.ground.layers","view.groundView.layerViews"]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&ne in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){const t=Ue(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new We(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Ge()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?U.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ze(r))return;++i,e+=r.updatingProgress}}else++i});for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return de(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?de(this.defaultsFromMap.viewingMode):gt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find(({name:e})=>e===pt)??new ht}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===pt)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ke(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=ut(e)?ct(this,e):e;return Pe(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;let t=e;return null==e.z&&(t=Ot,t.x=e.x,t.y=e.y,t.z=Ie(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),N(t,Tt,this.renderSpatialReference),this.state.camera.projectToScreen(Tt,Rt),V(Rt[0],Rt[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;N(e,Tt,i);const r=this.state.camera.computeScreenPixelSizeAt(Tt);return t&&i!==t?r*C(i)/C(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ut(e)?ct(this,e):e;return Fe(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return De(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!tt())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return ge.importLayerView(e)}hasLayerViewModule(e){return ge.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}async validate(){let e=ft(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ue(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!gt(e,i)&&(null==t||(!!K(t)||(!X(t)||null!=$e(t,e,i))&&(!ee(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(K(t)&&(r||s)){return!s||2===i||null===Je(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return X(t)||ee(t)||!r&&!s?X(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${de(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&dt(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await At[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Ye({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Qe({view:this})),this.addHandles([this.updatingHandles.add(()=>He.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&He.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.basemapTerrain?.extent,basemapSpatialReference:this.basemapTerrain?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?W(Q(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.addPromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},w)],St),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Vt),this.removeHandles(St),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",qe.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.basemapTerrain?.extent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!B(e,this.basemapTerrain.spatialReference,xt,t)||(this.renderCoordsHelper.extent=xt)},w),Vt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(rt/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(Vt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Oe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new et({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(rt/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Be({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.basemapTerrain?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===ue(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?E(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(nt);for(const t of this.allLayerViews)te(t.layer)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(nt);for(const t of this.allLayerViews)te(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){bt(),L(),j(),at(),Re(),ye(),Ve(),k(),lt(),re(),Xe(),st(),xe(),Ae(),I(),M(),it(),Ke(),Se.cleanupI3SLodHandling(),ie.cleanupTilemapCache(),Ce.cleanupViewstate(),Ye.cleanupTerrainSurface()}};function Ct(e,t){return null!=e&&q(e.spatialReference,t)?W(e,t):null}e([T()],jt.prototype,"_userClippingArea",void 0),e([T()],jt.prototype,"_resourceController",void 0),e([T()],jt.prototype,"stage",null),e([T({readOnly:!0})],jt.prototype,"deconflictor",void 0),e([T({readOnly:!0})],jt.prototype,"labeler",void 0),e([T(P(se,"analyses"))],jt.prototype,"analyses",void 0),e([T({type:he,readOnly:!0})],jt.prototype,"animation",null),e([T({readOnly:!0})],jt.prototype,"basemapTerrain",void 0),e([T({readOnly:!0})],jt.prototype,"overlayManager",null),e([T({readOnly:!0})],jt.prototype,"elevationProvider",void 0),e([T()],jt.prototype,"camera",null),e([T({type:t})],jt.prototype,"contentCamera",null),e([T({readOnly:!0})],jt.prototype,"canvas",null),e([T({type:G,useTypeForAutocast:!1})],jt.prototype,"center",null),e([T({type:D})],jt.prototype,"clippingArea",null),e([T({type:fe,nonNullable:!0})],jt.prototype,"constraints",void 0),e([T({type:D,readOnly:!0})],jt.prototype,"renderDataExtent",null),e([T({readOnly:!0})],jt.prototype,"tileInfo",null),e([T({type:D,readOnly:!0})],jt.prototype,"dataExtent",null),e([T({type:D,readOnly:!0})],jt.prototype,"_groundAndLayersExtent",null),e([T({type:ve})],jt.prototype,"environment",null),e([R("environment")],jt.prototype,"castEnvironment",null),e([T({readOnly:!0})],jt.prototype,"environmentManager",void 0),e([T({type:D})],jt.prototype,"extent",null),e([T({type:r})],jt.prototype,"floors",void 0),e([T()],jt.prototype,"screenCenter",null),e([T()],jt.prototype,"frustum",null),e([T({type:Number,readOnly:!0})],jt.prototype,"fullOpacity",void 0),e([T({readOnly:!0})],jt.prototype,"graphicsView",void 0),e([T()],jt.prototype,"analysisViewManager",void 0),e([T()],jt.prototype,"groundView",void 0),e([T({readOnly:!0})],jt.prototype,"layerviewCollections",null),e([T({type:Boolean})],jt.prototype,"initialExtentRequired",null),e([T()],jt.prototype,"defaultsFromMapSettings",null),e([T()],jt.prototype,"interacting",null),e([T()],jt.prototype,"stationary",null),e([T()],jt.prototype,"navigating",null),e([T()],jt.prototype,"map",void 0),e([T()],jt.prototype,"padding",null),e([T({type:Qe,readOnly:!0})],jt.prototype,"pointsOfInterest",void 0),e([T()],jt.prototype,"_featureTiles",void 0),e([T()],jt.prototype,"featureTiles",null),e([T()],jt.prototype,"_featureTreeDebugger",void 0),e([T({constructOnly:!0})],jt.prototype,"deactivatedWebGLExtensions",void 0),e([T({constructOnly:!0})],jt.prototype,"debugWebGLExtensions",void 0),e([T({constructOnly:!0})],jt.prototype,"renderCanvas",void 0),e([T({constructOnly:!0})],jt.prototype,"state",void 0),e([T()],jt.prototype,"screenSizePerspective",void 0),e([T({readOnly:!0})],jt.prototype,"inputManager",void 0),e([T({readOnly:!0})],jt.prototype,"stateManager",void 0),e([T({type:["low","medium","high"]})],jt.prototype,"qualityProfile",null),e([T({type:We,get(){let e=this._get("qualitySettings");if(!e){const t=Ue(this.qualityProfile);e=new We(t)}return e}})],jt.prototype,"qualitySettings",void 0),e([T()],jt.prototype,"slice",void 0),e([T({readOnly:!0})],jt.prototype,"typeSpecificPreconditionsReady",null),e([T({readOnly:!0})],jt.prototype,"renderCoordsHelper",void 0),e([T({readOnly:!0})],jt.prototype,"sceneIntersectionHelper",void 0),e([T({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],jt.prototype,"resolution",null),e([T({type:Number})],jt.prototype,"scale",null),e([T({readOnly:!0,type:Number})],jt.prototype,"terrainLevel",null),e([T()],jt.prototype,"heightModelInfo",null),e([T()],jt.prototype,"spatialReference",void 0),e([T({type:Boolean,value:!1})],jt.prototype,"alphaCompositingEnabled",null),e([T({constructOnly:!0})],jt.prototype,"preserveDrawingBufferEnabled",void 0),e([T({type:Boolean})],jt.prototype,"supersampleScreenshotsEnabled",void 0),e([T({readOnly:!0})],jt.prototype,"type",void 0),e([T(),R(e=>e instanceof wt?e:A(vt,e))],jt.prototype,"ui",void 0),e([T({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],jt.prototype,"updating",null),e([T()],jt.prototype,"_updatingObjects",null),e([T()],jt.prototype,"_updatingObjectsWithProgress",null),e([T({type:Number,readOnly:!0,dependsOn:["updating"]})],jt.prototype,"updatingProgress",void 0),e([T({type:["global","local"]})],jt.prototype,"viewingMode",null),e([T({type:i})],jt.prototype,"viewpoint",null),e([T({readOnly:!0})],jt.prototype,"visibleArea",null),e([T({type:Number})],jt.prototype,"zoom",null),e([T({type:ht})],jt.prototype,"highlightOptions",null),e([T({readOnly:!0})],jt.prototype,"quality",null),e([T({readOnly:!0})],jt.prototype,"resolutionScale",null),e([T()],jt.prototype,"focusAreasView",void 0),e([T()],jt.prototype,"_defaultToMapOptions",null),e([T()],jt.prototype,"_defaultHitTestOptions",null),jt=Mt=e([x("esri.views.SceneView")],jt);const Tt=H(),Rt=S(),xt=Y(),Ot=J(0,0,0,z.WebMercator),At={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Et=jt;export{Et 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import{referenceSetter as s}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as d}from"../core/Loadable.js";import h from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import{watch as g,sync as f,whenOnce as w,when as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{property as M,subclass as V}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as R}from"../core/support/OwningCollection.js";import{UpdatingHandles as S}from"../core/support/UpdatingHandles.js";import b from"../geometry/Extent.js";import T from"../geometry/HeightModelInfo.js";import E from"../geometry/SpatialReference.js";import{equals as j}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as F}from"../support/AnalysesCollection.js";import{GraphicsCollection as L}from"../support/GraphicsCollection.js";import{system as x}from"../time/constants.js";import k from"../time/TimeExtent.js";import{isTimeZoneValid as C}from"../time/timeZoneUtils.js";import O from"./BasemapView.js";import H from"./Magnifier.js";import q from"./SelectionManager.js";import P from"./Theme.js";import{ToolViewManager as W}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as Z}from"./3d/support/DefaultHighlights.js";import I from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{DefaultsFromMap as U}from"./support/DefaultsFromMap.js";import z from"./support/HighlightOptions.js";import N from"./support/LayerViewManager.js";import G from"./support/RequiredFieldsOptions.js";var $;let B=class extends(n(m)){static{$=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new S,this.allLayerViews=new a({getCollections:()=>this.layerviewCollections,getChildrenFunction:Q}),this.analyses=new F,this.animationsEnabled=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new L,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new H,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new I,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new r,this.requiredFieldsOptions=new G,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(g(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,$.views.add(this)):(this._lockedSpatialReference=null,$.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}this.analysisViewManager?.attach(),this.toolViewManager.attach()}},f))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this._validateWithErrorDisplay()]).then(()=>(this._isValid=!0,w(()=>this.ready)))),this.basemapView=new O({view:this}),this.layerViewManager=new N({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new W({view:this}),this.selectionManager=new q({view:this}),this.addHandles([v(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{h.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),g(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},_),g(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},f),g(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},_)])}get _layerToLayerviewMapping(){return $._layerToLayerview}static{this._layerToLayerview=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.basemap.groundLayers","view.basemapView.groundLayerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"],["view.map.layers","view.layerViews"]]}destroy(){this.destroyed||($.views.remove(this),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.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.analysisViewManager=y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.layerViews?.forEach(e=>e.destroy()),this.layerViews.length=0,this.invalidate(),this.handles.destroy(),this.map=y(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return h.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new U({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get highlights(){return this._get("highlights")??Z()}set highlights(e){this._set("highlights",s(e,this._get("highlights"),r.ofType(z)))}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!this.destroying&&!this.destroyed&&!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(h.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),d(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=i(e=>c(has("view-readyState-waiting-delay"),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!j(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 timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??x}set timeZone(e){this._userTimeZone=e,C(e)||h.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??"default"}acquireCursor(e,t="low"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},a=p(()=>i.remove(r));return i.add(r),this.addHandles(a),a}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new P}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&h.getLogger(this).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&&(v(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}async _validateWithErrorDisplay(){try{await this.validate()}catch(e){const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const a=document.createElement("a");a.innerHTML="https://esriurl.com/webgl-faq",a.target="_blank",a.setAttribute("style","font-size: 18px;"),a.href="https://esriurl.com/webgl-faq",t.appendChild(i),t.appendChild(r),t.appendChild(a);const s=this.getSurface();throw s&&s.appendChild(t),e}}};e([M()],B.prototype,"_userSpatialReference",void 0),e([M()],B.prototype,"activeTool",null),e([M({readOnly:!0})],B.prototype,"allLayerViews",void 0),e([M({readOnly:!0})],B.prototype,"layerviewCollections",null),e([M(R(F,"analyses"))],B.prototype,"analyses",void 0),e([M()],B.prototype,"animation",null),e([M()],B.prototype,"animationsEnabled",void 0),e([M()],B.prototype,"basemapView",void 0),e([M()],B.prototype,"center",null),e([M()],B.prototype,"defaultsFromMapSettings",null),e([M()],B.prototype,"defaultsFromMap",null),e([M()],B.prototype,"dependencies",void 0),e([M()],B.prototype,"displayFilterEnabled",void 0),e([M({type:b})],B.prototype,"extent",null),e([M()],B.prototype,"fatalError",void 0),e([M(R(L,"graphics"))],B.prototype,"graphics",void 0),e([M({readOnly:!0,type:T})],B.prototype,"heightModelInfo",null),e([M({type:r.ofType(z)})],B.prototype,"highlights",null),e([M({readOnly:!0})],B.prototype,"interacting",null),e([M({constructOnly:!0})],B.prototype,"layerViewFilter",void 0),e([M({readOnly:!0})],B.prototype,"navigating",null),e([M({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],B.prototype,"preconditionsReady",null),e([M({readOnly:!0})],B.prototype,"typeSpecificPreconditionsReady",void 0),e([M({type:r,readOnly:!0})],B.prototype,"layerViews",void 0),e([M()],B.prototype,"resolution",null),e([M({type:H})],B.prototype,"magnifier",void 0),e([M({value:null,type:t})],B.prototype,"map",null),e([M()],B.prototype,"padding",void 0),e([M({readOnly:!0})],B.prototype,"ready",void 0),e([M()],B.prototype,"_readyStateWaitingTask",void 0),e([M({readOnly:!0})],B.prototype,"readyState",null),e([M({type:E})],B.prototype,"spatialReference",null),e([M()],B.prototype,"stationary",null),e([M({type:k})],B.prototype,"timeExtent",null),e([M({type:String,nonNullable:!0})],B.prototype,"timeZone",null),e([M()],B.prototype,"tools",null),e([M()],B.prototype,"toolViewManager",void 0),e([M({readOnly:!0})],B.prototype,"type",void 0),e([M({type:Number})],B.prototype,"scale",void 0),e([M({readOnly:!0})],B.prototype,"updating",void 0),e([M({readOnly:!0})],B.prototype,"initialExtentRequired",void 0),e([M({readOnly:!0})],B.prototype,"initialExtent",null),e([M()],B.prototype,"cursor",null),e([M({readOnly:!0})],B.prototype,"input",void 0),e([M({type:A,nonNullable:!0})],B.prototype,"navigation",void 0),e([M()],B.prototype,"layerViewManager",void 0),e([M()],B.prototype,"analysisViewManager",void 0),e([M()],B.prototype,"selectionManager",void 0),e([M()],B.prototype,"width",void 0),e([M()],B.prototype,"height",void 0),e([M({readOnly:!0})],B.prototype,"resizing",void 0),e([M({value:null,readOnly:!0})],B.prototype,"size",null),e([M({readOnly:!0})],B.prototype,"suspended",void 0),e([M({readOnly:!0})],B.prototype,"viewEvents",void 0),e([M({readOnly:!0})],B.prototype,"persistableViewModels",void 0),e([M()],B.prototype,"_isValid",void 0),e([M()],B.prototype,"_readyCycleForced",void 0),e([M()],B.prototype,"_lockedSpatialReference",void 0),e([M()],B.prototype,"_userTimeZone",void 0),e([M()],B.prototype,"_lockedTimeZone",void 0),e([M()],B.prototype,"_userTimeExtent",void 0),e([M()],B.prototype,"_lockedTimeExtent",void 0),e([M({type:P})],B.prototype,"theme",void 0),e([M({readOnly:!0,type:P})],B.prototype,"effectiveTheme",null),B=$=e([V("esri.views.View")],B);const J=globalThis.$arcgis;J&&!J.views&&Object.defineProperty(J,"views",{configurable:!1,enumerable:!0,writable:!1,value:B.views});const K=B;function Q(e){return e.layerViews}export{K as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import{referenceSetter as s}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as d}from"../core/Loadable.js";import h from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import{watch as g,sync as f,whenOnce as w,when as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{property as V,subclass as M}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as b}from"../core/support/OwningCollection.js";import{UpdatingHandles as R}from"../core/support/UpdatingHandles.js";import S from"../geometry/Extent.js";import T from"../geometry/HeightModelInfo.js";import E from"../geometry/SpatialReference.js";import{equals as j}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as F}from"../support/AnalysesCollection.js";import{GraphicsCollection as L}from"../support/GraphicsCollection.js";import{system as x}from"../time/constants.js";import k from"../time/TimeExtent.js";import{isTimeZoneValid as C}from"../time/timeZoneUtils.js";import O from"./BasemapView.js";import H from"./Magnifier.js";import I from"./SelectionManager.js";import q from"./Theme.js";import{ToolViewManager as P}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as W}from"./3d/support/DefaultHighlights.js";import Z from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{deduplicateAttributionItems as U}from"./support/attributionUtils.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";import N from"./support/HighlightOptions.js";import G from"./support/LayerViewManager.js";import $ from"./support/RequiredFieldsOptions.js";var B;let J=class extends(n(m)){static{B=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new R,this.allLayerViews=new a({getCollections:()=>this.layerviewCollections,getChildrenFunction:X}),this.analyses=new F,this.animationsEnabled=!0,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new L,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new H,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new Z,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new r,this.requiredFieldsOptions=new $,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(g(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,B.views.add(this)):(this._lockedSpatialReference=null,B.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}this.analysisViewManager?.attach(),this.toolViewManager.attach()}},f))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this._validateWithErrorDisplay()]).then(()=>(this._isValid=!0,w(()=>this.ready)))),this.basemapView=new O({view:this}),this.layerViewManager=new G({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new P({view:this}),this.selectionManager=new I({view:this}),this.addHandles([v(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{h.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),g(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},_),g(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},f),g(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},_)])}get _layerToLayerviewMapping(){return B._layerToLayerview}static{this._layerToLayerview=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.basemap.groundLayers","view.basemapView.groundLayerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"],["view.map.layers","view.layerViews"]]}destroy(){this.destroyed||(B.views.remove(this),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.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.analysisViewManager=y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.layerViews?.forEach(e=>e.destroy()),this.layerViews.length=0,this.invalidate(),this.handles.destroy(),this.map=y(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return h.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get attributionItems(){return U(this._get("attributionItems"),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get highlights(){return this._get("highlights")??W()}set highlights(e){this._set("highlights",s(e,this._get("highlights"),r.ofType(N)))}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!this.destroying&&!this.destroyed&&!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(h.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),d(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=i(e=>c(has("view-readyState-waiting-delay"),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!j(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 timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??x}set timeZone(e){this._userTimeZone=e,C(e)||h.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??"default"}acquireCursor(e,t="low"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},a=p(()=>i.remove(r));return i.add(r),this.addHandles(a),a}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new q}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&h.getLogger(this).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&&(v(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}async _validateWithErrorDisplay(){try{await this.validate()}catch(e){const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const a=document.createElement("a");a.innerHTML="https://esriurl.com/webgl-faq",a.target="_blank",a.setAttribute("style","font-size: 18px;"),a.href="https://esriurl.com/webgl-faq",t.appendChild(i),t.appendChild(r),t.appendChild(a);const s=this.getSurface();throw s&&s.appendChild(t),e}}};e([V()],J.prototype,"_userSpatialReference",void 0),e([V()],J.prototype,"activeTool",null),e([V({readOnly:!0})],J.prototype,"allLayerViews",void 0),e([V({readOnly:!0})],J.prototype,"layerviewCollections",null),e([V(b(F,"analyses"))],J.prototype,"analyses",void 0),e([V()],J.prototype,"animation",null),e([V()],J.prototype,"animationsEnabled",void 0),e([V({readOnly:!0})],J.prototype,"attributionItems",null),e([V()],J.prototype,"attributionVisible",void 0),e([V()],J.prototype,"basemapView",void 0),e([V()],J.prototype,"center",null),e([V()],J.prototype,"defaultsFromMapSettings",null),e([V()],J.prototype,"defaultsFromMap",null),e([V()],J.prototype,"dependencies",void 0),e([V()],J.prototype,"displayFilterEnabled",void 0),e([V({type:S})],J.prototype,"extent",null),e([V()],J.prototype,"fatalError",void 0),e([V(b(L,"graphics"))],J.prototype,"graphics",void 0),e([V({readOnly:!0,type:T})],J.prototype,"heightModelInfo",null),e([V({type:r.ofType(N)})],J.prototype,"highlights",null),e([V({readOnly:!0})],J.prototype,"interacting",null),e([V({constructOnly:!0})],J.prototype,"layerViewFilter",void 0),e([V({readOnly:!0})],J.prototype,"navigating",null),e([V({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],J.prototype,"preconditionsReady",null),e([V({readOnly:!0})],J.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:r,readOnly:!0})],J.prototype,"layerViews",void 0),e([V()],J.prototype,"resolution",null),e([V({type:H})],J.prototype,"magnifier",void 0),e([V({value:null,type:t})],J.prototype,"map",null),e([V()],J.prototype,"padding",void 0),e([V({readOnly:!0})],J.prototype,"ready",void 0),e([V()],J.prototype,"_readyStateWaitingTask",void 0),e([V({readOnly:!0})],J.prototype,"readyState",null),e([V({type:E})],J.prototype,"spatialReference",null),e([V()],J.prototype,"stationary",null),e([V({type:k})],J.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],J.prototype,"timeZone",null),e([V()],J.prototype,"tools",null),e([V()],J.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],J.prototype,"type",void 0),e([V({type:Number})],J.prototype,"scale",void 0),e([V({readOnly:!0})],J.prototype,"updating",void 0),e([V({readOnly:!0})],J.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],J.prototype,"initialExtent",null),e([V()],J.prototype,"cursor",null),e([V({readOnly:!0})],J.prototype,"input",void 0),e([V({type:A,nonNullable:!0})],J.prototype,"navigation",void 0),e([V()],J.prototype,"layerViewManager",void 0),e([V()],J.prototype,"analysisViewManager",void 0),e([V()],J.prototype,"selectionManager",void 0),e([V()],J.prototype,"width",void 0),e([V()],J.prototype,"height",void 0),e([V({readOnly:!0})],J.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],J.prototype,"size",null),e([V({readOnly:!0})],J.prototype,"suspended",void 0),e([V({readOnly:!0})],J.prototype,"viewEvents",void 0),e([V({readOnly:!0})],J.prototype,"persistableViewModels",void 0),e([V()],J.prototype,"_isValid",void 0),e([V()],J.prototype,"_readyCycleForced",void 0),e([V()],J.prototype,"_lockedSpatialReference",void 0),e([V()],J.prototype,"_userTimeZone",void 0),e([V()],J.prototype,"_lockedTimeZone",void 0),e([V()],J.prototype,"_userTimeExtent",void 0),e([V()],J.prototype,"_lockedTimeExtent",void 0),e([V({type:q})],J.prototype,"theme",void 0),e([V({readOnly:!0,type:q})],J.prototype,"effectiveTheme",null),J=B=e([M("esri.views.View")],J);const K=globalThis.$arcgis;K&&!K.views&&Object.defineProperty(K,"views",{configurable:!1,enumerable:!0,writable:!1,value:J.views});const Q=J;function X(e){return e.layerViews}export{Q as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as e}from"../../../../core/asyncUtils.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{watch as r,when as a,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as m}from"../../../../core/support/UpdatingHandles.js";import{absoluteHeightElevationInfo as u}from"../../../../support/elevationInfoUtils.js";import{getConstraintContext as d}from"../../../interactive/sketch/constraintUtils.js";import{makeTooltip as h}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{DynamicTooltipInfo as f}from"../../../interactive/tooltip/infos/DynamicTooltipInfo.js";import{loadAutomaticAreaMeasurementUtils as g}from"../../../support/automaticAreaMeasurementUtils.js";import{loadAutomaticLengthMeasurementUtils as _}from"../../../support/automaticLengthMeasurementUtils.js";let y=class extends o{constructor(t){super(t),this.constraintsEnabled=!0,this._updatingHandles=new m,this._measurementUtilsLoadTask=null}initialize(){this.addHandles([r(()=>!!this.context?.sketchOptions?.tooltips.enabled,t=>{const{context:o}=this;t&&o?.view&&o.sketchOptions?(this._tooltipInfo??=new f({sketchOptions:o.sketchOptions,getAllFields:this.getAllFields,viewType:o.view.type}),this._tooltip??=h(()=>({view:o.view,options:o.sketchOptions.tooltips,info:this.tooltipInfo}))):(this._tooltip=s(this._tooltip),this._tooltipInfo=s(this._tooltipInfo))},l),a(()=>this._needsMeasurement,()=>{const t=e(async t=>{const[o,e]=await Promise.all([g(),_()]);n(t),this._automaticAreaMeasurementUtils=o,this._automaticLengthMeasurementUtils=e});this.addHandles(i(()=>t.abort())),this._updatingHandles.addPromise(t.promise)},{once:!0,initial:!0})])}destroy(){this._measurementUtilsLoadTask?.abort(),this._tooltip=s(this._tooltip),this._tooltipInfo=s(this._tooltipInfo)}set getAllFields(t){this._set("getAllFields",t),this.tooltipInfo&&(this.tooltipInfo.getAllFields=t)}get context(){return this.getDependencies?.()}get updating(){return this._updatingHandles.updating}get tooltip(){return this._tooltip}get tooltipInfo(){return this._tooltipInfo}get automaticLengthMeasurementUtils(){return this._automaticLengthMeasurementUtils}get automaticAreaMeasurementUtils(){return this._automaticAreaMeasurementUtils}get constraints(){const{tooltipInfo:t,context:o}=this,{view:e,editGeometryOperations:i,elevationInfo:s,sketchOptions:n}=o??{},r=this.getLastScreenPosition?.();if(!(r&&e&&t&&i&&n))return null;const{coordinateHelper:a,spatialReference:l}=i.data,p=e.toMap(r);if(!p)return null;const c=d(p,e,l,s??u,a.hasZ(),n.values.effectiveDirectionMode),m=t.knownConstraintFields,h={context:c};for(const u of m)switch(u.name){case"direction":case"distance":case"elevation":h[u.name]=u.committed;break;case"x":h[u.name]=U(u.committed),h.longitude=v(u.committed);break;case"y":h[u.name]=U(u.committed),h.latitude=v(u.committed)}return h}get _needsMeasurement(){return!!this.context?.sketchOptions.tooltips.enabled}};function v(t){return null!=t&&"unit"in t&&"rotationType"in t?t:null}function U(t){return null==t||"rotationType"in t?null:t}t([p()],y.prototype,"getDependencies",void 0),t([p()],y.prototype,"getLastScreenPosition",void 0),t([p()],y.prototype,"getAllFields",null),t([p()],y.prototype,"context",null),t([p()],y.prototype,"updating",null),t([p()],y.prototype,"tooltip",null),t([p()],y.prototype,"tooltipInfo",null),t([p()],y.prototype,"automaticLengthMeasurementUtils",null),t([p()],y.prototype,"automaticAreaMeasurementUtils",null),t([p()],y.prototype,"constraintsEnabled",void 0),t([p()],y.prototype,"constraints",null),t([p()],y.prototype,"_updatingHandles",void 0),t([p()],y.prototype,"_tooltip",void 0),t([p()],y.prototype,"_tooltipInfo",void 0),t([p()],y.prototype,"_automaticLengthMeasurementUtils",void 0),t([p()],y.prototype,"_automaticAreaMeasurementUtils",void 0),t([p()],y.prototype,"_needsMeasurement",null),y=t([c("esri.views.draw.support.managers.DrawTooltipManager")],y);export{y as DrawTooltipManager};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as t}from"tslib";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{DrawHeaderActions as e}from"../components/DrawHeaderActions.js";import{Fields as i}from"./Fields.js";import{TooltipContent as s}from"./TooltipContent.js";import{tsx as n}from"../../../../widgets/support/widget.js";let r=class extends s{_renderContent(){const{fieldContext:t,info:o,mode:e}=this;return n(i,{context:t,fields:o.allFields,mode:e})}_renderActions(){const{xyMode:t,sketchOptions:o}=this.info,i=this.info.allFields.some(t=>"direction"===t.name);return n(e,{sketchOptions:o,visibleElements:{direction:"direction-distance"===t&&i}})}};r=t([o("esri.views.interactive.tooltip.content.TooltipContentDynamic")],r);export{r as TooltipContentDynamic};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{TooltipContentDrawCircle as t}from"./TooltipContentDrawCircle.js";import{TooltipContentDrawMesh as o}from"./TooltipContentDrawMesh.js";import{TooltipContentDrawPoint as n}from"./TooltipContentDrawPoint.js";import{TooltipContentDrawPolygon as e}from"./TooltipContentDrawPolygon.js";import{TooltipContentDrawPolyline as r}from"./TooltipContentDrawPolyline.js";import{TooltipContentDrawRectangle as i}from"./TooltipContentDrawRectangle.js";import{
|
|
5
|
+
import{TooltipContentDrawCircle as t}from"./TooltipContentDrawCircle.js";import{TooltipContentDrawMesh as o}from"./TooltipContentDrawMesh.js";import{TooltipContentDrawPoint as n}from"./TooltipContentDrawPoint.js";import{TooltipContentDrawPolygon as e}from"./TooltipContentDrawPolygon.js";import{TooltipContentDrawPolyline as r}from"./TooltipContentDrawPolyline.js";import{TooltipContentDrawRectangle as i}from"./TooltipContentDrawRectangle.js";import{TooltipContentDynamic as a}from"./TooltipContentDynamic.js";import{TooltipContentElevation as l}from"./TooltipContentElevation.js";import{TooltipContentExtentRotate as p}from"./TooltipContentExtentRotate.js";import{TooltipContentExtentScale as s}from"./TooltipContentExtentScale.js";import{TooltipContentMovePoint as c}from"./TooltipContentMovePoint.js";import{TooltipContentReshapeEdgeOffset as m}from"./TooltipContentReshapeEdgeOffset.js";import{TooltipContentSelectedVertex as f}from"./TooltipContentSelectedVertex.js";import{TooltipContentTransformMesh as w}from"./TooltipContentTransformMesh.js";import{TooltipContentTransformPoint as u}from"./TooltipContentTransformPoint.js";import{TooltipContentTranslate as T}from"./TooltipContentTranslate.js";import{TooltipContentTranslateVertex as C}from"./TooltipContentTranslateVertex.js";import{TooltipContentTranslateXY as j}from"./TooltipContentTranslateXY.js";import{TooltipContentTranslateZ as d}from"./TooltipContentTranslateZ.js";function x(x,y){if(null==y)return null;const h=document.createElement("div");switch(y.type){case"dynamic":return new a({tooltip:x,info:y,container:h});case"draw-point":case"draw-multipoint":return new n({tooltip:x,info:y,container:h});case"draw-polygon":return new e({tooltip:x,info:y,container:h});case"draw-polyline":return new r({tooltip:x,info:y,container:h});case"draw-mesh":return new o({tooltip:x,info:y,container:h});case"draw-rectangle":return new i({tooltip:x,info:y,container:h});case"draw-circle":return new t({tooltip:x,info:y,container:h});case"elevation":return new l({tooltip:x,info:y,container:h});case"extent-rotate":return new p({tooltip:x,info:y,container:h});case"extent-scale":return new s({tooltip:x,info:y,container:h});case"move-point":return new c({tooltip:x,info:y,container:h});case"selected-vertex":return new f({tooltip:x,info:y,container:h});case"transform-point":return new u({tooltip:x,info:y,container:h});case"transform-mesh":return new w({tooltip:x,info:y,container:h});case"translate":return new T({tooltip:x,info:y,container:h});case"translate-vertex":return new C({tooltip:x,info:y,container:h});case"translate-z":return new d({tooltip:x,info:y,container:h});case"translate-xy":return new j({tooltip:x,info:y,container:h});case"reshape-edge-offset":return new m({tooltip:x,info:y,container:h})}}export{x as tooltipContentFactory};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import
|
|
5
|
+
import{__decorate as t}from"tslib";import i from"../../../../core/Accessor.js";import{generateUUID as l}from"../../../../core/uuid.js";import{property as o,subclass as e}from"../../../../core/accessorSupport/decorators.js";let s=class extends i{constructor(t){super(t),this.actual=null,this.lockable=!0,this.id=l(),this.inputValue=null,this.readOnly=!1,this.suffix=null,this.visible=!0,this.invalid=!1,this.unlockOnVertexPlacement=!0,this.displayOrder=0}get committed(){return this.lockable?this._get("committed"):null}set committed(t){this.lockable&&this._set("committed",t)}get dirty(){return null!=this.inputValue}get disabled(){return null==this.actual&&!this.dirty&&!this.locked}get locked(){return this.lockable&&null!=this.committed}onInput(t){this.inputValue=t,this.invalid=!1}onCommit(t,i,l){this.lockable?this._onCommitLockable(t,l):this._onCommitNonLockable(l),this.invalid&&"commit-and-exit"===t||l.onCommit(i,t)}_onCommitLockable(t,i){const{inputValue:l,locked:o}=this;o&&n(l)?this.unlock():("commit-and-exit"===t&&!o||null!=l)&&this._parseInputAndLock(i)}_onCommitNonLockable(t){const{inputValue:i}=this;n(i)?this.lockable?this.setActual(null):this.clearInputValue():null!=i&&this._parseInputAndSetActual(t)}applyValue(t){this.lockable?this.lock(t):this.setActual(t)}clearInputValue(){this.inputValue=null,this.invalid=!1}setActual(t){this.actual=t,this.clearInputValue()}lock(t){this.lockable&&(this.committed=t??this.actual,this.clearInputValue())}unlock(){this.lockable&&(this.committed=null,this.clearInputValue())}toggleLock(t){this.lockable&&(this.locked?this.unlock():this._parseInputAndLock(t))}getSuffix(t){const{suffix:i}=this;return"function"==typeof i?i(t):i}getFormattedValue(t){const{actual:i,committed:l,format:o}=this;return null!=l?o(l,t):null!=i?o(i,t):null}getRawDisplayValue(t){const{actual:i,committed:l,inputValue:o}=this;return null!=o?o:this.lockable&&null!=l?this.formatForInputMode(l,t):null!=i?this.formatForInputMode(i,t):null}_parseInputAndSetActual(t){const{inputValue:i}=this;if(null==i||n(i))return this.setActual(null);const l=this.parse(i,t);null!=l?this.setActual(l):this.invalid=!0}_parseInputAndLock(t){const{inputValue:i,actual:l}=this;if(n(i))return this.unlock();if(null==i)return this.lock(l);const o=this.parse(i,t);null!=o?this.lock(o):this.invalid=!0}};function n(t){return null!=t&&""===t.trim()}t([o()],s.prototype,"actual",void 0),t([o()],s.prototype,"committed",null),t([o()],s.prototype,"dirty",null),t([o()],s.prototype,"disabled",null),t([o()],s.prototype,"format",void 0),t([o()],s.prototype,"formatForInputMode",void 0),t([o()],s.prototype,"lockable",void 0),t([o()],s.prototype,"locked",null),t([o()],s.prototype,"id",void 0),t([o()],s.prototype,"inputValue",void 0),t([o()],s.prototype,"name",void 0),t([o()],s.prototype,"parse",void 0),t([o()],s.prototype,"readOnly",void 0),t([o()],s.prototype,"suffix",void 0),t([o()],s.prototype,"title",void 0),t([o()],s.prototype,"visible",void 0),t([o()],s.prototype,"invalid",void 0),t([o()],s.prototype,"unlockOnVertexPlacement",void 0),t([o()],s.prototype,"displayOrder",void 0),s=t([e("esri.views.interactive.tooltip.fields.TooltipField")],s);export{s as TooltipField};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{SketchTooltipInfo as s}from"./SketchTooltipInfo.js";let n=class extends s{constructor(e){super(e),this.type="dynamic",this.xyMode="direction-distance",this._isVisibleField=e=>{switch(e.name){case"x":case"y":return this.visibleElements.coordinates;default:return this.visibleElements[e.name]}}}get availableFields(){return this.getAllFields?.()??[]}get elevation(){return this.allFields.find(e=>"elevation"===e.name)}get allFields(){const{availableFields:e,_useCoordinateDisplay:t,_useDirectionDistanceDisplay:i}=this;return(t?e.filter(l):i?e.filter(r):e).filter(this._isVisibleField).sort(o)}get knownConstraintFields(){return this.allFields.filter(a)}get _useCoordinateDisplay(){const{availableFields:e,xyMode:t}=this;return"coordinates"===t&&e.some(e=>"x"===e.name)&&e.some(e=>"y"===e.name)}get _useDirectionDistanceDisplay(){const{availableFields:e,xyMode:t}=this;return"direction-distance"===t&&e.some(e=>"distance"===e.name)&&e.some(e=>"direction"===e.name)}};function o(e,t){return e.displayOrder-t.displayOrder}function l(e){return"direction"!==e.name&&"distance"!==e.name}function r(e){return"x"!==e.name&&"y"!==e.name}function a(e){switch(e.name){case"direction":case"distance":case"elevation":case"x":case"y":return!0;default:return!1}}e([t()],n.prototype,"type",void 0),e([t()],n.prototype,"xyMode",void 0),e([t()],n.prototype,"getAllFields",void 0),e([t()],n.prototype,"availableFields",null),e([t()],n.prototype,"elevation",null),e([t()],n.prototype,"allFields",null),e([t()],n.prototype,"knownConstraintFields",null),e([t()],n.prototype,"_useCoordinateDisplay",null),e([t()],n.prototype,"_useDirectionDistanceDisplay",null),n=e([i("esri.views.interactive.tooltip.infos.DynamicTooltipInfo")],n);export{n as DynamicTooltipInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as
|
|
5
|
+
import{__decorate as t}from"tslib";import{createTask as e}from"../../core/asyncUtils.js";import{EventedAccessor as i}from"../../core/Evented.js";import{IdentifiableMixin as r}from"../../core/Identifiable.js";import s from"../../core/Logger.js";import{destroyMaybe as n,removeMaybe as a}from"../../core/maybe.js";import{EsriPromiseMixin as l}from"../../core/Promise.js";import{throwIfAborted as o}from"../../core/promiseUtils.js";import{property as u,subclass as p}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../core/support/UpdatingHandles.js";import{getAttributionItemFromUserCopyright as h,isDynamicAttributionLayer as y,createAttributionIndex as c,getAttributionItemsFromIndex as g,getAttributionItemFromAccessInformation as m,getAttributionItemFromLayerCopyright as b}from"../support/attributionUtils.js";import{validateScaleRange as f}from"../support/layerViewUtils.js";let v=class extends(r(l(i))){get spatialReferenceSupported(){return!0}constructor(t){super(t),this._updatingHandles=new d,this._attributionIndexTask=null,this.layer=null,this.parent=null}initialize(){this.when().catch(t=>{if("layerview:create-error"!==t.name){const e=this.layer&&this.layer.id||"no id",i=this.layer?.title||"no title";s.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${i}', id: '${e}')`,t)}})}destroy(){this._updatingHandles=n(this._updatingHandles),this._attributionIndexTask=a(this._attributionIndexTask),this._set("parent",null)}get attributionItems(){const t=this._get("attributionItems")??[];if(this.suspended||!this.layer?.attributionVisible)return 0===t.length?t:[];if(!this.view.stationary)return t;const e=this.getAttributionItems();return t?.length!==e.length||t?.some((t,i)=>t.text!==e[i].text)?e:t}get attributionUpdating(){return!!this._attributionIndexTask&&!this._attributionIndexTask.finished}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&!0===this.layer?.legendEnabled}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return!0===this.layer?.visible}set visible(t){this._overrideIfSome("visible",t)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const t=this.view.timeExtent,e=this.layer?.visibilityTimeExtent;return!t||!e||!t.intersection(e).isEmpty}canResume(){const t=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&f(t)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const t=this.parent?.suspended?this.parent.suspendInfo:{},e=this;e.view?.ready||(t.viewNotReady=!0),this.layer&&this.layer.loaded||(t.layerNotLoaded=!0);const i=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return f(i)&&this.visibleAtCurrentScale||(t.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(t.outsideVisibilityTimeExtent=!0),this.visible||(t.layerInvisible=!0),t}isUpdating(){return!1}getAttributionItems(){const t=h(this.layer);if(t)return[t];if(y(this.layer)&&(this._attributionIndexTask||(this._attributionIndexTask=e(async t=>{const e=await this.layer.fetchAttributionData();return o(t),c(e)}),this._updatingHandles.addPromise(this._attributionIndexTask.promise)),this._attributionIndexTask?.finished&&this._attributionIndexTask.value))return g(this._attributionIndexTask.value,this.layer.tileInfo,this.view.scale,this.view.extent);const i=m(this.layer);if(i)return[i];const r=b(this.layer);return r?[r]:[]}};t([u({readOnly:!0})],v.prototype,"spatialReferenceSupported",null),t([u()],v.prototype,"view",void 0),t([u({readOnly:!0})],v.prototype,"attributionItems",null),t([u({readOnly:!0})],v.prototype,"attributionUpdating",null),t([u()],v.prototype,"fullOpacity",null),t([u()],v.prototype,"layer",void 0),t([u()],v.prototype,"parent",void 0),t([u({readOnly:!0})],v.prototype,"suspended",null),t([u({readOnly:!0})],v.prototype,"suspendInfo",null),t([u({readOnly:!0})],v.prototype,"legendEnabled",null),t([u({type:Boolean,readOnly:!0})],v.prototype,"updating",null),t([u({readOnly:!0})],v.prototype,"updatingProgress",null),t([u()],v.prototype,"updateSuspended",null),t([u()],v.prototype,"visible",null),t([u({readOnly:!0})],v.prototype,"visibleAtCurrentScale",null),t([u({readOnly:!0})],v.prototype,"visibleAtCurrentTimeExtent",null),v=t([p("esri.views.layers.LayerView")],v);export{v 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import r from"../../core/Accessor.js";import t from"../../core/Error.js";import i from"../../core/Logger.js";import{someMap as o}from"../../core/MapUtils.js";import{createResolver as s,createAbortError as a,isAbortError as n}from"../../core/promiseUtils.js";import{on as l,watch as y,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../../core/Accessor.js";import t from"../../core/Error.js";import i from"../../core/Logger.js";import{someMap as o}from"../../core/MapUtils.js";import{createResolver as s,createAbortError as a,isAbortError as n}from"../../core/promiseUtils.js";import{on as l,watch as y,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as c}from"../../core/scheduling.js";import{property as p,subclass as d}from"../../core/accessorSupport/decorators.js";import{get as w}from"../../core/accessorSupport/get.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{destroyMap as u}from"../../support/collectionUtils.js";import{LayerLayerViewInfo as m}from"./LayerLayerViewInfo.js";function g(e){return null!=e&&"object"==typeof e&&"layerViews"in e}let _=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new f,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)!1!==this.layerViewFilter?.(r)&&this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=s(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(c(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const{map:e}=this.view;if(!e)return void this.clear();if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,t=[],i=this.view.ready,o=e=>{if(null!=e)for(const s of e)if(s){if(!1===this.layerViewFilter?.(s))continue;r.add(s);const e=this._layerLayerViewInfoMap.get(s);e&&i?e.start():e||this._recyclingInfoMap.has(s)||t.push(s),"layers"in s&&s.layers&&o(s.layers)}};for(const n of this._rootCollectionNames)o(w(this,n));const s=new Array,a=e=>{const r=e.tryRecycle(t);r?(this._recyclingInfoMap.set(e.layer,e),this.notifyChange("updating"),r.then(()=>{this._recyclingInfoMap.delete(e.layer),this._layerLayerViewInfoMap.set(e.layer,e),this._reschedule(),this.notifyChange("updating")}).catch(r=>{n(r)||(this._recyclingInfoMap.delete(e.layer),e.destroy(),this._reschedule(),this.notifyChange("updating"))})):s.push(e)};for(const n of this._layerLayerViewInfoMap.values())r.has(n.layer)||(this._layerLayerViewInfoMap.delete(n.layer),a(n));for(const n of this._recyclingInfoMap.values())r.has(n.layer)||(this._recyclingInfoMap.delete(n.layer),a(n));for(const n of t)this._createLayerView(n);this._refreshCollections(),s.forEach(e=>e.destroy());const l=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.groundLayers,e?.basemap?.referenceLayers,e?.layers].filter(e=>!!e);r.forEach(e=>"layers"in e&&l.push(e.layers)),this.addHandles(l.map(e=>this._watchUpdatingTracking.addOnCollectionChange(()=>e,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null},this._layersToLayerViews=new Map(e.layerviewMapping)}initialize(){this.addHandles([l(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),y(()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]},()=>this._reschedule(),h)]),this._preloadLayerViewModules(),this._reschedule()}clearHandles(){this._watchUpdatingTracking.removeAll()}destroy(){this.clear(),u(this._recyclingInfoMap),u(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(a()),this._workPromise=null)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||o(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(this._clearCollections(),u(this._layerLayerViewInfoMap),u(this._recyclingInfoMap))}async whenLayerView(e){await this._reschedule();const r=this._layerLayerViewInfoMap.get(e)?.promise;if(!r){const r=this._recyclingInfoMap.get(e)?.promise;if(!r)throw new t("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return r}return r}isCreatingLayerViewsForLayer(e,r){this.commitProperty("updatingRemaining");const t=this._layerLayerViewInfoMap.get(e);if(!t?.done)return!0;const i=t.layerView;return!(!i||!r||i.parent===r)||!!(t.done&&i&&"layers"in e&&e.layers?.length)&&e.layers.some(e=>this.isCreatingLayerViewsForLayer(e,i))}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(w(this,e),w(this,r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_clearCollections(){for(const e of this._layersToLayerViews.values())w(this,e)?.removeAll()}_populateLayerViewsOwners(e,r,t){if(!e||!r)return void r?.removeAll();let i=0;for(const o of e){const e=this._layerLayerViewInfoMap.get(o);if(!e?.layerView)continue;const{layerView:s}=e;s.layer=o,s.parent=t,r.at(i)!==s&&r.splice(i,0,s),"layers"in o&&g(s)&&this._populateLayerViewsOwners(o.layers,s.layerViews,s),++i}i<r.length&&r.splice(i)}_createLayerView(e){e.load().catch(()=>{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new m(e,this.view,this.layerViewImporter);r.promise?.then(()=>this._refreshCollections(),r=>{r&&(n(r)||"cancelled:layerview-create"===r.name)||i.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this.destroyed||this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([p()],_.prototype,"_workPromise",void 0),e([p({readOnly:!0})],_.prototype,"_watchUpdatingTracking",void 0),e([p({readOnly:!0})],_.prototype,"_layersToLayerViews",void 0),e([p({constructOnly:!0})],_.prototype,"layerviewMapping",void 0),e([p({readOnly:!0})],_.prototype,"_rootCollectionNames",null),e([p({constructOnly:!0})],_.prototype,"layerViewFilter",void 0),e([p()],_.prototype,"layerViewImporter",void 0),e([p()],_.prototype,"supportsGround",void 0),e([p({readOnly:!0})],_.prototype,"updating",null),e([p({readOnly:!0})],_.prototype,"updatingRemaining",null),e([p({constructOnly:!0})],_.prototype,"view",void 0),_=e([d("esri.views.support.LayerViewManager")],_);const V=_;export{V as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{equals as t}from"../../core/arrayUtils.js";import{isMultiOriginJSONMixin as o}from"../../core/multiOriginJSONSupportUtils.js";import{project as n}from"../../geometry/projectionUtils.js";import r from"../../geometry/SpatialReference.js";import{fromValues as e,containsXY as i}from"../../geometry/support/aaBoundingRect.js";import s from"./AttributionItem.js";const c=100;class a{constructor(t,o,n){this.index=t,this.bbox=o,this.score=n}}function u(t){const o=t.contributors,n={maxZoom:0,attributions:[]};if(!o)return n;for(const r of o){if(!r.coverageAreas?.length||!r.attribution)continue;const t=n.attributions.length;n.attributions.push(r.attribution);for(const o of r.coverageAreas){const r=o.bbox,i=new a(t,e(r[1],r[0],r[3],r[2]),o.score??100);for(let t=o.zoomMin;t<=o.zoomMax;t++)n[t]??=[],n[t].push(i)}}return n.maxZoom=Math.max.apply(null,Object.keys(n).map(t=>+t).filter(t=>Number.isFinite(t))),n}function l(t,o,e,c){let a=o?.scaleToZoom(e)??0;if(a=Math.min(t.maxZoom??0,Math.round(a)),!c||null==a||a<=-1)return[];const u=t[a],{x:l,y:f}=n(c.center.clone().normalize(),r.WGS84),m=new Set;return u?.filter(t=>{const o=!m.has(t.index)&&i(t.bbox,l,f);return o&&m.add(t.index),o}).map(o=>new s(t.attributions[o.index],o.score))??[]}function f(t){return p(t,"user")?new s(t.copyright,c):null}function m(t){return p(t)?new s(t.copyright,c):null}function p(t,n){return null!=t&&"object"==typeof t&&"copyright"in t&&"string"==typeof t.copyright&&t.copyright.length>0&&(!n||o(t)&&"user"===t.originOf("copyright"))}function b(t){return null!=t&&"object"==typeof t&&"hasAttributionData"in t&&!0===t.hasAttributionData&&"attributionDataUrl"in t&&"fetchAttributionData"in t&&"function"==typeof t.fetchAttributionData}function h(t){return null!=t&&"object"==typeof t&&"portalItem"in t&&null!=t.portalItem&&"object"==typeof t.portalItem&&"accessInformation"in t.portalItem&&"string"==typeof t.portalItem.accessInformation&&t.portalItem.accessInformation.length>0}function g(t){return h(t)?new s(t.portalItem.accessInformation,c):null}function y(o,n){const r=new globalThis.Map;for(const t of n){const o=r.get(t.text);o?t.score>o.score&&r.set(t.text,t):r.set(t.text,t)}const e=Array.from(r.values()).sort((t,o)=>o.score-t.score);return o&&t(o,e,(t,o)=>t.text===o.text)?o:e}export{u as createAttributionIndex,y as deduplicateAttributionItems,g as getAttributionItemFromAccessInformation,m as getAttributionItemFromLayerCopyright,f as getAttributionItemFromUserCopyright,l as getAttributionItemsFromIndex,b as isDynamicAttributionLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createArea as e}from"../../core/quantity.js";import{geodesicAreas as r}from"../../geometry/geodesicUtils.js";import{
|
|
5
|
+
import{createArea as e}from"../../core/quantity.js";import{geodesicAreas as r}from"../../geometry/geodesicUtils.js";import{l as t,e as s}from"../../chunks/geodeticAreaOperator.js";import{isCurvedGeometry as o}from"../../geometry/support/curves/curveUtils.js";import{geodesicMeasure as a}from"./geodesicMeasurementUtils.js";const n=e=>({geodesicArea(r){const{spatialReference:t}=r,s=o(r);return a(t,s?m:u,s?m:r=>c(e,r),r)}});async function i(){const e=await import("../../geometry/geometryEngine.js");return await t(),n(e)}function u(t){return e(Math.abs(r([t],"square-meters")[0]),"square-meters")}function c(r,t){try{return e(Math.abs(r.geodesicArea(t,"square-meters")),"square-meters")}catch(s){return null}}function m(r){return e(s(r,{unit:"square-meters",curveType:"geodesic"}),"square-meters")}export{i as loadGeodesicAreaMeasurementUtils};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createLength as e}from"../../core/quantity.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{inverseGeodeticSolver as r,InverseGeodeticSolverResult as n,geodesicLengths as s}from"../../geometry/geodesicUtils.js";import
|
|
5
|
+
import{createLength as e}from"../../core/quantity.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{inverseGeodeticSolver as r,InverseGeodeticSolverResult as n,geodesicLengths as s}from"../../geometry/geodesicUtils.js";import o from"../../geometry/Polyline.js";import{l as i,e as c}from"../../chunks/geodeticLengthOperator.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{isCurvedGeometry as u}from"../../geometry/support/curves/curveUtils.js";import{geodesicMeasure as a}from"./geodesicMeasurementUtils.js";function f(e){const{spatialReference:t}=e,r=u(e);return a(t,r?R:h,R,e)}function p(e,t){if(!m(e.spatialReference,t.spatialReference))return null;const{spatialReference:r}=e;return U[0]=e.x,U[1]=e.y,U[2]=e.hasZ?e.z:0,v[0]=t.x,v[1]=t.y,v[2]=t.hasZ?t.z:0,l(U,v,r)}function l(e,t,r){return a(r,j,d,e,t,r)}const g={geodesicLength:f,geodesicDistanceBetweenPoints:p,geodesicDistance:l};async function y(){return await i(),g}function j(t,n,s){return e(r(x,t,n,s).distance,"meters")}function d(t,r,n){return e(c(w(t,r,n),{unit:"meters"}),"meters")}function h(t){return e(s([t],"meters")[0],"meters")}function R(t){return e(c(t,{unit:"meters"}),"meters")}function w(e,t,r){return new o({spatialReference:r,paths:[[[...e],[...t]]]})}const x=new n,U=t(),v=t();export{y as loadGeodesicLengthMeasurementUtils};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import{property as t,subclass as
|
|
5
|
+
import{__decorate as o}from"tslib";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"../DefaultUI.js";let e=class extends r{constructor(o){super(o),this.components=["zoom"]}};o([t()],e.prototype,"components",void 0),e=o([s("esri.views.ui.2d.DefaultUI2D")],e);const p=e;export{p 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";import
|
|
5
|
+
import{__decorate as o}from"tslib";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";import e from"../DefaultUI.js";let r=class extends e{constructor(o){super(o),this.components=["zoom","navigation-toggle","compass"]}};o([t()],r.prototype,"components",void 0),r=o([s("esri.views.ui.3d.DefaultUI3D")],r);const p=r;export{p 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import i from"../../core/Collection.js";import{watch as s,when as o,on as r}from"../../core/reactiveUtils.js";import{property as n,subclass as a}from"../../core/accessorSupport/decorators.js";import{getLyr3DWasm as l}from"../../views/3d/layers/Lyr3DWasm.js";function d(t,e){return t.length!==e.length||t.some((t,i)=>t.text!==e[i].text)}function h(t,e,i){if(!i||!e)return;t.find(t=>t.layerView===e&&t.text===i)||t.push({text:i,layerView:e})}const m=Symbol("attributions");let u=class extends e{constructor(t){super(t),this._clear=()=>{this.removeHandles(m)},this.items=new i,this.view=null,this._allLayerViewsChange=()=>{this.removeHandles(m);const t=this.view?.allLayerViews;let e=!1;if(t){for(const i of t)this.addHandles(s(()=>[i.attributionItems],()=>this._updateAttributionItems()),m),"type"in i&&"integrated-mesh-3dtiles"===i.type&&(e=!0,this.addHandles([s(()=>i.suspended,()=>this._updateAttributionItems()),i.on("visible-geometry-changed",()=>this._updateAttributionItems())],m));e&&this.addHandles(o(()=>!0===this.view?.stationary,()=>this._updateAttributionItems()),m)}this._updateAttributionItems()},this.addHandles([r(()=>this.view?.allLayerViews,"change",this._allLayerViewsChange,{onListenerAdd:this._allLayerViewsChange,onListenerRemove:this._clear})])}destroy(){this.view=null,this.items.removeAll()}get state(){return this.view?.ready?this.view.allLayerViews.some(t=>t.attributionUpdating)?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,e=t?.allLayerViews,i=[];let s=!1,o=null,r=null;if(t&&e){for(const t of e){if(t.suspended)continue;"type"in t&&"integrated-mesh-3dtiles"===t.type&&(r||=t,t.layer.hasGoogleUrl&&(s=!0,o=t));const e=t.attributionItems.slice().sort((t,e)=>e.score-t.score).map(t=>t.text).join(", ");h(i,t,e)}if(r){const e=l(t);if(e){const t=e.getAttributionText();for(let e=t.length-1;e>-1;--e)i.unshift({text:t[e],layerView:r})}}s&&o&&i.unshift({text:"Google Maps",layerView:o}),d(this.items,i)&&(this.items.removeAll(),this.items.addMany(i))}else this._clear()}};t([n({readOnly:!0,type:i})],u.prototype,"items",void 0),t([n({readOnly:!0})],u.prototype,"state",null),t([n()],u.prototype,"view",void 0),u=t([a("esri.widgets.Attribution.AttributionViewModel")],u);const c=u;export{c as default};
|