UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.33 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{isSome as e}from"../core/arrayUtils.js";import{convertUnit as t}from"../core/unitUtils.js";import{load as r,isLoaded as o,supportsCurves as s,execute as a,executeMany as i}from"../geometry/operators/gx/operatorGeodesicBuffer.js";import{geodeticCurveType as n}from"../geometry/operators/support/geodeticCurveType.js";let p,u,m,c,l;function f(){return!!p&&o()}async function y(){if(!f()){const[e]=await Promise.all([import("../geometry/operators/support/apiConverter.js"),r()]);p=e.fromGeometry,u=e.fromSpatialReference,m=e.getSpatialReference,c=e.toPolygon,l=s()}}function g(e,r,o={}){let{curveType:s="geodesic",maxDeviation:i=NaN,unit:l}=o;l&&(r=t(r,l,"meters"),i&&(i=t(i,l,"meters")));const f=m(e);return c(a(p(e),u(f),n[s],r,i),f)}function d(r,o,s={}){let{curveType:a="geodesic",maxDeviation:l=NaN,union:f=!1,unit:y}=s;y&&(o=o.map((e=>t(e,y,"meters"))),l&&(l=t(l,y,"meters")));const g=r.map(p),d=m(r);return i(g,u(d),n[a],o,l,f).map((e=>c(e,d))).filter(e)}const v=Object.freeze(Object.defineProperty({__proto__:null,execute:g,executeMany:d,isLoaded:f,load:y,get supportsCurves(){return l}},Symbol.toStringTag,{value:"Module"}));export{d as a,g as e,v as g,f as i,y as l,l as s};