@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2.12 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Accessor.js";import r from"../core/Collection.js";import{when as s,watch as i,sync as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{toExtent as p}from"./3d/support/cameraUtils.js";import l from"./support/GroundViewElevationSampler.js";let d=class extends t{constructor(e){super(e),this.view=null,this.layerViews=new r}initialize(){this.addHandles(s((()=>this.view?.map?.ground),(e=>e.load()))),this.addHandles(this.layerViews.on("after-changes",(()=>this._layerViewsAfterChangesHandler())))}destroy(){this._set("view",null);for(const e of this.layerViews)e.destroy();this.layerViews.length=0}get elevationSampler(){return this.view?"2d"===this.view.type?null:this.view.ready&&this.view.basemapTerrain&&this.view.basemapTerrain.ready?new l({view:this.view}):null:null}get extent(){const e=this.view;return e&&"2d"!==e.type&&e.ready?p(e,e.state.camera,e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation):null}get updating(){return!this.suspended&&this.layerViews.some((e=>e.updating))}get suspended(){return this.view?.suspended??!0}_layerViewsAfterChangesHandler(){this.removeHandles("updating"),this.addHandles(this.layerViews.map((e=>i((()=>e.updating),(()=>this._updateUpdating()),o))).toArray(),"updating"),this._updateUpdating()}_updateUpdating(){this.notifyChange("updating")}};e([a({readOnly:!0})],d.prototype,"elevationSampler",null),e([a({readOnly:!0})],d.prototype,"extent",null),e([a({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([a({constructOnly:!0})],d.prototype,"view",void 0),e([a({type:r,readOnly:!0})],d.prototype,"layerViews",void 0),e([a({readOnly:!0})],d.prototype,"suspended",null),d=e([n("esri.views.GroundView")],d);const u=d;export{u as default};