@arcgis/core 5.1.0-next.60 → 5.1.0-next.62
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{ab223c508f3dd562e7d3.js → 32e9e92bbbd000fbbaf7.js} +2 -2
- package/assets/esri/core/workers/chunks/{68475eba323b4aa892a3.js → 354351ab3fc79dedf9a8.js} +1 -1
- package/assets/esri/core/workers/chunks/45f1e682668cffc00b44.js +1 -0
- package/assets/esri/core/workers/chunks/4dbbf59c79d9e72f20ee.js +1 -0
- package/assets/esri/core/workers/chunks/{6172715b2b2853819d8a.js → 5eeb6d3a7b815d41621e.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f74147597805828cb38.js → 5ff41f43e57be0557541.js} +22 -29
- package/assets/esri/core/workers/chunks/{6355de3ee89916b74dae.js → 6b32b3f98872771ff81e.js} +1 -1
- package/assets/esri/core/workers/chunks/71326d16b5cc35c3ff7f.js +1 -0
- package/assets/esri/core/workers/chunks/{c69fefe9d51ac7c2b0a6.js → 75f7c1f600c4051bc905.js} +1 -1
- package/assets/esri/core/workers/chunks/{8083dface1ca2dbd12b2.js → 811b378fa5bf8a4d3d66.js} +1 -1
- package/assets/esri/core/workers/chunks/{8432ffc33843e898bab7.js → 8166ad6bbd7d7a8f91cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{58614f12796dbba013f4.js → 9d289cee96e7c7fe1029.js} +1 -1
- package/assets/esri/core/workers/chunks/{c4da2ca1dee0c44051d0.js → 9d7ffd83f69d6e639f09.js} +1 -1
- package/assets/esri/core/workers/chunks/{0622e238693c257abacb.js → 9eef3cd5f519c8ae88c0.js} +1 -1
- package/assets/esri/core/workers/chunks/{2541ac6e0ed1184edc9b.js → af3bd661b355eed3da21.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4144ccc85ad4c76a9b7.js → af40e2e6eaf3d2226812.js} +1 -1
- package/assets/esri/core/workers/chunks/{0fd191f9c10b3b7c83f4.js → c319c3b85cdec73a9f45.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e1ef2a55f8d123f31e2.js → cbb50415f7de8746ee1a.js} +1 -1
- package/assets/esri/core/workers/chunks/{48d289db3145ce6c02bb.js → d4368e281c12fa7c17c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{266933f1139ed0e8919f.js → e645f992ec6f935ee3a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf4bad2c9a541cd425f5.js → e9dd60d0220036545ebb.js} +1 -1
- package/assets/esri/core/workers/chunks/ed60b5eaa5765bfcb99c.js +1 -0
- package/assets/esri/core/workers/chunks/{a226ba96d9a3ecc14e3e.js → f550fc8c078ebd47d7a3.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
- package/chunks/GlowComposition.glsl.js +4 -5
- package/chunks/ShadowHighlight.glsl.js +5 -5
- package/config.js +1 -1
- package/geometry/libtess.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/circularArcUtils.js +1 -1
- package/geometry/support/curves/ellipticArc4Utils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/interfaces.d.ts +14 -0
- package/kernel.js +1 -1
- package/layers/CSVLayer.d.ts +38 -6
- package/layers/CatalogLayer.d.ts +39 -8
- package/layers/FeatureLayer.d.ts +25 -23
- package/layers/GeoJSONLayer.d.ts +36 -6
- package/layers/ParquetLayer.d.ts +58 -0
- package/layers/SubtypeGroupLayer.d.ts +27 -25
- package/layers/WFSLayer.d.ts +51 -8
- package/layers/catalog/CatalogFootprintLayer.d.ts +37 -7
- package/layers/graphics/sources/csv/csv.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +41 -17
- package/layers/mixins/ArcGISImageService.d.ts +58 -0
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/JpgPlus.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/support/csvUtils.js +1 -1
- package/package.json +3 -3
- package/popup/Feature.d.ts +33 -35
- package/popup/Feature.js +1 -1
- package/popup/Features.d.ts +663 -0
- package/popup/Features.js +2 -0
- package/popup/support/FeatureAbilities.d.ts +30 -0
- package/popup/support/FeatureAbilities.js +2 -0
- package/support/revision.js +1 -1
- package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/analysisViewModuleImportUtils.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -11
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/{ScreenSpaceShadowHighlight.glsl.js → ShadowHighlightBuffer.glsl.js} +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBufferTechnique.js +2 -0
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +11 -11
- package/views/3d/webgl-engine/shaders/ReceiveShadowsConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +2 -0
- package/views/3d/webgl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/plugins/TangentArcSegmentPlugin.js +1 -1
- package/views/support/AnalysisViewManager.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView3D.js +1 -1
- package/widgets/Feature/FeatureViewModel.d.ts +2 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureTable/ColumnVisibilityMenuVisibleElements.d.ts +27 -0
- package/widgets/FeatureTable/ColumnVisibilityMenuVisibleElements.js +2 -0
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +10 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/TableMenuVisibleElements.d.ts +0 -1
- package/widgets/FeatureTable/TableMenuVisibleElements.js +1 -1
- package/widgets/FeatureTable/VisibleElements.d.ts +23 -1
- package/widgets/FeatureTable/VisibleElements.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.d.ts +10 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Widget.js +1 -1
- package/assets/esri/core/workers/chunks/16806f5044a9da553b66.js +0 -1
- package/assets/esri/core/workers/chunks/5f3f50fec18d1642fdf9.js +0 -1
- package/assets/esri/core/workers/chunks/b42487c6a989e11a2559.js +0 -1
- package/assets/esri/core/workers/chunks/dba479176db0a23c8034.js +0 -1
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlightRenderNode.js +0 -2
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlightTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/Dithering.glsl.js +0 -4
- /package/assets/esri/core/workers/chunks/{ab223c508f3dd562e7d3.js.LICENSE.txt → 32e9e92bbbd000fbbaf7.js.LICENSE.txt} +0 -0
- /package/chunks/{ScreenSpaceShadowHighlight.glsl.js → ShadowHighlightBuffer.glsl.js} +0 -0
package/views/SceneView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
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{destroyHandle as o,makeHandle as l}from"../core/handleUtils.js";import has from"../core/has.js";import p from"../core/Logger.js";import{mapCollectionAsync as h}from"../core/mapCollectionUtils.js";import{destroyMaybe as d,maybeProperty as u}from"../core/maybe.js";import{ignoreAbortErrors as c,throwIfDestroyed as g,throwIfAborted as m,createAbortError as y}from"../core/promiseUtils.js";import f from"../core/ReactiveSet.js";import{on as w,watch as v,initial as _,sync as b,whenOnce as M,syncAndInitial as S}from"../core/reactiveUtils.js";import{setFrameDuration as V,cleanupScheduling as j}from"../core/scheduling.js";import{createScreenPoint as C,createScreenPointArray as T}from"../core/screenUtils.js";import{cleanupWhereClauseCache as R}from"../core/sql.js";import{getMetersPerUnitForSR as x}from"../core/units.js";import{property as A,cast as O,subclass as E}from"../core/accessorSupport/decorators.js";import{ensureType as L,ensureClass as H}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as I}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as F}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as P}from"../core/accessorSupport/trackingUtils.js";import{create as D}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as U}from"../core/libs/rbush/PooledRBush.js";import{initialize as G}from"../core/workers/workers.js";import z from"../geometry/Extent.js";import W from"../geometry/HeightModelInfo.js";import q from"../geometry/Point.js";import{project as k,canProjectWithoutEngine as B}from"../geometry/projectionUtils.js";import N from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Q}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Z}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as Y}from"../geometry/projection/projectPointToVector.js";import{toExtent as $,create as J}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as K}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as X}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as ee}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as te,isTiledLayer as ie,isVoxelLayer as re,isIntegratedMeshLayer as se,isGaussianSplatLayer as ne}from"../layers/support/layerUtils.js";import{TilemapCache as ae}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as oe}from"../portal/portalDefault.js";import{WebSceneTag as le}from"../support/tagSymbols.js";import{BreakpointsOwner as pe}from"./BreakpointsOwner.js";import{DOMContainer as he}from"./DOMContainer.js";import{PopupView as de}from"./PopupView.js";import ue from"./View.js";import ce from"./ViewAnimation.js";import{stringFromViewingMode as ge,viewingModeFromString as me}from"./ViewingMode.js";import{GroundView3D as ye}from"./3d/GroundView3D.js";import{layerView3DImporter as fe}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as we}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ve}from"./3d/camera/intersectionUtils.js";import _e from"./3d/constraints/Constraints.js";import be from"./3d/environment/Environment.js";import{EnvironmentManager as Me}from"./3d/environment/EnvironmentManager.js";import Se from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as Ve}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as je}from"./3d/layers/graphics/Labeler.js";import Ce from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Te}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as Re}from"./3d/state/ScreenSizePerspective.js";import xe from"./3d/state/ViewState.js";import{ViewStateManager as Ae,cleanupViewStateManager as Oe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ee}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Le}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as He}from"./3d/state/utils/navigationUtils.js";import Ie from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Fe}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Pe}from"./3d/support/debugFlags.js";import{getElevationAtPoint as De}from"./3d/support/ElevationProvider.js";import{toMap as Ue,hitTest as Ge}from"./3d/support/hitTest.js";import{popupHitTest as ze}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as We,getQualityProfileSettings as qe}from"./3d/support/QualityProfile.js";import ke from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Be}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ne}from"./3d/support/ResourceController.js";import Qe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Ze}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Ye}from"./3d/support/ViewSlice.js";import{PointsOfInterest as $e}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Je from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ke,getTiledLayerInfo as Xe,checkIfTileInfoSupportedForView as et}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as tt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as it}from"./3d/terrain/TileRenderer.js";import{Stage as rt}from"./3d/webgl-engine/Stage.js";import{olidEnabled as st}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as nt}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as at}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as ot}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as lt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as pt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import ht from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as dt}from"./support/drapedUtils.js";import{occludeesSupported as ut}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as ct,createScreenPointFromSupportedEvent as gt}from"./support/screenUtils.js";import{isSpatialReferenceSupported as mt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as yt,destroyTextureCompressionWorker as ft}from"./support/TextureCompressionHelper.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(pe(de(he(ue)))){static{Mt=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Ne(this),this.deconflictor=new Ve({view:this}),this.attribution3D=new Ie({view:this}),this.labeler=new je({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.basemapTerrain=null,this.elevationProvider=new Fe({view:this}),this._canvas=null,this.constraints=new _e,this._environment=new be,this.environmentManager=new Me,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ht({importAnalysisViewModule:e=>we(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new f,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new xe({view:this}),this.slice=new Ye,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,G();const t=()=>this._updatingChanged();this.addHandles(o(h(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([w(()=>this.map?.allLayers,"after-changes",t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),v(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Se({view:this}),this.stateManager=new Ae({view:this}),this.screenSizePerspective=new Re({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=yt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ye({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>V(e>0?1e3/Math.ceil(e):0),_),this.addHandles([v(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),b),v(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),b)])}destroy(){this.destroyed||(ft(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set("analysisViewManager",d(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=d(this.sharedSymbolResources),this._set("labeler",d(this.labeler)),this._set("deconflictor",d(this.deconflictor)),this._resourceController=d(this._resourceController),this._set("stateManager",d(this.stateManager)),this._set("inputManager",d(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",d(this.environmentManager)),this._set("environment",d(this.environment)),this.groundView=d(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.basemapTerrain?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=L(q,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||u(e,"clippingArea");return!this._userClippingArea&&!u(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof z?this.spatialReference&&(t=Ct(t,this.spatialReference),null==t)?(p.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):(p.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?p.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||N.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||N.WGS84;let t;const i=i=>{const r=Ct(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new z({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof be?e:e instanceof _t?this.environment?.cloneWithWebsceneEnvironment(e)??be.fromWebsceneEnvironment(e):L(be,e):new be}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=ue._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&&le 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=qe(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new ke(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||We()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){const{scale:e,spatialReference:t}=this;return t?F(()=>X(e,t)):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?W.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&p.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||Ke(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 ge(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?ge(this.defaultsFromMap.viewingMode):mt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?p.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Qe(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 p.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=ct(e)?gt(this,e):e;return Ue(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return p.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;let t=e;return null==e.z&&(t=At,t.x=e.x,t.y=e.y,t.z=De(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),Y(t,Tt,this.renderSpatialReference),this.state.camera.projectToScreen(Tt,Rt),C(Rt[0],Rt[1])}pixelSizeAt(e,t){if(!this.ready)return p.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;Y(e,Tt,i);const r=this.state.camera.computeScreenPixelSizeAt(Tt);return t&&i!==t?r*x(i)/x(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return p.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ct(e)?gt(this,e):e;return Ge(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return ze(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return c(this.goTo({zoomFactor:2}))}async zoomOut(){if(this.canZoomOut)return c(this.goTo({zoomFactor:.5}))}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(!st())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 fe.importLayerView(e)}hasLayerViewModule(e){return fe.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?me(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!!mt(e,i)&&(null==t||(!!te(t)||(!ie(t)||null!=Xe(t,e,i))&&(!re(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(te(t)&&(r||s)){return!s||2===i||null===et(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:N.WebMercator,viewingMode:i}]:[{spatialReference:r?N.WGS84:N.WebMercator,viewingMode:i}]}return ie(t)||re(t)||!r&&!s?ie(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:N.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?N.WGS84:N.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?p.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${ge(i)} viewing mode.`):e.isGeographic&&p.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 p.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(()=>{}),l(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return p.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&&ut(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),l(()=>{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 M(()=>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),l(()=>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&&(g(this),m(i.signal),await t(i.signal)),this.destroyed)throw y();return m(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 Je({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 $e({view:this})),this.addHandles([this.updatingHandles.add(()=>Pe.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Pe.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=d(this._featureTreeDebugger))},S),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?k($(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},S),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=d(this._featureTiles)},b)],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=d(this.featureTiles),this._set("pointsOfInterest",d(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=K(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Be.create(this.state.viewingMode,i)),t||this.addHandles(v(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!Z(e,this.groundView.spatialReference,xt,t)||(this.renderCoordsHelper.extent=xt)},b),Vt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(at/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(v(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),b),"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 Le(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new rt({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||"WebGL context lost")})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(at/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=d(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Ze({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=>M(()=>this.groundView?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=d(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===me(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(w(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(v(()=>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?I(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(lt);for(const t of this.allLayerViews)(se(t.layer)||ne(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(lt);for(const t of this.allLayerViews)se(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){bt(),P(),R(),pt(),Oe(),ve(),Te(),Q(),dt(),oe(),it(),ot(),Ee(),He(),U(),j(),nt(),tt(),Ce.cleanupI3SLodHandling(),ae.cleanupTilemapCache(),xe.cleanupViewstate(),Je.cleanupTerrainSurface()}};function Ct(e,t){return null!=e&&B(e.spatialReference,t)?k(e,t):null}e([A()],jt.prototype,"_userClippingArea",void 0),e([A()],jt.prototype,"_resourceController",void 0),e([A()],jt.prototype,"stage",null),e([A({readOnly:!0})],jt.prototype,"deconflictor",void 0),e([A({readOnly:!0})],jt.prototype,"labeler",void 0),e([A({type:ce,readOnly:!0})],jt.prototype,"animation",null),e([A({readOnly:!0})],jt.prototype,"basemapTerrain",void 0),e([A({readOnly:!0})],jt.prototype,"overlayManager",null),e([A({readOnly:!0})],jt.prototype,"elevationProvider",void 0),e([A()],jt.prototype,"camera",null),e([A({type:t})],jt.prototype,"contentCamera",null),e([A({readOnly:!0})],jt.prototype,"canvas",null),e([A({type:q,useTypeForAutocast:!1})],jt.prototype,"center",null),e([A({type:z})],jt.prototype,"clippingArea",null),e([A({type:_e,nonNullable:!0})],jt.prototype,"constraints",void 0),e([A({type:z,readOnly:!0})],jt.prototype,"renderDataExtent",null),e([A({readOnly:!0})],jt.prototype,"tileInfo",null),e([A({type:z,readOnly:!0})],jt.prototype,"dataExtent",null),e([A({type:z,readOnly:!0})],jt.prototype,"_groundAndLayersExtent",null),e([A({type:be})],jt.prototype,"environment",null),e([O("environment")],jt.prototype,"castEnvironment",null),e([A({readOnly:!0})],jt.prototype,"environmentManager",void 0),e([A({type:z})],jt.prototype,"extent",null),e([A({type:r})],jt.prototype,"floors",void 0),e([A()],jt.prototype,"screenCenter",null),e([A()],jt.prototype,"frustum",null),e([A({type:Number,readOnly:!0})],jt.prototype,"fullOpacity",void 0),e([A({readOnly:!0})],jt.prototype,"graphicsView",void 0),e([A()],jt.prototype,"analysisViewManager",void 0),e([A()],jt.prototype,"groundView",void 0),e([A({readOnly:!0})],jt.prototype,"layerviewCollections",null),e([A({type:Boolean})],jt.prototype,"initialExtentRequired",null),e([A()],jt.prototype,"defaultsFromMapSettings",null),e([A()],jt.prototype,"interacting",null),e([A()],jt.prototype,"stationary",null),e([A()],jt.prototype,"navigating",null),e([A()],jt.prototype,"map",void 0),e([A()],jt.prototype,"padding",null),e([A({type:$e,readOnly:!0})],jt.prototype,"pointsOfInterest",void 0),e([A()],jt.prototype,"_featureTiles",void 0),e([A()],jt.prototype,"featureTiles",null),e([A()],jt.prototype,"_featureTreeDebugger",void 0),e([A({constructOnly:!0})],jt.prototype,"deactivatedWebGLExtensions",void 0),e([A({constructOnly:!0})],jt.prototype,"debugWebGLExtensions",void 0),e([A({constructOnly:!0})],jt.prototype,"renderCanvas",void 0),e([A({constructOnly:!0})],jt.prototype,"state",void 0),e([A()],jt.prototype,"screenSizePerspective",void 0),e([A({readOnly:!0})],jt.prototype,"inputManager",void 0),e([A({readOnly:!0})],jt.prototype,"stateManager",void 0),e([A({type:["low","medium","high"]})],jt.prototype,"qualityProfile",null),e([A({type:ke,get(){let e=this._get("qualitySettings");if(!e){const t=qe(this.qualityProfile);e=new ke(t)}return e}})],jt.prototype,"qualitySettings",void 0),e([A()],jt.prototype,"slice",void 0),e([A({readOnly:!0})],jt.prototype,"typeSpecificPreconditionsReady",null),e([A({readOnly:!0})],jt.prototype,"renderCoordsHelper",void 0),e([A({readOnly:!0})],jt.prototype,"sceneIntersectionHelper",void 0),e([A({type:Number,readOnly:!0})],jt.prototype,"resolution",null),e([A({type:Number})],jt.prototype,"scale",null),e([A({readOnly:!0,type:Number})],jt.prototype,"terrainLevel",null),e([A()],jt.prototype,"heightModelInfo",null),e([A({type:N})],jt.prototype,"spatialReference",void 0),e([A({type:Boolean,value:!1})],jt.prototype,"alphaCompositingEnabled",null),e([A({constructOnly:!0})],jt.prototype,"preserveDrawingBufferEnabled",void 0),e([A({type:Boolean})],jt.prototype,"supersampleScreenshotsEnabled",void 0),e([A({readOnly:!0})],jt.prototype,"type",void 0),e([A(),O(e=>e instanceof wt?e:H(vt,e))],jt.prototype,"ui",void 0),e([A({type:Boolean,readOnly:!0})],jt.prototype,"updating",null),e([A()],jt.prototype,"_updatingObjects",null),e([A()],jt.prototype,"_updatingObjectsWithProgress",null),e([A({type:Number,readOnly:!0})],jt.prototype,"updatingProgress",void 0),e([A({type:["global","local"]})],jt.prototype,"viewingMode",null),e([A({type:i})],jt.prototype,"viewpoint",null),e([A({readOnly:!0})],jt.prototype,"visibleArea",null),e([A({type:Number})],jt.prototype,"zoom",null),e([A({readOnly:!0})],jt.prototype,"quality",null),e([A({readOnly:!0})],jt.prototype,"resolutionScale",null),e([A()],jt.prototype,"focusAreasView",void 0),e([A()],jt.prototype,"_defaultToMapOptions",null),e([A()],jt.prototype,"_defaultHitTestOptions",null),jt=Mt=e([E("esri.views.SceneView")],jt);const Tt=D(),Rt=T(),xt=J(),At=ee(0,0,0,N.WebMercator),Ot={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Et=jt;export{Et as default};
|
|
2
|
+
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{destroyHandle as o,makeHandle as l}from"../core/handleUtils.js";import has from"../core/has.js";import p from"../core/Logger.js";import{mapCollectionAsync as h}from"../core/mapCollectionUtils.js";import{destroyMaybe as d,maybeProperty as u}from"../core/maybe.js";import{ignoreAbortErrors as c,throwIfDestroyed as g,throwIfAborted as m,createAbortError as y}from"../core/promiseUtils.js";import f from"../core/ReactiveSet.js";import{on as w,watch as v,initial as _,sync as b,whenOnce as M,syncAndInitial as S}from"../core/reactiveUtils.js";import{setFrameDuration as V,cleanupScheduling as j}from"../core/scheduling.js";import{createScreenPoint as C,createScreenPointArray as T}from"../core/screenUtils.js";import{cleanupWhereClauseCache as R}from"../core/sql.js";import{getMetersPerUnitForSR as x}from"../core/units.js";import{property as A,cast as O,subclass as E}from"../core/accessorSupport/decorators.js";import{ensureType as L,ensureClass as H}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as I}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as F}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as P}from"../core/accessorSupport/trackingUtils.js";import{create as D}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as U}from"../core/libs/rbush/PooledRBush.js";import{initialize as G}from"../core/workers/workers.js";import z from"../geometry/Extent.js";import W from"../geometry/HeightModelInfo.js";import q from"../geometry/Point.js";import{project as k,canProjectWithoutEngine as B}from"../geometry/projectionUtils.js";import N from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Q}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Z}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as Y}from"../geometry/projection/projectPointToVector.js";import{toExtent as $,create as J}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as K}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as X}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as ee}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as te,isTiledLayer as ie,isVoxelLayer as re,isIntegratedMeshLayer as se,isGaussianSplatLayer as ne}from"../layers/support/layerUtils.js";import{TilemapCache as ae}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as oe}from"../portal/portalDefault.js";import{WebSceneTag as le}from"../support/tagSymbols.js";import{BreakpointsOwner as pe}from"./BreakpointsOwner.js";import{DOMContainer as he}from"./DOMContainer.js";import{PopupView as de}from"./PopupView.js";import ue from"./View.js";import ce from"./ViewAnimation.js";import{stringFromViewingMode as ge,viewingModeFromString as me}from"./ViewingMode.js";import{GroundView3D as ye}from"./3d/GroundView3D.js";import{layerView3DImporter as fe}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as we}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ve}from"./3d/camera/intersectionUtils.js";import _e from"./3d/constraints/Constraints.js";import be from"./3d/environment/Environment.js";import{EnvironmentManager as Me}from"./3d/environment/EnvironmentManager.js";import Se from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as Ve}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as je}from"./3d/layers/graphics/Labeler.js";import Ce from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Te}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as Re}from"./3d/state/ScreenSizePerspective.js";import xe from"./3d/state/ViewState.js";import{ViewStateManager as Ae,cleanupViewStateManager as Oe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ee}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Le}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as He}from"./3d/state/utils/navigationUtils.js";import Ie from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Fe}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Pe}from"./3d/support/debugFlags.js";import{getElevationAtPoint as De}from"./3d/support/ElevationProvider.js";import{toMap as Ue,hitTest as Ge}from"./3d/support/hitTest.js";import{popupHitTest as ze}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as We,getQualityProfileSettings as qe}from"./3d/support/QualityProfile.js";import ke from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Be}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ne}from"./3d/support/ResourceController.js";import Qe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Ze}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Ye}from"./3d/support/ViewSlice.js";import{PointsOfInterest as $e}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Je from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ke,getTiledLayerInfo as Xe,checkIfTileInfoSupportedForView as et}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as tt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as it}from"./3d/terrain/TileRenderer.js";import{Stage as rt}from"./3d/webgl-engine/Stage.js";import{olidEnabled as st}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as nt}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as at}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as ot}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as lt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as pt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import ht from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as dt}from"./support/drapedUtils.js";import{occludeesSupported as ut}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as ct,createScreenPointFromSupportedEvent as gt}from"./support/screenUtils.js";import{isSpatialReferenceSupported as mt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as yt,destroyTextureCompressionWorker as ft}from"./support/TextureCompressionHelper.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(pe(de(he(ue)))){static{Mt=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Ne(this),this.deconflictor=new Ve({view:this}),this.attribution3D=new Ie({view:this}),this.labeler=new je({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.basemapTerrain=null,this.elevationProvider=new Fe({view:this}),this._canvas=null,this.constraints=new _e,this._environment=new be,this.environmentManager=new Me,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ht({importAnalysisViewModule:e=>we(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new f,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new xe({view:this}),this.slice=new Ye,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,G();const t=()=>this._updatingChanged();this.addHandles(o(h(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([w(()=>this.map?.allLayers,"after-changes",t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),v(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Se({view:this}),this.stateManager=new Ae({view:this}),this.screenSizePerspective=new Re({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=yt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ye({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>V(e>0?1e3/Math.ceil(e):0),_),this.addHandles([v(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),b),v(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),b)])}destroy(){this.destroyed||(ft(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set("analysisViewManager",d(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=d(this.sharedSymbolResources),this._set("labeler",d(this.labeler)),this._set("deconflictor",d(this.deconflictor)),this._resourceController=d(this._resourceController),this._set("stateManager",d(this.stateManager)),this._set("inputManager",d(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",d(this.environmentManager)),this._set("environment",d(this.environment)),this.groundView=d(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.basemapTerrain?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=L(q,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||u(e,"clippingArea");return!this._userClippingArea&&!u(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof z?this.spatialReference&&(t=Ct(t,this.spatialReference),null==t)?(p.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):(p.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?p.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||N.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||N.WGS84;let t;const i=i=>{const r=Ct(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new z({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof be?e:e instanceof _t?this.environment?.cloneWithWebsceneEnvironment(e)??be.fromWebsceneEnvironment(e):L(be,e):new be}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=ue._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&&le 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=qe(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new ke(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||We()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){const{scale:e,spatialReference:t}=this;return t?F(()=>X(e,t)):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?W.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&p.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||Ke(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,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return ge(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?ge(this.defaultsFromMap.viewingMode):mt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?p.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Qe(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 p.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=ct(e)?gt(this,e):e;return Ue(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return p.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;let t=e;return null==e.z&&(t=At,t.x=e.x,t.y=e.y,t.z=De(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),Y(t,Tt,this.renderSpatialReference),this.state.camera.projectToScreen(Tt,Rt),C(Rt[0],Rt[1])}pixelSizeAt(e,t){if(!this.ready)return p.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;Y(e,Tt,i);const r=this.state.camera.computeScreenPixelSizeAt(Tt);return t&&i!==t?r*x(i)/x(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return p.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ct(e)?gt(this,e):e;return Ge(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return ze(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return c(this.goTo({zoomFactor:2}))}async zoomOut(){if(this.canZoomOut)return c(this.goTo({zoomFactor:.5}))}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(!st())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 fe.importLayerView(e)}hasLayerViewModule(e){return fe.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?me(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!!mt(e,i)&&(null==t||(!!te(t)||(!ie(t)||null!=Xe(t,e,i))&&(!re(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(te(t)&&(r||s)){return!s||2===i||null===et(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:N.WebMercator,viewingMode:i}]:[{spatialReference:r?N.WGS84:N.WebMercator,viewingMode:i}]}return ie(t)||re(t)||!r&&!s?ie(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:N.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?N.WGS84:N.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?p.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${ge(i)} viewing mode.`):e.isGeographic&&p.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 p.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(()=>{}),l(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return p.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&&ut(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),l(()=>{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 M(()=>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),l(()=>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&&(g(this),m(i.signal),await t(i.signal)),this.destroyed)throw y();return m(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 Je({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 $e({view:this})),this.addHandles([this.updatingHandles.add(()=>Pe.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Pe.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=d(this._featureTreeDebugger))},S),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?k($(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},S),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=d(this._featureTiles)},b)],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=d(this.featureTiles),this._set("pointsOfInterest",d(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=K(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Be.create(this.state.viewingMode,i)),t||this.addHandles(v(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!Z(e,this.groundView.spatialReference,xt,t)||(this.renderCoordsHelper.extent=xt)},b),Vt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(at/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(v(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),b),"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 Le(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new rt({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||"WebGL context lost")})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(at/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=d(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Ze({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=>M(()=>this.groundView?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=d(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===me(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(w(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?I(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(lt);for(const t of this.allLayerViews)(se(t.layer)||ne(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(lt);for(const t of this.allLayerViews)se(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){bt(),P(),R(),pt(),Oe(),ve(),Te(),Q(),dt(),oe(),it(),ot(),Ee(),He(),U(),j(),nt(),tt(),Ce.cleanupI3SLodHandling(),ae.cleanupTilemapCache(),xe.cleanupViewstate(),Je.cleanupTerrainSurface()}};function Ct(e,t){return null!=e&&B(e.spatialReference,t)?k(e,t):null}e([A()],jt.prototype,"_userClippingArea",void 0),e([A()],jt.prototype,"_resourceController",void 0),e([A()],jt.prototype,"stage",null),e([A({readOnly:!0})],jt.prototype,"deconflictor",void 0),e([A({readOnly:!0})],jt.prototype,"labeler",void 0),e([A({type:ce,readOnly:!0})],jt.prototype,"animation",null),e([A({readOnly:!0})],jt.prototype,"basemapTerrain",void 0),e([A({readOnly:!0})],jt.prototype,"overlayManager",null),e([A({readOnly:!0})],jt.prototype,"elevationProvider",void 0),e([A()],jt.prototype,"camera",null),e([A({type:t})],jt.prototype,"contentCamera",null),e([A({readOnly:!0})],jt.prototype,"canvas",null),e([A({type:q,useTypeForAutocast:!1})],jt.prototype,"center",null),e([A({type:z})],jt.prototype,"clippingArea",null),e([A({type:_e,nonNullable:!0})],jt.prototype,"constraints",void 0),e([A({type:z,readOnly:!0})],jt.prototype,"renderDataExtent",null),e([A({readOnly:!0})],jt.prototype,"tileInfo",null),e([A({type:z,readOnly:!0})],jt.prototype,"dataExtent",null),e([A({type:z,readOnly:!0})],jt.prototype,"_groundAndLayersExtent",null),e([A({type:be})],jt.prototype,"environment",null),e([O("environment")],jt.prototype,"castEnvironment",null),e([A({readOnly:!0})],jt.prototype,"environmentManager",void 0),e([A({type:z})],jt.prototype,"extent",null),e([A({type:r})],jt.prototype,"floors",void 0),e([A()],jt.prototype,"screenCenter",null),e([A()],jt.prototype,"frustum",null),e([A({type:Number,readOnly:!0})],jt.prototype,"fullOpacity",void 0),e([A({readOnly:!0})],jt.prototype,"graphicsView",void 0),e([A()],jt.prototype,"analysisViewManager",void 0),e([A()],jt.prototype,"groundView",void 0),e([A({readOnly:!0})],jt.prototype,"layerviewCollections",null),e([A({type:Boolean})],jt.prototype,"initialExtentRequired",null),e([A()],jt.prototype,"defaultsFromMapSettings",null),e([A()],jt.prototype,"interacting",null),e([A()],jt.prototype,"stationary",null),e([A()],jt.prototype,"navigating",null),e([A()],jt.prototype,"map",void 0),e([A()],jt.prototype,"padding",null),e([A({type:$e,readOnly:!0})],jt.prototype,"pointsOfInterest",void 0),e([A()],jt.prototype,"_featureTiles",void 0),e([A()],jt.prototype,"featureTiles",null),e([A()],jt.prototype,"_featureTreeDebugger",void 0),e([A({constructOnly:!0})],jt.prototype,"deactivatedWebGLExtensions",void 0),e([A({constructOnly:!0})],jt.prototype,"debugWebGLExtensions",void 0),e([A({constructOnly:!0})],jt.prototype,"renderCanvas",void 0),e([A({constructOnly:!0})],jt.prototype,"state",void 0),e([A()],jt.prototype,"screenSizePerspective",void 0),e([A({readOnly:!0})],jt.prototype,"inputManager",void 0),e([A({readOnly:!0})],jt.prototype,"stateManager",void 0),e([A({type:["low","medium","high"]})],jt.prototype,"qualityProfile",null),e([A({type:ke,get(){let e=this._get("qualitySettings");if(!e){const t=qe(this.qualityProfile);e=new ke(t)}return e}})],jt.prototype,"qualitySettings",void 0),e([A()],jt.prototype,"slice",void 0),e([A({readOnly:!0})],jt.prototype,"typeSpecificPreconditionsReady",null),e([A({readOnly:!0})],jt.prototype,"renderCoordsHelper",void 0),e([A({readOnly:!0})],jt.prototype,"sceneIntersectionHelper",void 0),e([A({type:Number,readOnly:!0})],jt.prototype,"resolution",null),e([A({type:Number})],jt.prototype,"scale",null),e([A({readOnly:!0,type:Number})],jt.prototype,"terrainLevel",null),e([A()],jt.prototype,"heightModelInfo",null),e([A({type:N})],jt.prototype,"spatialReference",void 0),e([A({type:Boolean,value:!1})],jt.prototype,"alphaCompositingEnabled",null),e([A({constructOnly:!0})],jt.prototype,"preserveDrawingBufferEnabled",void 0),e([A({type:Boolean})],jt.prototype,"supersampleScreenshotsEnabled",void 0),e([A({readOnly:!0})],jt.prototype,"type",void 0),e([A(),O(e=>e instanceof wt?e:H(vt,e))],jt.prototype,"ui",void 0),e([A({type:Boolean,readOnly:!0})],jt.prototype,"updating",null),e([A()],jt.prototype,"_updatingObjects",null),e([A()],jt.prototype,"_updatingObjectsWithProgress",null),e([A({type:Number,readOnly:!0})],jt.prototype,"updatingProgress",void 0),e([A({type:["global","local"]})],jt.prototype,"viewingMode",null),e([A({type:i})],jt.prototype,"viewpoint",null),e([A({readOnly:!0})],jt.prototype,"visibleArea",null),e([A({type:Number})],jt.prototype,"zoom",null),e([A({readOnly:!0})],jt.prototype,"quality",null),e([A({readOnly:!0})],jt.prototype,"resolutionScale",null),e([A()],jt.prototype,"focusAreasView",void 0),e([A()],jt.prototype,"_defaultToMapOptions",null),e([A()],jt.prototype,"_defaultHitTestOptions",null),jt=Mt=e([E("esri.views.SceneView")],jt);const Tt=D(),Rt=T(),xt=J(),At=ee(0,0,0,N.WebMercator),Ot={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Et=jt;export{Et as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{watch as e,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as i,subclass as r}from"../../../core/accessorSupport/decorators.js";import{dot as o,cross as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{calculateBezierCurveTangent as a}from"../../../geometry/support/curves/bezierCurveUtils.js";import{interpolateCircle as p}from"../../../geometry/support/curves/circleUtils.js";import{calculateCircularArcTangent as l}from"../../../geometry/support/curves/circularArcUtils.js";import{isCoordinate as u,isCircularArc as f,isEllipticArc4 as h,isEllipticArc7 as d,isBezierCurve as m}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as v,calculateEllipticArc4Tangent as _}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{calculateEllipticArc7Tangent as L}from"../../../geometry/support/curves/ellipticArc7Utils.js";import{pointNear as g}from"../../../layers/graphics/dehydratedFeatureComparison.js";import{PluginBase as
|
|
2
|
+
import{__decorate as t}from"tslib";import{watch as e,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as i,subclass as r}from"../../../core/accessorSupport/decorators.js";import{dot as o,cross as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{calculateBezierCurveTangent as a}from"../../../geometry/support/curves/bezierCurveUtils.js";import{interpolateCircle as p}from"../../../geometry/support/curves/circleUtils.js";import{calculateCircularArcTangent as l}from"../../../geometry/support/curves/circularArcUtils.js";import{isCoordinate as u,isCircularArc as f,isEllipticArc4 as h,isEllipticArc7 as d,isBezierCurve as m}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as v,calculateEllipticArc4Tangent as _}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{calculateEllipticArc7Tangent as L}from"../../../geometry/support/curves/ellipticArc7Utils.js";import{pointNear as g}from"../../../layers/graphics/dehydratedFeatureComparison.js";import{PluginBase as A}from"./PluginBase.js";const y=Symbol("left-vertex"),P=Symbol("left-left-vertex"),S=Symbol("right-vertex"),x=c();let w=class extends A{constructor(){super(...arguments),this.placementState="placing-end"}get _availableAnchorCount(){return this._curveLeftVertex&&this._curveLeftLeftVertex?2:this._curveLeftVertex||this._curveLeftLeftVertex?1:0}get _automaticRestart(){return!this.ownPlacedLeftAnchor&&!this.ownPlacedLeftLeftAnchor}start(t,i){super.start(t,i);this._session.preserveSharedRedoAfterOperation=!0,this.ownPlacedLeftAnchor=i?.ownPlacedLeftAnchor,this.ownPlacedLeftLeftAnchor=i?.ownPlacedLeftLeftAnchor,this._refreshAnchorInfo(),this._restoreOwnPlacedAnchorsIfNeeded(),this.placementState=this._resolveState(i?.placementState),this.curveEndpoint="placing-end"===this.placementState?i?.curveEndpoint:null,this._primaryInteractiveHandle||(this._primaryInteractiveHandle=t.createInteractiveHandle({defaultCaptureMode:"capture-always",role:"primary",snappingEnabled:!0}),this.addHandles([e(()=>this._primaryInteractiveHandle?.outputMapPosition??t.positionOfLastUserInput,t=>{t&&!this._isComplete&&this.updateGeometry(t)},n)],this._ownHandlesKey)),this._session.automaticRestart=this._automaticRestart;const r=this._primaryInteractiveHandle?.outputMapPosition??t.positionOfLastUserInput;r&&this.updateGeometry(r)}updateGeometry(t){if(!this._isComplete)switch(this.placementState){case"placing-left-left":return void this._session?.appendOrReplacePoint(P,t);case"placing-left":return void this._session?.appendOrReplacePoint(y,t);case"placing-end":return this.curveEndpoint=t,void this._updateStagedGeometry()}}async completeStep(){if(!this._primaryInteractiveHandle?.outputMapPosition||this._isComplete||!this._session||!this._isCurrentStepValid())return;const t=this._session.peekUndoStep(),e=this.suspend();if(e){t?t.placementState===e.placementState&&(t.curveEndpoint=e.curveEndpoint,t.ownPlacedLeftAnchor=e.ownPlacedLeftAnchor,t.ownPlacedLeftLeftAnchor=e.ownPlacedLeftLeftAnchor):this._session.pushUndoStep(e);try{switch(this._session.preserveSharedRedoAfterOperation=!1,this.placementState){case"placing-left-left":this._curveLeftLeftVertex=this._session.getInformationAboutPoint(-1,-1),this.ownPlacedLeftLeftAnchor=this._curveLeftLeftVertex,this._session.groupGeometryChanges(),this._applyState("placing-left");break;case"placing-left":this._curveLeftVertex=this._session.getInformationAboutPoint(-1,-1),this.ownPlacedLeftAnchor=this._curveLeftVertex,this._session.groupGeometryChanges(),this._applyState("placing-end");break;case"placing-end":this._updateStagedGeometry(),this._commitArcSegment()}}finally{this._session.preserveSharedRedoAfterOperation=!0}this._session.pushUndoStep(this.suspend())}}suspend(){const{curveEndpoint:t,ownPlacedLeftAnchor:e,ownPlacedLeftLeftAnchor:n,placementState:i}=this;return{curveEndpoint:t,ownPlacedLeftAnchor:e,ownPlacedLeftLeftAnchor:n,placementState:i}}_applyState(t){this.placementState=t,this._session.automaticRestart=this._automaticRestart}_resolveState(t){const e=this._availableAnchorCount;switch(t){case"placing-left-left":case"placing-end":default:return e>=2?"placing-end":1===e?"placing-left":"placing-left-left";case"placing-left":return e>=2?"placing-end":0===e?"placing-left-left":"placing-left"}}_restoreOwnPlacedAnchorsIfNeeded(){const t=this._session;if(!t)return;const e=this.ownPlacedLeftLeftAnchor?.point;e&&!this._hasAnchorPoint(e)&&(t.appendOrReplacePoint(P,e),t.groupGeometryChanges(),this._refreshAnchorInfo());const n=this.ownPlacedLeftAnchor?.point;n&&!this._hasAnchorPoint(n)&&(t.appendOrReplacePoint(y,n),t.groupGeometryChanges(),this._refreshAnchorInfo())}_hasAnchorPoint(t){const e=this._curveLeftVertex?.point,n=this._curveLeftLeftVertex?.point;return!!(e&&g(e,t)||n&&g(n,t))}_refreshAnchorInfo(){const t=this._session;if(!t)return this._curveLeftVertex=null,void(this._curveLeftLeftVertex=null);const e=t.lastPointAddedBySession?.pointIndex,n=null!=e&&e>=2?t.getInformationAboutPoint(e-1,-1):null,i=null!=e&&e>=2?t.getInformationAboutPoint(e-2,-1):null;if(n?.point&&i?.point)return this._curveLeftVertex=n,void(this._curveLeftLeftVertex=i);this._curveLeftVertex=t.getInformationAboutPoint(-1,-1),this._curveLeftLeftVertex=t.getInformationAboutPoint(-2,-1)}_isCurrentStepValid(){const t=this._session;if(!t)return!1;if("placing-left-left"===this.placementState){const e=t.getInformationAboutPoint(-1,-1)?.point;if(!e)return!1;const n=t.getInformationAboutPoint(-2,-1)?.point;return!(n&&g(e,n))}if("placing-left"===this.placementState){const e=t.getInformationAboutPoint(-1,-1)?.point,n=t.getInformationAboutPoint(-2,-1)?.point;return!(!e||!n)&&!g(e,n)}if("placing-end"===this.placementState){if(!this.curveEndpoint||!this.curveDefinition)return!1;this._refreshAnchorInfo();const t=this._curveLeftVertex?.point;return!!t&&!g(this.curveEndpoint,t)}return!0}_updateStagedGeometry(){const{_session:t,_isComplete:e,curveEndpoint:n}=this;if(e||!t||!n)return;if(this._refreshAnchorInfo(),!this._curveLeftVertex||!this._curveLeftLeftVertex)return void(this.curveDefinition=null);const i=this._curveLeftVertex.point,r=b(this._curveLeftVertex,this._curveLeftLeftVertex);if(!r||!i)return void(this.curveDefinition=null);const c=[n.x,n.y],a=[c[0]-i.x,c[1]-i.y],l=I([i.x,i.y],c,r);if(!l)return void(this.curveDefinition=null);const u={a:[c,l,o(r,a)<0?0:1,s(x,r,a)[2]>0?0:1]},f=v([i.x,i.y],u),h=p(f,.5);this.curveDefinition={c:[c,h]},this._session?.appendOrReplaceCurve(S,this.curveDefinition)}_commitArcSegment(){this.curveEndpoint&&this.curveDefinition&&(this._isComplete=!0,this._context?.requestComplete())}};function I([t,e],[n,i],[r,o]){const s=n-t,c=i-e,a=s*s+c*c,p=-o,l=r,u=p*s+l*c;if(V(u*u,a))return null;const f=a/(2*u);return[t+f*p,e+f*l]}function V(t,e){return t<1e-8*e}function b(t,e){if(!t.point||!e.point)return null;const n=t.curveInfo,i=[e.point.x,e.point.y];if(!n||u(n)){return C([t.point.x,t.point.y],i)}return f(n)?l(i,n):h(n)?_(i,n):d(n)?L(i,n):m(n)?a(i,n):null}function C(t,e){return[t[0]-e[0],t[1]-e[1]]}t([i()],w.prototype,"_primaryInteractiveHandle",void 0),t([i()],w.prototype,"_curveLeftVertex",void 0),t([i()],w.prototype,"_curveLeftLeftVertex",void 0),t([i()],w.prototype,"_availableAnchorCount",null),t([i()],w.prototype,"_automaticRestart",null),t([i()],w.prototype,"curveDefinition",void 0),t([i()],w.prototype,"curveEndpoint",void 0),t([i()],w.prototype,"ownPlacedLeftLeftAnchor",void 0),t([i()],w.prototype,"ownPlacedLeftAnchor",void 0),t([i()],w.prototype,"placementState",void 0),w=t([r("esri.views.draw.plugins.TangentArcSegmentPlugin")],w);export{w as TangentArcSegmentPlugin,I as centerFromTwoPointsAndTangent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import s from"../../core/Accessor.js";import{createTask as t}from"../../core/asyncUtils.js";import i from"../../core/Collection.js";import a from"../../core/Error.js";import{makeHandle as o}from"../../core/handleUtils.js";import"../../core/has.js";import n from"../../core/Logger.js";import{removeMaybe as r,destroyMaybe as l,abortMaybe as c}from"../../core/maybe.js";import{createAbortError as h,isAborted as w,onAbort as d}from"../../core/promiseUtils.js";import{schedule as y}from"../../core/scheduling.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";const _=Symbol("analyses-owner-handles");let u=class extends s{constructor(e){super(e),this._allAnalysisViews=new i,this._creatingViewCount=0,this._attachedToViewResolver=v(),this._items=new Map,this._moduleMap=new Map,this._scheduledUpdateHandle=null,this._emitOnView=(e,s)=>this.view.emit(e,s)}destroy(){this._disconnectOwners(),this._attachedToViewResolver.reject(h("AnalysisViewManager was destroyed")),this._set("view",null)}attach(){this._connectOwners(),this._attachedToViewResolver.resolve()}detach(){this._disconnectOwners(),this._attachedToViewResolver.reject(h()),this._attachedToViewResolver=v()}get updating(){return!this.view.ready||0!==this._creatingViewCount||this._allAnalysisViews.some(e=>e.updating)}get testInfo(){}async whenAnalysisView(e){await this._attachedToViewResolver.promise;const s=this._items.get(e);if(null==s||1===s.state.list){throw new a("AnalysisViewManager:no-analysis-view-for-analysis","The analysis does not exist in view.analyses",{analysis:e})}return s.createAnalysisViewTask.promise}_connectOwners(){this.addHandles(this._connectAnalysesCollection(this.view.analyses),_)}_disconnectOwners(){this.removeHandles(_),this._update(),this._creatingViewCount=0}_connectAnalysesCollection(e){for(const i of e)this._addAnalysis(i);const s=e.on("after-add",e=>this._addAnalysis(e.item)),t=e.on("after-remove",e=>this._removeAnalysis(e.item));return o(()=>{s.remove(),t.remove();for(const s of e)this._removeAnalysis(s)})}_addAnalysis(e){const s=this._items.get(e);if(null==s){const s={state:{view:0,list:0},analysis:e,view:null,createAnalysisViewTask:null};this._items.set(e,s),s.createAnalysisViewTask=t(t=>this._createAnalysisViewPromise(s,t).then(s=>(this._emitOnView("analysis-view-create",{analysis:e,analysisView:s}),s),s=>{throw this._emitOnView("analysis-view-create-error",{analysis:e,error:s}),s}))}else s.state.list=0}_removeAnalysis(e){const s=this._items.get(e);null!=s?(s.state.list=1,this._scheduleUpdate()):n.getLogger(this).error("Trying to remove analysis which was not added")}_scheduleUpdate(){null==this._scheduledUpdateHandle&&(this._scheduledUpdateHandle=y(()=>this._update()))}_update(){this._scheduledUpdateHandle=r(this._scheduledUpdateHandle),this._items.forEach(e=>{if(1!==e.state.list)return;const{analysis:s,view:t}=e;switch(this._items.delete(s),e.state.view){case 0:e.createAnalysisViewTask=c(e.createAnalysisViewTask);break;case 1:null!=t&&(this._allAnalysisViews.remove(t),e.view=l(t),e.createAnalysisViewTask=null,this._emitOnView("analysis-view-destroy",{analysis:s,analysisView:t}))}})}async _createAnalysisViewPromise(e,s){const{analysis:t}=e;if(this._creatingViewCount+=1,!this._moduleMap.has(t.type))try{this._moduleMap.set(t.type,await this.importAnalysisViewModule(t))}catch(n){throw this._creatingViewCount-=1,new a("AnalysisViewManager:no-analysis-view-for-analysis",`Analysis of type "${t.type}" is not supported`)}if(w(s))throw this._creatingViewCount-=1,h("AnalysisView creation aborted");const i=new(this._moduleMap.get(t.type).default)({analysis:t,view:this.view});let o=!0;d(s,()=>{o&&this._destroyAnalysisView(t,i)});try{await i.when()}catch(n){throw o=!1,this._destroyAnalysisView(t,i),n}if(w(s))throw h();return o=!1,e.view=i,e.state.view=1,this._allAnalysisViews.add(i),this._creatingViewCount-=1,i}_destroyAnalysisView(e,s){s.destroyed||(this._creatingViewCount-=1,s.destroy(),this._emitOnView("analysis-view-destroy",{analysis:e,analysisView:s}))}};e([m()],u.prototype,"updating",null),e([m({constructOnly:!0})],u.prototype,"importAnalysisViewModule",void 0),e([m({constructOnly:!0})],u.prototype,"view",void 0),e([m()],u.prototype,"_allAnalysisViews",void 0),e([m()],u.prototype,"_creatingViewCount",void 0),u=e([p("esri.views.support.AnalysisViewManager")],u);const V=u;function v(){const e=Promise.withResolvers();return e.promise.catch(()=>{}),e}export{V as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import s from"../../core/Accessor.js";import{createTask as t}from"../../core/asyncUtils.js";import i from"../../core/Collection.js";import a from"../../core/Error.js";import{makeHandle as o}from"../../core/handleUtils.js";import"../../core/has.js";import n from"../../core/Logger.js";import{removeMaybe as r,destroyMaybe as l,abortMaybe as c}from"../../core/maybe.js";import{createAbortError as h,isAborted as w,onAbort as d}from"../../core/promiseUtils.js";import{schedule as y}from"../../core/scheduling.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";const _=Symbol("analyses-owner-handles");let u=class extends s{constructor(e){super(e),this._allAnalysisViews=new i,this._creatingViewCount=0,this._attachedToViewResolver=v(),this._items=new Map,this._moduleMap=new Map,this._scheduledUpdateHandle=null,this._emitOnView=(e,s)=>this.view.emit(e,s)}destroy(){this._disconnectOwners(),this._attachedToViewResolver.reject(h("AnalysisViewManager was destroyed")),this._set("view",null)}attach(){this._connectOwners(),this._attachedToViewResolver.resolve()}detach(){this._disconnectOwners(),this._attachedToViewResolver.reject(h()),this._attachedToViewResolver=v()}get updating(){return!this.view.ready||0!==this._creatingViewCount||this._allAnalysisViews.some(e=>e.updating)}get testInfo(){}async whenAnalysisView(e){await this._attachedToViewResolver.promise;const s=this._items.get(e);if(null==s||1===s.state.list){throw new a("AnalysisViewManager:no-analysis-view-for-analysis","The analysis does not exist in view.analyses",{analysis:e})}return s.createAnalysisViewTask.promise}_connectOwners(){this.addHandles(this._connectAnalysesCollection(this.view.analyses),_)}_disconnectOwners(){this.removeHandles(_),this._update(),this._creatingViewCount=0}_connectAnalysesCollection(e){for(const i of e)this._addAnalysis(i);const s=e.on("after-add",e=>this._addAnalysis(e.item)),t=e.on("after-remove",e=>this._removeAnalysis(e.item));return o(()=>{s.remove(),t.remove();for(const s of e)this._removeAnalysis(s)})}_addAnalysis(e){const s=this._items.get(e);if(null==s){const s={state:{view:0,list:0},analysis:e,view:null,createAnalysisViewTask:null};this._items.set(e,s),s.createAnalysisViewTask=t(t=>this._createAnalysisViewPromise(s,t).then(s=>(this._emitOnView("analysis-view-create",{analysis:e,analysisView:s}),s),s=>{throw this._emitOnView("analysis-view-create-error",{analysis:e,error:s}),s}))}else s.state.list=0}_removeAnalysis(e){const s=this._items.get(e);null!=s?(s.state.list=1,this._scheduleUpdate()):n.getLogger(this).error("Trying to remove analysis which was not added")}_scheduleUpdate(){null==this._scheduledUpdateHandle&&(this._scheduledUpdateHandle=y(()=>this._update()))}_update(){this._scheduledUpdateHandle=r(this._scheduledUpdateHandle),this._items.forEach(e=>{if(1!==e.state.list)return;const{analysis:s,view:t}=e;switch(this._items.delete(s),e.state.view){case 0:e.createAnalysisViewTask=c(e.createAnalysisViewTask);break;case 1:null!=t&&(this._allAnalysisViews.remove(t),e.view=l(t),e.createAnalysisViewTask=null,this._emitOnView("analysis-view-destroy",{analysis:s,analysisView:t}))}})}async _createAnalysisViewPromise(e,s){const{analysis:t}=e;if(this._creatingViewCount+=1,!this._moduleMap.has(t.type))try{this._moduleMap.set(t.type,await this.importAnalysisViewModule(t))}catch(n){throw this._creatingViewCount-=1,new a("AnalysisViewManager:no-analysis-view-for-analysis",`Analysis of type "${t.type}" is not supported`)}if(w(s))throw this._creatingViewCount-=1,h("AnalysisView creation aborted");const i=new(this._moduleMap.get(t.type).default)({analysis:t,view:this.view});let o=!0;d(s,()=>{o&&this._destroyAnalysisView(t,i,e)});try{await i.when()}catch(n){throw o=!1,this._destroyAnalysisView(t,i,e),n}if(w(s))throw h();return o=!1,e.view=i,e.state.view=1,this._allAnalysisViews.add(i),this._creatingViewCount-=1,i}_destroyAnalysisView(e,s,t){s.destroyed||(this._creatingViewCount-=1,s.destroy(),1===t.state.view&&this._emitOnView("analysis-view-destroy",{analysis:e,analysisView:s}))}};e([m()],u.prototype,"updating",null),e([m({constructOnly:!0})],u.prototype,"importAnalysisViewModule",void 0),e([m({constructOnly:!0})],u.prototype,"view",void 0),e([m()],u.prototype,"_allAnalysisViews",void 0),e([m()],u.prototype,"_creatingViewCount",void 0),u=e([p("esri.views.support.AnalysisViewManager")],u);const V=u;function v(){const e=Promise.withResolvers();return e.promise.catch(()=>{}),e}export{V as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as i}from"tslib";import o from"../../../core/Accessor.js";import{createTask as t}from"../../../core/asyncUtils.js";import{abortMaybe as e,destroyMaybe as s}from"../../../core/maybe.js";import{whenOrAbort as l}from"../../../core/promiseUtils.js";import{watch as r,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as n,subclass as m}from"../../../core/accessorSupport/decorators.js";let p=class extends o{constructor(i){super(i),this._implementation=null,this._loadingTask=null}initialize(){this.addHandles(r(()=>({tool:this.tool,view:this.tool.viewModel.view,visible:this.tool.visible&&!!this.tool.viewModel.view?.ready}),({tool:i,view:o,visible:t})=>{null!=o&&t?this._show(o,i):this._hide()},a))}destroy(){this._hide()}_show(i,o){this._loadingTask=e(this._loadingTask),this._loadingTask=t(async t=>{if("2d"===i.type){const e=import("./ElevationProfileView2D.js"),s=(await l(e,t)).ElevationProfileView2D;this._implementation=new s(i,o)}else if("3d"===i.type){const e=import("./ElevationProfileView3D.js"),s=(await l(e,t)).ElevationProfileView3D;this._implementation=new s(i,o)}})}_hide(){this._loadingTask=e(this._loadingTask),this._implementation=s(this._implementation)}};i([n()],p.prototype,"tool",void 0),p=i([m("esri.widgets.ElevationProfile.support.ElevationProfileView")],p);export{p as ElevationProfileView};
|
|
2
|
+
import{__decorate as i}from"tslib";import o from"../../../core/Accessor.js";import{createTask as t}from"../../../core/asyncUtils.js";import{abortMaybe as e,destroyMaybe as s}from"../../../core/maybe.js";import{whenOrAbort as l}from"../../../core/promiseUtils.js";import{watch as r,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as n,subclass as m}from"../../../core/accessorSupport/decorators.js";let p=class extends o{constructor(i){super(i),this._implementation=null,this._loadingTask=null}initialize(){this.addHandles(r(()=>({tool:this.tool,view:this.tool.viewModel.view,visible:this.tool.visible&&!!this.tool.viewModel.view?.ready}),({tool:i,view:o,visible:t})=>{null!=o&&t?this._show(o,i):this._hide()},a))}destroy(){this._hide()}_show(i,o){this._loadingTask=e(this._loadingTask),this._loadingTask=t(async t=>{if("2d"===i.type){const e=import("./ElevationProfileView2D.js"),s=(await l(e,t)).ElevationProfileView2D;this._implementation=new s(i,o)}else if("3d"===i.type){const e=import("./ElevationProfileView3D.js"),s=(await l(e,t)).ElevationProfileView3D;this._implementation=new s(i,o)}})}_hide(){this._loadingTask=e(this._loadingTask),this._implementation=s(this._implementation)}};i([n()],p.prototype,"tool",void 0),i([n()],p.prototype,"_implementation",void 0),p=i([m("esri.widgets.ElevationProfile.support.ElevationProfileView")],p);export{p as ElevationProfileView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Handles.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{HoveredPoints as o}from"./HoveredPoints.js";import{InputRepresentation3D as n}from"./InputRepresentation3D.js";import{ProfileLines3D as r}from"./ProfileLines3D.js";class h{constructor(t,h){this._handles=new e,this._inputRepresentation=new n({view:t}),this._hoveredPoints=new o({view:t}),this._profileLines=new r({view:t}),this._handles.add([i(()=>h.viewModel.hoveredPoints,e=>this._hoveredPoints.update(e),s),i(()=>{const{state:e,editable:t,highlightEnabled:i,viewModel:s}=h,o=s.input;return o&&(o.commitProperty("geometry"),o.commitProperty("layer")),{input:o,state:e,editable:t,highlightEnabled:i}},e=>this._updateInputRepresentation(e),s),i(()=>h.viewModel.chartData,e=>this._profileLines.update(e),s)
|
|
2
|
+
import e from"../../../core/Handles.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{HoveredPoints as o}from"./HoveredPoints.js";import{InputRepresentation3D as n}from"./InputRepresentation3D.js";import{ProfileLines3D as r}from"./ProfileLines3D.js";class h{constructor(t,h){this._handles=new e,this._inputRepresentation=new n({view:t}),this._hoveredPoints=new o({view:t}),this._profileLines=new r({view:t}),this._handles.add([i(()=>h.viewModel.hoveredPoints,e=>this._hoveredPoints.update(e),s),i(()=>h.viewModel.input?.geometry,()=>{this._profileLines.remove()},s),i(()=>{const{state:e,editable:t,highlightEnabled:i,viewModel:s}=h,o=s.input;return o&&(o.commitProperty("geometry"),o.commitProperty("layer")),{input:o,state:e,editable:t,highlightEnabled:i}},e=>this._updateInputRepresentation(e),s),i(()=>h.viewModel.chartData,e=>this._profileLines.update(e),s)])}destroy(){this._handles=t(this._handles),this._inputRepresentation=t(this._inputRepresentation),this._hoveredPoints=t(this._hoveredPoints),this._profileLines=t(this._profileLines)}_updateInputRepresentation({input:e,state:t,editable:i,highlightEnabled:s}){const o=this._inputRepresentation;if(!s)return o.remove();"selected"===t?o.showHighlight(e):"created"!==t||i?o.remove():o.showReshaping(e)}}export{h as ElevationProfileView3D};
|
|
@@ -88,8 +88,9 @@ export interface FeatureViewModelProperties extends IdentifiableMixinProperties,
|
|
|
88
88
|
export type PopupViewModelContent = Content[] | string | HTMLElement | Widget;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
|
-
* Provides the logic for the [Feature](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/) widget
|
|
91
|
+
* Provides the logic for the [Feature](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/) widget.
|
|
92
92
|
*
|
|
93
|
+
* @deprecated since 5.1. Use the [Feature component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature/) or the [Feature](https://developers.arcgis.com/javascript/latest/references/core/popup/Feature/) class instead.
|
|
93
94
|
* @since 4.7
|
|
94
95
|
* @see [Feature](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/) widget- _Deprecated since 4.34. Use the [Feature component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature/) instead._
|
|
95
96
|
* @see [Feature component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature/)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../../arcade/featureset/support/FeatureSetQueryInterceptor.js";import s from"../../core/Accessor.js";import{isSome as o}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{IdentifiableMixin as n}from"../../core/Identifiable.js";import l from"../../core/Logger.js";import{abortMaybe as p}from"../../core/maybe.js";import{eachAlways as c,isAbortError as d,throwIfAborted as h}from"../../core/promiseUtils.js";import{watch as u,initial as f,when as m,on as _}from"../../core/reactiveUtils.js";import{throttle as y}from"../../core/throttle.js";import{property as g,cast as b,subclass as v}from"../../core/accessorSupport/decorators.js";import w from"../../geometry/Point.js";import A from"../../geometry/SpatialReference.js";import I from"../../popup/content/TextContent.js";import{compileExpressionInfos as x,formatArcadeValue as M}from"../../popup/support/arcadeFeatureUtils.js";import{preLayerQueryCallback as T,preRequestCallback as F,createFieldInfoMap as C,getAllFieldInfos as E,getSourceLayer as V,querySourceLayer as k,queryUpdatedFeature as j,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as R,substituteFieldsInLinksAndAttributes as L,isExpressionField as O,isRelatedField as N,formatEditInfo as U,graphicCallback as Z,formatAttributes as B}from"../../popup/support/featureUtils.js";import{queryLayerInfos as H,queryRelatedFeatures as S,setRelatedFeatures as D,getRelatedFieldInfo as G,createRelatedInfo as q,updateRelatedInfo as K}from"../../popup/support/relatedFeatureUtils.js";import{system as z}from"../../time/constants.js";import Q from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import J from"./FeatureContent/FeatureContentViewModel.js";import W from"./FeatureExpression/FeatureExpressionViewModel.js";import X from"./FeatureFields/FeatureFieldsViewModel.js";import Y from"./FeatureMedia/FeatureMediaViewModel.js";import $ from"./FeatureRelationship/FeatureRelationshipViewModel.js";import ee from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var te;const ie=1,se="content-view-models",oe="relationship-view-models",re="association-view-models",ae={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let ne=class extends(n(s)){static{te=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...ae},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=y(this._graphicChanged,()=>this.notifyChange("waitingForContent"),ie,this),this._isAllowedContentType=e=>{const{abilities:t}=this;return"attachments"===e.type&&!!t.attachmentsContent||"custom"===e.type&&!!t.customContent||"fields"===e.type&&!!t.fieldsContent||"media"===e.type&&!!t.mediaContent||"text"===e.type&&!!t.textContent||"expression"===e.type&&!!t.expressionContent||"relationship"===e.type&&!!t.relationshipContent||"utility-network-associations"===e.type&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=y(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),ie,this),this.addHandles([u(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),f),m(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has("view-scale")?this.view?.scale:null,t?.has("view-time-extent")?this.view?.timeExtent?.start:null,t?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=p(this._graphicChangedTask),this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}static{this.interceptor=new i(T,F)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return C(E(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return V(this.graphic)}castAbilities(e){return{...ae,...e}}get isFeatureFromTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??z}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){const{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:i,_evaluateExpressionAttributesTask:s,_associationVMAbortController:o}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||null!=i&&!i.finished||null!=s&&!s.finished||!!o}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof Y&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof Y&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof Y&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await(i?.load());const s=i?.objectIdField;if(!s||!e||!i)return;const o=e?.attributes?.[s];if(null==o)return;const r=[o];if(!e.geometry){const s=await k({layer:i,graphic:e,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:t}),o=s?.geometry;o&&(e.geometry=o)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._graphicChangedTask=p(this._graphicChangedTask),this._graphicChangedTask=r(async e=>{this._error=null,this._clear();const{graphic:t}=this;try{if(!t)return null;const{_sourceLayer:i,_effectivePopupTemplate:s}=this,o=this.spatialReference;await j({graphic:t,popupTemplate:s,layer:i,spatialReference:o},{signal:e});const[{value:r},{value:a}]=await c([this._getContent(),this._getTitle()]),[,{value:n}]=await c([this._checkForRelatedFeatures({signal:e}),x(s?.expressionInfos,t)]);return{expressionInfos:n,content:r,title:a}}catch(i){throw d(i)||(this._error=i,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(e,t){return"attachments"===e.type?this._compileAttachments(e,t):"custom"===e.type?this._compileCustom(e,t):"fields"===e.type?this._compileFields(e,t):"media"===e.type?this._compileMedia(e,t):"text"===e.type?this._compileText(e,t):"expression"===e.type?this._compileExpression(e,t):"relationship"===e.type?this._compileRelationship(e,t):"utility-network-associations"===e.type?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(o):"string"==typeof e?this._compileText(new I({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(oe),this.removeHandles(se),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),s=t?.getObjectId();return null!=i&&null!=s&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:s,spatialReference:o,timeZone:r}=this;t?.filter(Boolean).forEach(t=>{e.some(e=>this._matchesFeature(e,t))||e.add(new te({abilities:{relationshipContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:t}))}),e.forEach(i=>{const s=t?.find(e=>this._matchesFeature(i,e));s||e.remove(i)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:s,contentElementViewModel:o}=e,r=s?.type;o&&r&&("fields"===r&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createFieldsVMParams(s,t))),"media"===r&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createMediaVMParams(s,t))),"text"===r&&o.set(this._createTextVMParams(s)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:s,relationshipId:o,title:r,description:a}=e,{_sourceLayer:n,graphic:l,map:p}=this;if(!P(n))return;const c=new $({displayCount:i,graphic:l,orderByFields:s,relationshipId:o,layer:n,map:p,...this._compileTitleAndDesc({title:r,description:a})});return this.contentViewModels[t]=c,this.addHandles(_(()=>c.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(c)),oe),e}_matchesGlobalFeature(e,t){return e.association.equals(t.association)}_setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:s,spatialReference:o,timeZone:r}=this;e.forEach((i,s)=>{const o=t.get(s);o?i.forEach(t=>{o.find(e=>this._matchesGlobalFeature(t,e))||(i.remove(t),0===i.length&&e.delete(s))}):(i.removeAll(),e.delete(s))}),t.forEach((t,n)=>{const l=e.get(n)||new a;t?.filter(Boolean).forEach((e,t)=>{if(!l.some(t=>this._matchesGlobalFeature(t,e))){const{association:a,feature:n,terminalName:p,title:c}=e;l.add({title:c,association:a,featureViewModel:new te({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:n}),terminalName:p},t)}}),e.set(n,l)})}_compileUtilityNetworkAssociation(e,t){const{displayCount:i,title:s,description:o,associationTypes:r}=e,{_sourceLayer:a,graphic:n,map:l}=this;if(!R(a))return;const p=new ee({graphic:n,displayCount:i,associationTypes:r,layer:a,map:l,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[t]=p,this.addHandles([u(()=>p.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(p.associationViewModels,p.associationFeatures,p.map))],re),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:s,map:o,spatialReference:r,view:a,location:n}=this,l=new W({expressionInfo:i,graphic:s,interceptor:te.interceptor,map:o,spatialReference:r,view:a,location:n});return this.contentViewModels[t]=l,this.addHandles(u(()=>l.contentElementViewModel,()=>this._setExpressionContentVM(l,t),f),se),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:o,orderByFields:r,attachmentKeywords:a,attachmentTypes:n}=e;return this.contentViewModels[t]=new Q({attachmentKeywords:a,attachmentTypes:n,graphic:i,orderByFields:r,...this._compileTitleAndDesc({title:o,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:o}=e;return this.contentViewModels[t]=new J({graphic:i,creator:s,destroyer:o}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:o,formattedAttributes:r}=this,a=o?.attributes,n=this._expressionAttributes,l=r.global;return{title:L({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:e}),description:L({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,s=this.formattedAttributes,o={...s?.global,...s?.content[t]},r=!!e?.fieldInfos,a=e?.fieldInfos||i?.fieldInfos,n=a?.filter(({fieldName:e})=>!!e&&(O(e)||N(e)||o.hasOwnProperty(e))),l=i?.expressionInfos,{description:p,title:c}=e;return{attributes:o,expressionInfos:l,fieldInfos:n,isContentFieldInfos:r,graphic:this.graphic,layer:this._sourceLayer,...this._compileTitleAndDesc({title:c,description:p})}}_compileFields(e,t){const i=e.clone(),s=new X(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=s,i.fieldInfos=s.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:s,_fieldInfoMap:o,_effectivePopupTemplate:r,relatedInfos:a,_sourceLayer:n,_expressionAttributes:l}=this,p=this.formattedAttributes,c=s?.attributes??{},{description:d,mediaInfos:h,title:u}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:c,graphic:s,layer:n,fieldInfoMap:o,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:l,mediaInfos:h,popupTemplate:r,relatedInfos:a,...this._compileTitleAndDesc({title:u,description:d})}}_compileMedia(e,t){const i=e.clone(),s=new Y(this._createMediaVMParams(e,t));return i.mediaInfos=s.formattedMediaInfos.slice(),this.contentViewModels[t]=s,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:o}=this;if(e&&e.text){const r=t?.attributes??{},a=this.formattedAttributes?.global??{};e.text=L({attributes:r,fieldInfoMap:i,globalAttributes:a,expressionAttributes:o,layer:s,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new J(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:s}=this;if(!e)return;const{lastEditInfoEnabled:o}=e,r=t?.editFieldsInfo;return o&&r?U(r,i?.attributes,s,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s,_expressionAttributes:o}=this,r=s?.attributes??{},a=this.formattedAttributes?.global??{};return L({attributes:r,fieldInfoMap:t,globalAttributes:a,expressionAttributes:o,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?Z({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?Z({type:"content",value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({title:e,content:t,expressionInfos:i}){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=r(async s=>{const{graphic:o,map:r,view:a,spatialReference:n,location:p}=this;try{if(!o)return;let l;if(null!=i){const e=[];for(const[t,l]of i.expressions.entries())null!=l?e.push(l.evaluate({graphic:o,interceptor:te.interceptor,location:p,map:r,options:{signal:s},spatialReference:n,view:a}).then(e=>[t,"string"==typeof e?M(e):e]).catch(()=>[t,void 0])):e.push(Promise.resolve([t,void 0]));l=Object.fromEntries(await Promise.all(e)),h(s)}this._expressionAttributes=l,this._graphicExpressionAttributes={...o.attributes,...l},this._set("formattedAttributes",this._createFormattedAttributes(t)),this._set("title",this._compileTitle(e)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(t)||null)}catch(c){d(c)||(this._error=c,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:c,graphic:o,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:o,relatedInfos:r,_sourceLayer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[t]=B({attributes:{...l,...e.attributes},fieldInfoMap:n,fieldInfos:s?.fieldInfos,graphic:o,layer:a,relatedInfos:r,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:s,relatedInfos:o,_sourceLayer:r,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[t]=B({attributes:{...n,...e.attributes},fieldInfoMap:a,fieldInfos:e.fieldInfos,graphic:s,isContentFieldInfos:!0,layer:r,relatedInfos:o,timeZone:l})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:r,_graphicExpressionAttributes:a,timeZone:n}=this,l=t?.fieldInfos,p={global:B({attributes:a,fieldInfoMap:r,fieldInfos:l,graphic:i,layer:o,relatedInfos:s,timeZone:n}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{"fields"===e.type&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p}),"media"===e.type&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,E(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:o}=this;s.clear();const r=null!=o?.associatedLayer?await(o?.associatedLayer.load(i)):o;if(!r||!e)return;const a=t.filter(e=>!!e.fieldName&&N(e.fieldName));if(!a?.length)return;t.forEach(e=>this._configureRelatedInfo(e,r));const n=await H({relatedInfos:s,layer:r},i);Object.keys(n).forEach(e=>{const t=s.get(e.toString()),i=n[e]?.value;t&&i&&(t.layerInfo=i.data)});const l=await S({graphic:e,relatedInfos:s,layer:r},i);Object.keys(l).forEach(e=>{D(l[e]?.value,s.get(e.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=G(e.fieldName||"");if(!s)return;const{layerId:o,fieldName:r}=s;if(!o)return;const a=i.get(o.toString())||q(o,t);a&&(K({relatedInfo:a,fieldName:r,fieldInfo:e}),this.relatedInfos.set(o,a))}};e([g()],ne.prototype,"_error",void 0),e([g()],ne.prototype,"_graphicChangedTask",void 0),e([g()],ne.prototype,"_evaluateExpressionAttributesTask",void 0),e([g()],ne.prototype,"_associationVMAbortController",void 0),e([g({readOnly:!0})],ne.prototype,"_effectivePopupTemplate",null),e([g({readOnly:!0})],ne.prototype,"_fieldInfoMap",null),e([g({readOnly:!0})],ne.prototype,"_sourceLayer",null),e([g()],ne.prototype,"abilities",void 0),e([b("abilities")],ne.prototype,"castAbilities",null),e([g({readOnly:!0})],ne.prototype,"content",void 0),e([g({readOnly:!0})],ne.prototype,"contentViewModels",void 0),e([g()],ne.prototype,"description",void 0),e([g({type:Boolean})],ne.prototype,"defaultPopupTemplateEnabled",void 0),e([g({readOnly:!0})],ne.prototype,"isFeatureFromTable",null),e([g({readOnly:!0})],ne.prototype,"state",null),e([g({readOnly:!0})],ne.prototype,"formattedAttributes",void 0),e([g({type:t})],ne.prototype,"graphic",void 0),e([g({readOnly:!0})],ne.prototype,"lastEditInfo",void 0),e([g({type:w})],ne.prototype,"location",void 0),e([g({readOnly:!0})],ne.prototype,"relatedInfos",void 0),e([g({type:A})],ne.prototype,"spatialReference",null),e([g()],ne.prototype,"timeZone",null),e([g({readOnly:!0})],ne.prototype,"title",void 0),e([g()],ne.prototype,"map",null),e([g({readOnly:!0})],ne.prototype,"waitingForContent",null),e([g()],ne.prototype,"view",void 0),ne=te=e([v("esri.widgets.Feature.FeatureViewModel")],ne);export{ne as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../../arcade/featureset/support/FeatureSetQueryInterceptor.js";import s from"../../core/Accessor.js";import{isSome as o}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{deprecatedModule as n}from"../../core/deprecate.js";import{IdentifiableMixin as l}from"../../core/Identifiable.js";import p from"../../core/Logger.js";import{abortMaybe as c}from"../../core/maybe.js";import{eachAlways as d,isAbortError as h,throwIfAborted as u}from"../../core/promiseUtils.js";import{watch as f,initial as m,when as _,on as y}from"../../core/reactiveUtils.js";import{throttle as g}from"../../core/throttle.js";import{property as b,cast as w,subclass as v}from"../../core/accessorSupport/decorators.js";import A from"../../geometry/Point.js";import I from"../../geometry/SpatialReference.js";import x from"../../popup/content/TextContent.js";import{compileExpressionInfos as M,formatArcadeValue as T}from"../../popup/support/arcadeFeatureUtils.js";import{preLayerQueryCallback as F,preRequestCallback as C,createFieldInfoMap as E,getAllFieldInfos as V,getSourceLayer as k,querySourceLayer as j,queryUpdatedFeature as P,isRelatableFeatureSupportedLayer as R,isAssociatedFeatureSupportedLayer as L,substituteFieldsInLinksAndAttributes as O,isExpressionField as U,isRelatedField as N,formatEditInfo as Z,graphicCallback as D,formatAttributes as B}from"../../popup/support/featureUtils.js";import{queryLayerInfos as H,queryRelatedFeatures as S,setRelatedFeatures as G,getRelatedFieldInfo as q,createRelatedInfo as z,updateRelatedInfo as K}from"../../popup/support/relatedFeatureUtils.js";import{system as W}from"../../time/constants.js";import Q from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import J from"./FeatureContent/FeatureContentViewModel.js";import X from"./FeatureExpression/FeatureExpressionViewModel.js";import Y from"./FeatureFields/FeatureFieldsViewModel.js";import $ from"./FeatureMedia/FeatureMediaViewModel.js";import ee from"./FeatureRelationship/FeatureRelationshipViewModel.js";import te from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var ie;const se=1,oe="content-view-models",re="relationship-view-models",ae="association-view-models",ne={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let le=class extends(l(s)){static{ie=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...ne},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=g(this._graphicChanged,()=>this.notifyChange("waitingForContent"),se,this),this._isAllowedContentType=e=>{const{abilities:t}=this;return"attachments"===e.type&&!!t.attachmentsContent||"custom"===e.type&&!!t.customContent||"fields"===e.type&&!!t.fieldsContent||"media"===e.type&&!!t.mediaContent||"text"===e.type&&!!t.textContent||"expression"===e.type&&!!t.expressionContent||"relationship"===e.type&&!!t.relationshipContent||"utility-network-associations"===e.type&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=g(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),se,this),e?.suppressDeprecationWarning||n(p.getLogger(this),"esri.widgets.Feature.FeatureViewModel",{version:"5.1",replacement:"Use the Feature component or the @arcgis/core/popup/Feature module instead.",warnOnce:!0}),this.addHandles([f(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),m),_(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has("view-scale")?this.view?.scale:null,t?.has("view-time-extent")?this.view?.timeExtent?.start:null,t?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}normalizeCtorArgs(e){const{suppressDeprecationWarning:t,...i}=e??{};return i}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=c(this._graphicChangedTask),this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}static{this.interceptor=new i(F,C)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return E(V(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return k(this.graphic)}castAbilities(e){return{...ne,...e}}get isFeatureFromTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??W}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){const{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:i,_evaluateExpressionAttributesTask:s,_associationVMAbortController:o}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||null!=i&&!i.finished||null!=s&&!s.finished||!!o}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof $&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof $&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof $&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await(i?.load());const s=i?.objectIdField;if(!s||!e||!i)return;const o=e?.attributes?.[s];if(null==o)return;const r=[o];if(!e.geometry){const s=await j({layer:i,graphic:e,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:t}),o=s?.geometry;o&&(e.geometry=o)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._graphicChangedTask=c(this._graphicChangedTask),this._graphicChangedTask=r(async e=>{this._error=null,this._clear();const{graphic:t}=this;try{if(!t)return null;const{_sourceLayer:i,_effectivePopupTemplate:s}=this,o=this.spatialReference;await P({graphic:t,popupTemplate:s,layer:i,spatialReference:o},{signal:e});const[{value:r},{value:a}]=await d([this._getContent(),this._getTitle()]),[,{value:n}]=await d([this._checkForRelatedFeatures({signal:e}),M(s?.expressionInfos,t)]);return{expressionInfos:n,content:r,title:a}}catch(i){throw h(i)||(this._error=i,p.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(e,t){return"attachments"===e.type?this._compileAttachments(e,t):"custom"===e.type?this._compileCustom(e,t):"fields"===e.type?this._compileFields(e,t):"media"===e.type?this._compileMedia(e,t):"text"===e.type?this._compileText(e,t):"expression"===e.type?this._compileExpression(e,t):"relationship"===e.type?this._compileRelationship(e,t):"utility-network-associations"===e.type?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(o):"string"==typeof e?this._compileText(new x({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(re),this.removeHandles(oe),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),s=t?.getObjectId();return null!=i&&null!=s&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:s,spatialReference:o,timeZone:r}=this;t?.filter(Boolean).forEach(t=>{e.some(e=>this._matchesFeature(e,t))||e.add(new ie({abilities:{relationshipContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:t}))}),e.forEach(i=>{const s=t?.find(e=>this._matchesFeature(i,e));s||e.remove(i)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:s,contentElementViewModel:o}=e,r=s?.type;o&&r&&("fields"===r&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createFieldsVMParams(s,t))),"media"===r&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createMediaVMParams(s,t))),"text"===r&&o.set(this._createTextVMParams(s)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:s,relationshipId:o,title:r,description:a}=e,{_sourceLayer:n,graphic:l,map:p}=this;if(!R(n))return;const c=new ee({displayCount:i,graphic:l,orderByFields:s,relationshipId:o,layer:n,map:p,...this._compileTitleAndDesc({title:r,description:a})});return this.contentViewModels[t]=c,this.addHandles(y(()=>c.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(c)),re),e}_matchesGlobalFeature(e,t){return e.association.equals(t.association)}_setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:s,spatialReference:o,timeZone:r}=this;e.forEach((i,s)=>{const o=t.get(s);o?i.forEach(t=>{o.find(e=>this._matchesGlobalFeature(t,e))||(i.remove(t),0===i.length&&e.delete(s))}):(i.removeAll(),e.delete(s))}),t.forEach((t,n)=>{const l=e.get(n)||new a;t?.filter(Boolean).forEach((e,t)=>{if(!l.some(t=>this._matchesGlobalFeature(t,e))){const{association:a,feature:n,terminalName:p,title:c}=e;l.add({title:c,association:a,featureViewModel:new ie({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:n}),terminalName:p},t)}}),e.set(n,l)})}_compileUtilityNetworkAssociation(e,t){const{displayCount:i,title:s,description:o,associationTypes:r}=e,{_sourceLayer:a,graphic:n,map:l}=this;if(!L(a))return;const p=new te({graphic:n,displayCount:i,associationTypes:r,layer:a,map:l,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[t]=p,this.addHandles([f(()=>p.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(p.associationViewModels,p.associationFeatures,p.map))],ae),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:s,map:o,spatialReference:r,view:a,location:n}=this,l=new X({expressionInfo:i,graphic:s,interceptor:ie.interceptor,map:o,spatialReference:r,view:a,location:n});return this.contentViewModels[t]=l,this.addHandles(f(()=>l.contentElementViewModel,()=>this._setExpressionContentVM(l,t),m),oe),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:o,orderByFields:r,attachmentKeywords:a,attachmentTypes:n}=e;return this.contentViewModels[t]=new Q({attachmentKeywords:a,attachmentTypes:n,graphic:i,orderByFields:r,...this._compileTitleAndDesc({title:o,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:o}=e;return this.contentViewModels[t]=new J({graphic:i,creator:s,destroyer:o}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:o,formattedAttributes:r}=this,a=o?.attributes,n=this._expressionAttributes,l=r.global;return{title:O({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:e}),description:O({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,s=this.formattedAttributes,o={...s?.global,...s?.content[t]},r=!!e?.fieldInfos,a=e?.fieldInfos||i?.fieldInfos,n=a?.filter(({fieldName:e})=>!!e&&(U(e)||N(e)||o.hasOwnProperty(e))),l=i?.expressionInfos,{description:p,title:c}=e;return{attributes:o,expressionInfos:l,fieldInfos:n,isContentFieldInfos:r,graphic:this.graphic,layer:this._sourceLayer,...this._compileTitleAndDesc({title:c,description:p})}}_compileFields(e,t){const i=e.clone(),s=new Y(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=s,i.fieldInfos=s.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:s,_fieldInfoMap:o,_effectivePopupTemplate:r,relatedInfos:a,_sourceLayer:n,_expressionAttributes:l}=this,p=this.formattedAttributes,c=s?.attributes??{},{description:d,mediaInfos:h,title:u}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:c,graphic:s,layer:n,fieldInfoMap:o,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:l,mediaInfos:h,popupTemplate:r,relatedInfos:a,...this._compileTitleAndDesc({title:u,description:d})}}_compileMedia(e,t){const i=e.clone(),s=new $(this._createMediaVMParams(e,t));return i.mediaInfos=s.formattedMediaInfos.slice(),this.contentViewModels[t]=s,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:o}=this;if(e&&e.text){const r=t?.attributes??{},a=this.formattedAttributes?.global??{};e.text=O({attributes:r,fieldInfoMap:i,globalAttributes:a,expressionAttributes:o,layer:s,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new J(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:s}=this;if(!e)return;const{lastEditInfoEnabled:o}=e,r=t?.editFieldsInfo;return o&&r?Z(r,i?.attributes,s,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s,_expressionAttributes:o}=this,r=s?.attributes??{},a=this.formattedAttributes?.global??{};return O({attributes:r,fieldInfoMap:t,globalAttributes:a,expressionAttributes:o,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?D({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?D({type:"content",value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({title:e,content:t,expressionInfos:i}){this._evaluateExpressionAttributesTask=c(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=r(async s=>{const{graphic:o,map:r,view:a,spatialReference:n,location:l}=this;try{if(!o)return;let p;if(null!=i){const e=[];for(const[t,p]of i.expressions.entries())null!=p?e.push(p.evaluate({graphic:o,interceptor:ie.interceptor,location:l,map:r,options:{signal:s},spatialReference:n,view:a}).then(e=>[t,"string"==typeof e?T(e):e]).catch(()=>[t,void 0])):e.push(Promise.resolve([t,void 0]));p=Object.fromEntries(await Promise.all(e)),u(s)}this._expressionAttributes=p,this._graphicExpressionAttributes={...o.attributes,...p},this._set("formattedAttributes",this._createFormattedAttributes(t)),this._set("title",this._compileTitle(e)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(t)||null)}catch(c){h(c)||(this._error=c,p.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:c,graphic:o,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:o,relatedInfos:r,_sourceLayer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[t]=B({attributes:{...l,...e.attributes},fieldInfoMap:n,fieldInfos:s?.fieldInfos,graphic:o,layer:a,relatedInfos:r,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:s,relatedInfos:o,_sourceLayer:r,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[t]=B({attributes:{...n,...e.attributes},fieldInfoMap:a,fieldInfos:e.fieldInfos,graphic:s,isContentFieldInfos:!0,layer:r,relatedInfos:o,timeZone:l})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:r,_graphicExpressionAttributes:a,timeZone:n}=this,l=t?.fieldInfos,p={global:B({attributes:a,fieldInfoMap:r,fieldInfos:l,graphic:i,layer:o,relatedInfos:s,timeZone:n}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{"fields"===e.type&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p}),"media"===e.type&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,V(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:o}=this;s.clear();const r=null!=o?.associatedLayer?await(o?.associatedLayer.load(i)):o;if(!r||!e)return;const a=t.filter(e=>!!e.fieldName&&N(e.fieldName));if(!a?.length)return;t.forEach(e=>this._configureRelatedInfo(e,r));const n=await H({relatedInfos:s,layer:r},i);Object.keys(n).forEach(e=>{const t=s.get(e.toString()),i=n[e]?.value;t&&i&&(t.layerInfo=i.data)});const l=await S({graphic:e,relatedInfos:s,layer:r},i);Object.keys(l).forEach(e=>{G(l[e]?.value,s.get(e.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=q(e.fieldName||"");if(!s)return;const{layerId:o,fieldName:r}=s;if(!o)return;const a=i.get(o.toString())||z(o,t);a&&(K({relatedInfo:a,fieldName:r,fieldInfo:e}),this.relatedInfos.set(o,a))}};e([b()],le.prototype,"_error",void 0),e([b()],le.prototype,"_graphicChangedTask",void 0),e([b()],le.prototype,"_evaluateExpressionAttributesTask",void 0),e([b()],le.prototype,"_associationVMAbortController",void 0),e([b({readOnly:!0})],le.prototype,"_effectivePopupTemplate",null),e([b({readOnly:!0})],le.prototype,"_fieldInfoMap",null),e([b({readOnly:!0})],le.prototype,"_sourceLayer",null),e([b()],le.prototype,"abilities",void 0),e([w("abilities")],le.prototype,"castAbilities",null),e([b({readOnly:!0})],le.prototype,"content",void 0),e([b({readOnly:!0})],le.prototype,"contentViewModels",void 0),e([b()],le.prototype,"description",void 0),e([b({type:Boolean})],le.prototype,"defaultPopupTemplateEnabled",void 0),e([b({readOnly:!0})],le.prototype,"isFeatureFromTable",null),e([b({readOnly:!0})],le.prototype,"state",null),e([b({readOnly:!0})],le.prototype,"formattedAttributes",void 0),e([b({type:t})],le.prototype,"graphic",void 0),e([b({readOnly:!0})],le.prototype,"lastEditInfo",void 0),e([b({type:A})],le.prototype,"location",void 0),e([b({readOnly:!0})],le.prototype,"relatedInfos",void 0),e([b({type:I})],le.prototype,"spatialReference",null),e([b()],le.prototype,"timeZone",null),e([b({readOnly:!0})],le.prototype,"title",void 0),e([b()],le.prototype,"map",null),e([b({readOnly:!0})],le.prototype,"waitingForContent",null),e([b()],le.prototype,"view",void 0),le=ie=e([v("esri.widgets.Feature.FeatureViewModel")],le);export{le as default};
|
package/widgets/Feature.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{substitute as i}from"../intl.js";import{deprecateWidget as s}from"../core/deprecate.js";import n from"../core/Logger.js";import{watch as r,initial as o}from"../core/reactiveUtils.js";import{property as l,cast as d,subclass as a}from"../core/accessorSupport/decorators.js";import c from"../geometry/Point.js";import p from"./Widget.js";import u from"./Feature/FeatureAttachments.js";import m from"./Feature/FeatureContent.js";import h from"./Feature/FeatureExpression.js";import y from"./Feature/FeatureFields.js";import v from"./Feature/FeatureMedia.js";import g from"./Feature/FeatureRelationship.js";import w from"./Feature/FeatureUtilityNetworkAssociations.js";import f from"./Feature/FeatureViewModel.js";import{css as _}from"./Feature/resources.js";import{FeatureContentMixin as M}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as b}from"./support/globalCss.js";import{Heading as F}from"./support/Heading.js";import{tsx as W,messageBundle as C}from"./support/widget.js";const j={title:!0,content:!0,lastEditedInfo:!0};let k=class extends(M(p)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...j},this.viewModel=new f,!0!==e?.suppressDeprecationWarning&&(this.announceDeprecation=()=>{s(n.getLogger(this),"Feature","arcgis-feature",{version:"4.34"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}initialize(){this.addHandles(r(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),o))}loadDependencies(){return E({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...j,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=W("div",{class:_.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return W("div",{class:this.classes(_.base,b.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:i}=this;return W("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},i.title?W("div",{key:"error-title",slot:"title"},e.errorMessage):null,W("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return W("div",{class:_.loadingSpinnerContainer,key:"loading-container"},W("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?W("div",{class:_.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?W(F,{class:_.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?W("div",{class:_.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:W("div",{class:this.classes(_.contentNode,_.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:i}=this;if("boolean"!=typeof i.content&&!i.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:s}=t.viewModel;return"loading"===i||s.length>0?W("div",{class:this.classes(_.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?W("div",{class:_.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?W("div",{class:_.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?W("div",{class:_.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:i}=e,s=this._contentWidgets[t];return!s||s.destroyed?null:i?W("div",{class:_.contentElement,key:this._buildKey("custom-element",t)},s.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:W("div",{class:_.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:W("div",{class:_.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:n,user:r}=s,o="edit"===s.type?r?t.lastEditedByUser:t.lastEdited:r?t.lastCreatedByUser:t.lastCreated,l=i(o,{date:n,user:r});return W("div",{class:this.classes(_.lastEditedInfo,_.contentElement),key:"edit-info-element"},l)}_renderText(e,t){const i=e.text,s=this._contentWidgets[t];return!s||s.destroyed?null:i?W("div",{class:this.classes(_.contentElement,_.text),key:this._buildKey("text-element",t)},s.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:i,viewModel:s}=this,n=s?.content,{contentViewModels:r}=s;if(Array.isArray(n))n.forEach((n,o)=>{if("attachments"===n.type&&(this._contentWidgets[o]=new u({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:r[o]})),"fields"===n.type&&(this._contentWidgets[o]=new y({viewModel:r[o]})),"media"===n.type&&(this._contentWidgets[o]=new v({viewModel:r[o]})),"text"===n.type&&(this._contentWidgets[o]=new m({viewModel:r[o]})),"custom"===n.type&&(this._contentWidgets[o]=new m({viewModel:r[o]})),"expression"===n.type&&(this._contentWidgets[o]=new h({viewModel:r[o]})),"relationship"===n.type){const e=new g({flowItems:i,featureVisibleElements:t,viewModel:r[o]});this._contentWidgets[o]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:r,title:o}=e;if(!i)return;n.activeAssociationType=r;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:s,listType:r,title:o,featureVisibleElements:t,description:s.title,flowItems:i});i.push(d)},n=new w({flowItems:i,onSelectAssociationType:e,parentFeatureViewModel:s,featureVisibleElements:t,viewModel:r[o]});this._contentWidgets[o]=n}},this);else{const e=r[0];e&&!e.destroyed&&(this._contentWidgets[0]=new m({viewModel:e}))}this.scheduleRender()}};e([l()],k.prototype,"flowType",void 0),e([l({type:t})],k.prototype,"graphic",null),e([l()],k.prototype,"defaultPopupTemplateEnabled",null),e([l()],k.prototype,"flowItems",void 0),e([l()],k.prototype,"headingLevel",void 0),e([l({readOnly:!0})],k.prototype,"isTable",null),e([l()],k.prototype,"icon",null),e([l()],k.prototype,"label",null),e([l({type:c})],k.prototype,"location",null),e([l(),C("esri/widgets/Feature/t9n/Feature")],k.prototype,"messages",void 0),e([l(),C("esri/t9n/common")],k.prototype,"messagesCommon",void 0),e([l()],k.prototype,"spatialReference",null),e([l()],k.prototype,"timeZone",null),e([l({readOnly:!0})],k.prototype,"title",null),e([l()],k.prototype,"visibleElements",void 0),e([d("visibleElements")],k.prototype,"castVisibleElements",null),e([l()],k.prototype,"map",null),e([l()],k.prototype,"view",null),e([l({type:f})],k.prototype,"viewModel",void 0),k=e([a("esri.widgets.Feature")],k);export{k as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{substitute as i}from"../intl.js";import{deprecateWidget as s}from"../core/deprecate.js";import n from"../core/Logger.js";import{watch as r,initial as o}from"../core/reactiveUtils.js";import{property as l,cast as d,subclass as a}from"../core/accessorSupport/decorators.js";import c from"../geometry/Point.js";import p from"./Widget.js";import u from"./Feature/FeatureAttachments.js";import m from"./Feature/FeatureContent.js";import h from"./Feature/FeatureExpression.js";import y from"./Feature/FeatureFields.js";import v from"./Feature/FeatureMedia.js";import g from"./Feature/FeatureRelationship.js";import w from"./Feature/FeatureUtilityNetworkAssociations.js";import f from"./Feature/FeatureViewModel.js";import{css as _}from"./Feature/resources.js";import{FeatureContentMixin as M}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as b}from"./support/globalCss.js";import{Heading as F}from"./support/Heading.js";import{tsx as W,messageBundle as C}from"./support/widget.js";const j={title:!0,content:!0,lastEditedInfo:!0};let k=class extends(M(p)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...j},this.viewModel=new f({suppressDeprecationWarning:!0}),!0!==e?.suppressDeprecationWarning&&(this.announceDeprecation=()=>{s(n.getLogger(this),"Feature","arcgis-feature",{version:"4.34"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}initialize(){this.addHandles(r(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),o))}loadDependencies(){return E({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...j,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=W("div",{class:_.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return W("div",{class:this.classes(_.base,b.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:i}=this;return W("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},i.title?W("div",{key:"error-title",slot:"title"},e.errorMessage):null,W("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return W("div",{class:_.loadingSpinnerContainer,key:"loading-container"},W("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?W("div",{class:_.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?W(F,{class:_.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?W("div",{class:_.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:W("div",{class:this.classes(_.contentNode,_.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:i}=this;if("boolean"!=typeof i.content&&!i.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:s}=t.viewModel;return"loading"===i||s.length>0?W("div",{class:this.classes(_.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?W("div",{class:_.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?W("div",{class:_.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?W("div",{class:_.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:i}=e,s=this._contentWidgets[t];return!s||s.destroyed?null:i?W("div",{class:_.contentElement,key:this._buildKey("custom-element",t)},s.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:W("div",{class:_.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:W("div",{class:_.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:n,user:r}=s,o="edit"===s.type?r?t.lastEditedByUser:t.lastEdited:r?t.lastCreatedByUser:t.lastCreated,l=i(o,{date:n,user:r});return W("div",{class:this.classes(_.lastEditedInfo,_.contentElement),key:"edit-info-element"},l)}_renderText(e,t){const i=e.text,s=this._contentWidgets[t];return!s||s.destroyed?null:i?W("div",{class:this.classes(_.contentElement,_.text),key:this._buildKey("text-element",t)},s.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:i,viewModel:s}=this,n=s?.content,{contentViewModels:r}=s;if(Array.isArray(n))n.forEach((n,o)=>{if("attachments"===n.type&&(this._contentWidgets[o]=new u({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:r[o]})),"fields"===n.type&&(this._contentWidgets[o]=new y({viewModel:r[o]})),"media"===n.type&&(this._contentWidgets[o]=new v({viewModel:r[o]})),"text"===n.type&&(this._contentWidgets[o]=new m({viewModel:r[o]})),"custom"===n.type&&(this._contentWidgets[o]=new m({viewModel:r[o]})),"expression"===n.type&&(this._contentWidgets[o]=new h({viewModel:r[o]})),"relationship"===n.type){const e=new g({flowItems:i,featureVisibleElements:t,viewModel:r[o]});this._contentWidgets[o]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:r,title:o}=e;if(!i)return;n.activeAssociationType=r;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:s,listType:r,title:o,featureVisibleElements:t,description:s.title,flowItems:i});i.push(d)},n=new w({flowItems:i,onSelectAssociationType:e,parentFeatureViewModel:s,featureVisibleElements:t,viewModel:r[o]});this._contentWidgets[o]=n}},this);else{const e=r[0];e&&!e.destroyed&&(this._contentWidgets[0]=new m({viewModel:e}))}this.scheduleRender()}};e([l()],k.prototype,"flowType",void 0),e([l({type:t})],k.prototype,"graphic",null),e([l()],k.prototype,"defaultPopupTemplateEnabled",null),e([l()],k.prototype,"flowItems",void 0),e([l()],k.prototype,"headingLevel",void 0),e([l({readOnly:!0})],k.prototype,"isTable",null),e([l()],k.prototype,"icon",null),e([l()],k.prototype,"label",null),e([l({type:c})],k.prototype,"location",null),e([l(),C("esri/widgets/Feature/t9n/Feature")],k.prototype,"messages",void 0),e([l(),C("esri/t9n/common")],k.prototype,"messagesCommon",void 0),e([l()],k.prototype,"spatialReference",null),e([l()],k.prototype,"timeZone",null),e([l({readOnly:!0})],k.prototype,"title",null),e([l()],k.prototype,"visibleElements",void 0),e([d("visibleElements")],k.prototype,"castVisibleElements",null),e([l()],k.prototype,"map",null),e([l()],k.prototype,"view",null),e([l({type:f})],k.prototype,"viewModel",void 0),k=e([a("esri.widgets.Feature")],k);export{k as default};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type Accessor from "../../core/Accessor.js";
|
|
2
|
+
|
|
3
|
+
/** @since 5.1 */
|
|
4
|
+
export interface ColumnVisibilityMenuVisibleElementsProperties extends Partial<Pick<ColumnVisibilityMenuVisibleElements, "filter" | "header">> {}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Controls the visibility of specific elements within the column visibility menu.
|
|
8
|
+
*
|
|
9
|
+
* @since 5.1
|
|
10
|
+
*/
|
|
11
|
+
export default class ColumnVisibilityMenuVisibleElements extends Accessor {
|
|
12
|
+
constructor(properties?: ColumnVisibilityMenuVisibleElementsProperties);
|
|
13
|
+
/**
|
|
14
|
+
* Indicates whether to display the filter in the column visibility menu.
|
|
15
|
+
*
|
|
16
|
+
* @default true
|
|
17
|
+
* @since 5.1
|
|
18
|
+
*/
|
|
19
|
+
accessor filter: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Indicates whether to display the header of the column visibility menu.
|
|
22
|
+
*
|
|
23
|
+
* @default true
|
|
24
|
+
* @since 5.1
|
|
25
|
+
*/
|
|
26
|
+
accessor header: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import o from"../../core/Accessor.js";import{property as t,subclass as r}from"../../core/accessorSupport/decorators.js";let s=class extends o{constructor(e){super(e),this.filter=!0,this.header=!0}};e([t({type:Boolean,nonNullable:!0})],s.prototype,"filter",void 0),e([t({type:Boolean,nonNullable:!0})],s.prototype,"header",void 0),s=e([r("esri.widgets.FeatureTable.ColumnVisibilityMenuVisibleElements")],s);const l=s;export{l as default};
|
|
@@ -33,7 +33,7 @@ import type { ExtentProperties } from "../../geometry/Extent.js";
|
|
|
33
33
|
import type { TableTemplateProperties } from "./support/TableTemplate.js";
|
|
34
34
|
import type { TimeExtentProperties } from "../../time/TimeExtent.js";
|
|
35
35
|
|
|
36
|
-
export interface FeatureTableViewModelProperties extends GridViewModelProperties, Partial<Pick<FeatureTableViewModel, "actionColumnConfig" | "attachmentsEnabled" | "autoRefreshEnabled" | "autoSaveEnabled" | "columnPerformanceModeEnabled" | "columnReorderingEnabled" | "definitionExpression" | "editingEnabled" | "filterBySelectionEnabled" | "highlightEnabled" | "initialSize" | "layer" | "layers" | "maxSize" | "menuConfig" | "multipleSelectionEnabled" | "multipleSortPriority" | "multiSortEnabled" | "outFields" | "pageIndex" | "pageSize" | "paginationEnabled" | "relatedRecordsEnabled" | "returnGeometryEnabled" | "returnMEnabled" | "returnZEnabled" | "selectionManager" | "syncTemplateOnChangesEnabled" | "syncViewSelection" | "tableController" | "tableParent" | "timeZone" | "view">> {
|
|
36
|
+
export interface FeatureTableViewModelProperties extends GridViewModelProperties, Partial<Pick<FeatureTableViewModel, "actionColumnConfig" | "attachmentsEnabled" | "autoRefreshEnabled" | "autoSaveEnabled" | "columnPerformanceModeEnabled" | "columnReorderingEnabled" | "definitionExpression" | "editingEnabled" | "filterBySelectionEnabled" | "filterByViewExtent" | "highlightEnabled" | "initialSize" | "layer" | "layers" | "maxSize" | "menuConfig" | "multipleSelectionEnabled" | "multipleSortPriority" | "multiSortEnabled" | "outFields" | "pageIndex" | "pageSize" | "paginationEnabled" | "relatedRecordsEnabled" | "returnGeometryEnabled" | "returnMEnabled" | "returnZEnabled" | "selectionManager" | "syncTemplateOnChangesEnabled" | "syncViewSelection" | "tableController" | "tableParent" | "timeZone" | "view">> {
|
|
37
37
|
/**
|
|
38
38
|
* Use this property to configure how columns display within the table in regard to visibility, column order, and sorting.
|
|
39
39
|
*
|
|
@@ -491,6 +491,15 @@ export default class FeatureTableViewModel extends GridViewModel {
|
|
|
491
491
|
* @since 4.30
|
|
492
492
|
*/
|
|
493
493
|
accessor filterBySelectionEnabled: boolean;
|
|
494
|
+
/**
|
|
495
|
+
* Indicates that the table should only display rows for features that are currently in the view's extent.
|
|
496
|
+
* This property has no effect if the table has not been provided a view. If this property is true, the view's extent
|
|
497
|
+
* will overwrite the current value of [FeatureTable.filterGeometry](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/#filterGeometry).
|
|
498
|
+
*
|
|
499
|
+
* @default false
|
|
500
|
+
* @since 5.1
|
|
501
|
+
*/
|
|
502
|
+
accessor filterByViewExtent: boolean;
|
|
494
503
|
/**
|
|
495
504
|
* Set this property to filter the features displayed in the table. It accepts a [Geometry](https://developers.arcgis.com/javascript/latest/references/core/geometry/Geometry/), e.g. [Extent](https://developers.arcgis.com/javascript/latest/references/core/geometry/Extent/), and uses it as a spatial filter. When modifying this property, the FeatureTable will completely refresh and re-query for all features.
|
|
496
505
|
*
|