UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 2.52 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as e}from"tslib";import t from"../analysis/DimensionAnalysis.js";import s from"../analysis/DimensionSimpleStyle.js";import i from"../analysis/LengthDimension.js";import r from"../core/Collection.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{watch as n,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as a,subclass as p}from"../core/accessorSupport/decorators.js";import y from"./Layer.js";import{OperationalLayer as c}from"./mixins/OperationalLayer.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";let u=class extends(c(o(y))){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new t,this.opacity=1,e){const{source:t,style:s}=e;t&&s&&(t.style=s)}}initialize(){this.addHandles([n(()=>this.source,(e,t)=>{null!=t&&t.parent===this&&(t.parent=null),null!=e&&(e.parent=this)},l)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new t)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,t,s,i){t.dimensions=e.filter(({startPoint:e,endPoint:t})=>null!=e&&null!=t).toJSON(i)}};e([a({json:{read:!1},readOnly:!0})],u.prototype,"type",void 0),e([a({type:["ArcGISDimensionLayer"]})],u.prototype,"operationalLayerType",void 0),e([a({nonNullable:!0})],u.prototype,"source",void 0),e([a({readOnly:!0})],u.prototype,"spatialReference",null),e([a({types:{key:"type",base:null,typeMap:{simple:s}},json:{write:{ignoreOrigin:!0}}})],u.prototype,"style",null),e([a({readOnly:!0})],u.prototype,"fullExtent",null),e([a({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}}}})],u.prototype,"opacity",void 0),e([a({type:["show","hide"]})],u.prototype,"listMode",void 0),e([a({type:r.ofType(i),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],u.prototype,"dimensions",null),e([m("web-scene","dimensions")],u.prototype,"writeDimensions",null),u=e([p("esri.layers.DimensionLayer")],u);const d=u;export{d as default};