UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 2.09 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as e}from"tslib";import t from"../../analysis/SliceAnalysis.js";import s from"../../core/Accessor.js";import r from"../../core/Collection.js";import{deprecateUnnecessaryViewModel as i}from"../../core/deprecate.js";import o from"../../core/Logger.js";import{property as l,subclass as a}from"../../core/accessorSupport/decorators.js";import{AnalysisViewModelMixin as n}from"../support/AnalysisViewModelMixin.js";const d=new Set;let c=class extends(n(s)){constructor(e){super(e),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="SliceViewModel is only supported in 3D views.",e?.suppressDeprecationWarning||i(o.getLogger(this),"Slice","arcgis-slice",{version:"4.33"}),d.add(this)}destroy(){d.delete(this)}get state(){return this.disabled||!this.ready?"disabled":null==this.tool?"ready":this.tool.state}get shape(){return this.analysis.shape}set shape(e){this.analysis.shape=e}get tiltEnabled(){return this.analysis.tiltEnabled}set tiltEnabled(e){this.analysis.tiltEnabled=e}get mode(){return this.tool?.mode??"none"}get excludedLayers(){return this.analysis.excludedLayers}set excludedLayers(e){this.analysis.excludedLayers=r.isCollection(e)?e:new r(e)}get excludeGroundSurface(){return this.analysis.excludeGroundSurface}set excludeGroundSurface(e){this.analysis.excludeGroundSurface=e}async start(){await super.start(),d.forEach(e=>{e.view===this.view&&e!==this&&e.clear()}),null!=this.analysisView&&(this.analysisView.active=!0)}enterExcludeLayerMode(){this.tool?.start("exclude")}exitExcludeLayerMode(){this.tool?.stop()}onConnectToAnalysisView(e){e.active=!0}constructAnalysis(){return new t}};e([l({type:t})],c.prototype,"analysis",void 0),e([l({readOnly:!0})],c.prototype,"state",null),e([l()],c.prototype,"shape",null),e([l()],c.prototype,"tiltEnabled",null),e([l()],c.prototype,"mode",null),e([l()],c.prototype,"excludedLayers",null),e([l({nonNullable:!0})],c.prototype,"excludeGroundSurface",null),c=e([a("esri.widgets.Slice.SliceViewModel")],c);const u=c;export{u as default};