DimensionLayer.js 2.8 KB

12345
  1. /*
  2. All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. See https://js.arcgis.com/4.25/esri/copyright.txt for details.
  4. */
  5. import{_ as e}from"../chunks/tslib.es6.js";import s from"../analysis/DimensionAnalysis.js";import r from"../analysis/DimensionSimpleStyle.js";import t from"../analysis/LengthDimension.js";import o from"../core/Collection.js";import{unwrap as i,isSome as n}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{watch as a,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import u from"./Layer.js";import{OperationalLayer as d}from"./mixins/OperationalLayer.js";let h=class extends(d(p(u))){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new s,this.opacity=1,e){const{source:s,style:r}=e;s&&r&&(s.style=r)}}initialize(){this.addHandles([a((()=>this.source),((e,s)=>{n(s)&&s.parent===this&&(s.parent=null),n(e)&&(e.parent=this)}),l)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return i(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,r,t){s.dimensions=e.filter((({startPoint:e,endPoint:s})=>n(e)&&n(s))).map((e=>e.toJSON(t))).toJSON()}};e([c({json:{read:!1},readOnly:!0})],h.prototype,"type",void 0),e([c({type:["ArcGISDimensionLayer"]})],h.prototype,"operationalLayerType",void 0),e([c({nonNullable:!0})],h.prototype,"source",void 0),e([c({readOnly:!0})],h.prototype,"spatialReference",null),e([c({types:{key:"type",base:null,typeMap:{simple:r}},json:{write:{ignoreOrigin:!0}}})],h.prototype,"style",null),e([c({readOnly:!0})],h.prototype,"fullExtent",null),e([c({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}}}})],h.prototype,"opacity",void 0),e([c({type:["show","hide"]})],h.prototype,"listMode",void 0),e([c({type:o.ofType(t),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],h.prototype,"dimensions",null),e([m("web-scene","dimensions")],h.prototype,"writeDimensions",null),h=e([y("esri.layers.DimensionLayer")],h);const f=h;export{f as default};