12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Accessor.js";import s from"../core/Collection.js";import r from"../core/Handles.js";import{when as i,watch as a,sync as o}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import l from"./support/GroundViewElevationSampler.js";let d=class extends t{constructor(e){super(e),this._handles=new r,this.view=null,this.layerViews=new s}initialize(){this._handles.add(i((()=>this.view?.map?.ground),(e=>e.load()))),this._handles.add(this.layerViews.on("after-changes",(()=>this._layerViewsAfterChangesHandler())))}destroy(){this._set("view",null),this._handles&&(this._handles.destroy(),this._handles=null)}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 updating(){return!this.suspended&&this.layerViews.some((e=>e.updating))}get suspended(){return!this.view||this.view.suspended}_layerViewsAfterChangesHandler(){this._handles.remove("updating"),this._handles.add(this.layerViews.map((e=>a((()=>e.updating),(()=>this._updateUpdating()),o))).toArray(),"updating"),this._updateUpdating()}_updateUpdating(){this.notifyChange("updating")}};e([n({readOnly:!0})],d.prototype,"elevationSampler",null),e([n({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([n({constructOnly:!0})],d.prototype,"view",void 0),e([n({type:s,readOnly:!0})],d.prototype,"layerViews",void 0),e([n({readOnly:!0})],d.prototype,"suspended",null),d=e([p("esri.views.GroundView")],d);const h=d;export{h as default};
|