UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.17 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/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{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{AnalysisViewModel as l}from"../support/AnalysisViewModel.js";const a=new Set;let i=class extends l{constructor(e){super(e),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="SliceViewModel is only supported in 3D views.",a.add(this)}destroy(){a.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 layersMode(){return this.tool?.layersMode??"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(),a.forEach((e=>{e.view===this.view&&e!==this&&e.clear()})),null!=this.analysisView&&(this.analysisView.active=!0)}enterExcludeLayerMode(){null!=this.tool&&this.tool.enterExcludeLayerMode()}exitExcludeLayerMode(){null!=this.tool&&this.tool.exitExcludeLayerMode()}onConnectToAnalysisView(e){e.active=!0}constructAnalysis(){return new s}};e([o({type:s})],i.prototype,"analysis",void 0),e([o({readOnly:!0})],i.prototype,"state",null),e([o()],i.prototype,"shape",null),e([o()],i.prototype,"tiltEnabled",null),e([o()],i.prototype,"layersMode",null),e([o()],i.prototype,"excludedLayers",null),e([o({nonNullable:!0})],i.prototype,"excludeGroundSurface",null),i=e([r("esri.widgets.Slice.SliceViewModel")],i);const n=i;export{n as default};