UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.26 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/SliceAnalysis.js";import t from"../../core/Collection.js";import{deprecateUnnecessaryViewModel as r}from"../../core/deprecate.js";import o from"../../core/Logger.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{AnalysisViewModel as a}from"../support/AnalysisViewModel.js";const n=new Set;let d=class extends a{constructor(e){super(e),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="SliceViewModel is only supported in 3D views.",e?.isDefaultViewModel||r(o.getLogger(this),"Slice","arcgis-slice",{version:"4.33"}),n.add(this)}destroy(){n.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=t.isCollection(e)?e:new t(e)}get excludeGroundSurface(){return this.analysis.excludeGroundSurface}set excludeGroundSurface(e){this.analysis.excludeGroundSurface=e}async start(){await super.start(),n.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 s}};e([i({type:s})],d.prototype,"analysis",void 0),e([i({readOnly:!0})],d.prototype,"state",null),e([i()],d.prototype,"shape",null),e([i()],d.prototype,"tiltEnabled",null),e([i()],d.prototype,"mode",null),e([i()],d.prototype,"excludedLayers",null),e([i({nonNullable:!0})],d.prototype,"excludeGroundSurface",null),d=e([l("esri.widgets.Slice.SliceViewModel")],d);const c=d;export{c as default};