Files
ADHA_mobile_project/assets/geometryServiceUtils-832d4a54.js
2024-02-28 17:06:42 +05:00

2 lines
744 B
JavaScript

import{ay as s,s as l,j as c,p as g,n as u}from"./index-b5c8f851.js";async function y(e=null,o){var a,r;if(s.geometryServiceUrl)return s.geometryServiceUrl;if(!e)throw new l("internal:geometry-service-url-not-configured");let t;t="portal"in e?e.portal||c.getDefault():e,await t.load({signal:o});const n=(r=(a=t.helperServices)==null?void 0:a.geometry)==null?void 0:r.url;if(!n)throw new l("internal:geometry-service-url-not-configured");return n}async function m(e,o,t=null,n){const a=await y(t,n),r=new g;r.geometries=[e],r.outSpatialReference=o;const i=await u(a,r,{signal:n});if(i&&Array.isArray(i)&&i.length===1)return i[0];throw new l("internal:geometry-service-projection-failed")}export{y as getGeometryServiceURL,m as projectGeometry};