/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import e from"../Extent.js";import{getExtentForScale as t}from"./scaleUtils.js";async function n(e,t){if(e.hasZ||"2d"===t.type)return e;const n=t.map?.ground;return n?.layers.length?(await n.queryElevation(e,{cache:t.basemapTerrain?.elevationQueryCache})).geometry:e}function r(e,t,n){return a(e.center,t,n)}function a(n,r,a){const i=n.hasZ?n.z:void 0;if(r?.map){return(null!=a?t(r,a):r.extent).clone().centerAt(n).set({zmax:i,zmin:i})}const{x:o,y:c,spatialReference:s}=n;return new e({xmin:o-.25,ymin:c-.25,xmax:o+.25,ymax:c+.25,spatialReference:s,zmin:i,zmax:i})}function i(e,t,n,r){switch(e?.type){case"extent":return e;case"polygon":case"polyline":case"multipoint":return e.extent??void 0;case"point":return a(r.execute(e),t??void 0,n??void 0);default:return}}export{a as createExtentFromPoint,i as getExtentFromGeometry,n as getPointWithElevation,r as scaleExtent};
