@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2.71 kB
JavaScript
/*
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.js";import o from"./SlicePlane.js";import{SliceAnalysisExcludedLayer as t}from"./support/SliceAnalysisExcludedLayer.js";import s from"../core/Collection.js";import{referenceSetter as l,castForReferenceSetter as a}from"../core/collectionUtils.js";import{equalsShallow as i}from"../core/lang.js";import{equalsMaybe as d}from"../core/maybe.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../core/accessorSupport/decorators/writer.js";let y=class extends r{constructor(e){super(e),this.type="slice",this.tiltEnabled=!1,this.shape=null,this.excludeGroundSurface=!1}get excludedLayers(){return this._get("excludedLayers")||new s}set excludedLayers(e){this._set("excludedLayers",l(e,this._get("excludedLayers")))}writeExcludedLayers(e,r,o,s){0!==e.length&&(r[o]=e.toArray().map((e=>t.fromLayer(e).toJSON(s))))}readExcludedLayers(e,r,o){const s=o?.initiator;s&&o?.hooks?.onAfterLoad((async()=>{for(const r of e){const{layerId:e,sublayerId:l}=t.fromJSON(r,o),a=s.allLayers.find((({id:r})=>r===e));if(a)if(null!=l&&"allSublayers"in a){await a.load();const e=a.allSublayers.find((({id:e})=>e===l));e&&"type"in e&&"building-component"===e.type&&this.excludedLayers.add(e)}else this.excludedLayers.add(a)}}))}get valid(){return null!=this.shape?.position}equals(e){return this===e||super.equals(e)&&d(this.shape,e.shape)&&this.tiltEnabled===e.tiltEnabled&&i(this.excludedLayers.toArray(),e.excludedLayers.toArray())&&this.excludeGroundSurface===e.excludeGroundSurface}clear(){this.shape=null}};e([c({type:["slice"],json:{read:!1,write:{isRequired:!0}}})],y.prototype,"type",void 0),e([c({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],y.prototype,"tiltEnabled",void 0),e([c({types:{key:"type",base:null,typeMap:{plane:o},defaultKeyValue:"plane"},json:{write:{isRequired:!0}}})],y.prototype,"shape",void 0),e([c({cast:a,clonable:e=>e.slice(),json:{type:[t],write:!0}})],y.prototype,"excludedLayers",null),e([n("excludedLayers")],y.prototype,"writeExcludedLayers",null),e([p("excludedLayers")],y.prototype,"readExcludedLayers",null),e([c({type:Boolean,nonNullable:!0,json:{write:!0}})],y.prototype,"excludeGroundSurface",void 0),e([c({readOnly:!0})],y.prototype,"valid",null),y=e([u("esri.analysis.SliceAnalysis")],y);const m=y;export{m as default};