UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.75 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 s from"../analysis/DimensionAnalysis.js";import t from"../analysis/DimensionSimpleStyle.js";import r from"../analysis/LengthDimension.js";import o from"../core/Collection.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{watch as n,syncAndInitial as l}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 a}from"../core/accessorSupport/decorators/subclass.js";import{writer as c}from"../core/accessorSupport/decorators/writer.js";import y from"./Layer.js";import{OperationalLayer as m}from"./mixins/OperationalLayer.js";let u=class extends(m(i(y))){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new s,this.opacity=1,e){const{source:s,style:t}=e;s&&t&&(s.style=t)}}initialize(){this.addHandles([n((()=>this.source),((e,s)=>{null!=s&&s.parent===this&&(s.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 s)}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,s,t,r){s.dimensions=e.filter((({startPoint:e,endPoint:s})=>null!=e&&null!=s)).toJSON(r)}};e([p({json:{read:!1},readOnly:!0})],u.prototype,"type",void 0),e([p({type:["ArcGISDimensionLayer"]})],u.prototype,"operationalLayerType",void 0),e([p({nonNullable:!0})],u.prototype,"source",void 0),e([p({readOnly:!0})],u.prototype,"spatialReference",null),e([p({types:{key:"type",base:null,typeMap:{simple:t}},json:{write:{ignoreOrigin:!0}}})],u.prototype,"style",null),e([p({readOnly:!0})],u.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}}}})],u.prototype,"opacity",void 0),e([p({type:["show","hide"]})],u.prototype,"listMode",void 0),e([p({type:o.ofType(r),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],u.prototype,"dimensions",null),e([c("web-scene","dimensions")],u.prototype,"writeDimensions",null),u=e([a("esri.layers.DimensionLayer")],u);const d=u;export{d as default};