UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 2.4 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as e}from"../chunks/tslib.es6.js";import r from"../analysis/Viewshed.js";import s from"../analysis/ViewshedAnalysis.js";import t from"../core/Collection.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{watch as i,syncAndInitial as a}from"../core/reactiveUtils.js";import{property as p}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{writer as l}from"../core/accessorSupport/decorators/writer.js";import c from"./Layer.js";import{OperationalLayer as d}from"./mixins/OperationalLayer.js";let y=class extends(d(o(c))){constructor(e){super(e),this.type="viewshed",this.operationalLayerType="ViewshedLayer",this.source=new s,this.opacity=1}initialize(){this.addHandles(i((()=>this.source),((e,r)=>{null!=r&&r.parent===this&&(r.parent=null),null!=e&&(e.parent=this)}),a))}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new s)}get analysis(){return this.source}set analysis(e){this.source=e}get viewsheds(){return this.source.viewsheds}set viewsheds(e){this.source.viewsheds=e}writeViewsheds(e,r,s,t){r.viewsheds=e.filter((e=>e.valid)).toJSON(t)}};e([p({json:{read:!1},readOnly:!0})],y.prototype,"type",void 0),e([p({type:["ViewshedLayer"]})],y.prototype,"operationalLayerType",void 0),e([p({type:s,nonNullable:!0})],y.prototype,"source",void 0),e([p({readOnly:!0})],y.prototype,"spatialReference",null),e([p({readOnly:!0})],y.prototype,"fullExtent",null),e([p({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],y.prototype,"opacity",void 0),e([p({type:["show","hide"]})],y.prototype,"listMode",void 0),e([p({type:t.ofType(r),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],y.prototype,"viewsheds",null),e([l("web-scene","viewsheds")],y.prototype,"writeViewsheds",null),y=e([n("esri.layers.ViewshedLayer")],y);const u=y;export{u as default};