UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 919 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{isSome as t}from"../../../core/arrayUtils.js";import{convertToSpatialReferenceUnit as r}from"../../../core/unitUtils.js";import{execute as e,executeMany as o}from"../gx/operatorOffset.js";import{getSpatialReference as n,fromGeometry as i,toGeometry as s,fromGeometries as m}from"../support/jsonConverter.js";const u={round:0,bevel:1,miter:2,square:3};function a(t,o,m={}){const{miterLimit:a=10,flattenError:c=0,joins:f="round",unit:p}=m,j=n(t);p&&j&&(o=r(o,p,j));const l=i(t),x=l.getSpatialReference();return s(e(l.getGeometry(),x,o,u[f],a,c),x)}function c(e,i,a={}){const{miterLimit:c=10,flattenError:f=0,joins:p="round",unit:j}=a,l=n(e);j&&l&&(i=r(i,j,l));const[x,d]=m(e);return o(x,d,i,u[p],c,f).map((t=>s(t,d))).filter(t)}export{a as execute,c as executeMany};