12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Color.js";import{handlesGroup as o}from"../../core/handleUtils.js";import{isNone as r,applySome as i,unwrapOr as n}from"../../core/maybe.js";import{memoize as s}from"../../core/memoize.js";import{watch as a,on as l}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{GeometryDescriptor as u}from"../../layers/support/ElevationQuery.js";import{getGraphicEffectiveElevationInfo as v}from"../../support/elevationInfoUtils.js";import m from"./ElevationProfileLine.js";let y=class extends m{constructor(e){super(e),this.type="input",this.color=new t("#00c8c8"),this.viewVisualizationEnabled=!1,this.numSamplesForPreview=50,this.numSamplesPerChunk=500,this.chartFillEnabled=!1,this.chartStrokeOffsetY=-1,this._getQueryElevationDependencies=s(((e,t,o,r,n)=>i(e,(e=>({elevationInfo:e,visibleLayers:t,view:o,stationary:r,spatialReference:n})))))}get queryElevationDependencies(){const e=this._viewModel.view;return r(e)?null:this._getQueryElevationDependencies(this._elevationInfo,this._visibleLayers,e,e.stationary,e.spatialReference)}get available(){return!this._viewModel.inputIsSketched}get _elevationInfo(){return i(this._viewModel.input,v)}get _visibleLayers(){const e=this._viewModel?.view,t=i(e,(e=>e.map?.allLayers?.filter((e=>e.visible)).toArray()));return n(t,[])}async queryElevation(e,{noDataValue:t,signal:o}){const i=this.queryElevationDependencies;if(r(i))throw new Error("ElevationProfileLineInput: no dependencies");const{view:s,elevationInfo:a,spatialReference:l}=i;if("on-the-ground"===a.mode&&"3d"===s.type){const r=await u.fromGeometry(e).project(l,o),i=s.elevationProvider;return r.coordinates.forEach((e=>{e.z=n(i.getElevation(e.x,e.y,0,l,"ground"),0)})),{geometry:r.export(),noDataValue:t}}return{geometry:e,noDataValue:t}}attach(e){const t=()=>this._onChange();return o([super.attach(e),a((()=>this.queryElevationDependencies),t),l((()=>e.elevationProvider),"elevation-change",t,{onListenerAdd:t,onListenerRemove:t})])}};e([p({type:t,nonNullable:!0})],y.prototype,"color",void 0),e([p()],y.prototype,"viewVisualizationEnabled",void 0),e([p()],y.prototype,"queryElevationDependencies",null),e([p()],y.prototype,"available",null),e([p()],y.prototype,"_elevationInfo",null),e([p()],y.prototype,"_visibleLayers",null),y=e([c("esri.widgets.ElevationProfile.ElevationProfileLineInput")],y);const d=y;export{d as default};
|