12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.24/esri/copyright.txt for details.
- */
- import{isSome as e}from"../../core/maybe.js";import{createScreenPointArray as t}from"../../core/screenUtils.js";import{makeDehydratedPoint as i}from"../../layers/graphics/dehydratedFeatures.js";import{getConvertedElevation as s,getZForElevationMode as o}from"../../support/elevationInfoUtils.js";class r{constructor(e,t,i,s=null){this.elevationInfo=e,this.defaultZ=t,this.view=i,this.excludeGraphics=s}screenToMap(i){if(e(this.defaultZ))return this.view.sceneIntersectionHelper.intersectElevationFromScreen(t(i.x,i.y),this.elevationInfo,this.defaultZ,this.excludeGraphics);const s=this.view.sceneIntersectionHelper.intersectElevationFromScreen(t(i.x,i.y),this.elevationInfo,0,this.excludeGraphics);return e(s)&&(s.z=void 0),s}mapToScreen(e){const t=i(e.x,e.y,s(this.view,e,this.elevationInfo),e.spatialReference);return this.view.toScreen(t)}}class n{constructor(e,t,i=[]){this.view=e,this.elevationInfo=t,this.exclude=i}screenToMap(t){const i=this.view.toMap(t,{exclude:this.exclude});return e(i)&&(i.z=o(i,this.view,this.elevationInfo)),i}mapToScreen(t){let o=t;return e(this.elevationInfo)&&(o=i(t.x,t.y,s(this.view,t,this.elevationInfo),t.spatialReference)),this.view.toScreen(o)}}class c{constructor(e){this.view=e,this.screenToMap=t=>e.toMap(t),this.mapToScreen=t=>e.toScreen(t)}}export{r as ElevationDrawSurface,c as MapDrawSurface,n as SceneDrawSurface};
|