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 o from"../../Color.js";import{handlesGroup as r}from"../../core/handleUtils.js";import{isSome as t,applySome as n,unwrapOr as i,isNone as s}from"../../core/maybe.js";import{memoize as a}from"../../core/memoize.js";import{watch as l}from"../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as u}from"../../core/unitUtils.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 m from"./ElevationProfileLine.js";import{getGroundMinDemResolution as d}from"./support/elevationQuerySourceUtils.js";let y=class extends m{constructor(e){super(e),this.type="ground",this.color=new o("#ff7f00"),this.viewVisualizationEnabled=!0,this.numSamplesForPreview=50,this.numSamplesPerChunk=1e3,this._getQueryElevationDependencies=a(((e,o)=>({ground:e,groundLayers:o})))}get available(){const e=this._ground;return t(e)&&e.layers.some((e=>e.visible))}get minDemResolution(){return d(this._ground)}get _queryElevationDependencies(){return this._getQueryElevationDependencies(this._ground,this._groundLayers)}get _ground(){return n(this._viewModel?.view,(e=>e.map?.ground))}get _groundLayers(){const e=this._ground,o=n(e,(e=>e.layers?.toArray()));return i(o,[])}async queryElevation(e,o){const r=this._queryElevationDependencies;if(s(r))throw new Error("ElevationProfileLineGround: no dependencies");const{ground:t}=r;if(s(t))throw new Error("No ground configured in the view");const n=await t.queryElevation(e,o),i=u(e.spatialReference),a=u(t.layers.getItemAt(0).spatialReference);if(i!==a){const e=n.geometry;e.points=e.points.map((([e,r,t])=>[e,r,t===o.noDataValue?t:t*a/i]))}return n}attach(e){return r([super.attach(e),l((()=>this._queryElevationDependencies),(()=>this._onChange()))])}};e([p({type:o,nonNullable:!0})],y.prototype,"color",void 0),e([p()],y.prototype,"viewVisualizationEnabled",void 0),e([p()],y.prototype,"available",null),e([p({readOnly:!0})],y.prototype,"minDemResolution",null),e([p()],y.prototype,"_queryElevationDependencies",null),e([p()],y.prototype,"_ground",null),e([p()],y.prototype,"_groundLayers",null),y=e([c("esri.widgets.ElevationProfile.ElevationProfileLineGround")],y);const g=y;export{g as default};
|