UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 4.34 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ function e(e){switch(e){case 1:return"Unknown error";case 2:return"Corrupted geometry";case 3:return"Empty geometry";case 4:return"Math singularity";case 5:return"Buffer is too small";case 6:return"Invalid shape type";case 7:return"Projection out of supported range";case 8:return"Non simple geometry";case 9:return"Cannot calculate geodesic";case 10:return"Notation conversion";case 11:return"Missing grid file";case 12:return"Invalid call";case 13:return"Internal error";case 14:return"Not implemented";case 15:return"IO error";case 16:return"Invalid 3D";case 17:return"An ambiguous geography edge with antipodal points";case 18:return"Geocentric coordinates require ellipsoidal height";case 19:return"Geography cannot be projected into a gnomonic plane or a result of an operation cannot fit into a gnomonic plane";case 20:return"Geometry is too large to be exported in to a given format";case 22:return"Operation is canceled by the user";case 21:return"The operation, such as projection or geodetic computation, cannot be performed without pe-wasm loaded";default:return"unknown error"}}function n(e,n){try{if(!e)throw new Error(n)}catch(t){throw t}}class t extends Error{constructor(e,n){super(n),this.m_AdditionalMessage=n,this.m_ErrorType=e,this.name="GeometryError"}what(){return e(this.m_ErrorType)}additionalMessage(){return this.m_AdditionalMessage?this.m_AdditionalMessage:""}code(){return this.m_ErrorType}}class r extends t{constructor(e){super(2,e),this.name="CorruptedGeometryError"}}class o extends t{constructor(e){super(3,e),this.name="EmptyGeometryError"}}class i extends t{constructor(e){super(4,e),this.name="MathSingularityError"}}class u extends t{constructor(e){super(21,e),this.name="ProjectionEngineNotLoadedError"}}class s extends t{constructor(e){super(8,e),this.name="NonSimpleGeometryError"}}var a;!function(e){e[e.enumUnknown=0]="enumUnknown",e[e.enumPoint=513]="enumPoint",e[e.enumLine=5122]="enumLine",e[e.enumBezier=5123]="enumBezier",e[e.enumEllipticArc=5124]="enumEllipticArc",e[e.enumEnvelope=3077]="enumEnvelope",e[e.enumMultiPoint=8710]="enumMultiPoint",e[e.enumPolyline=25607]="enumPolyline",e[e.enumPolygon=27656]="enumPolygon",e[e.enumMultipatch=40969]="enumMultipatch",e[e.enumGeometryCollection=3594]="enumGeometryCollection",e[e.enumRationalBezier2=5134]="enumRationalBezier2",e[e.enumBezier2=5135]="enumBezier2",e[e.enumRationalBezier23d=5392]="enumRationalBezier23d",e[e.enumGreatArc3d=5393]="enumGreatArc3d"}(a||(a={}));const c=[0,0,1,1,1,2,0,1,2,3,-1,-1,-1,-1,1,1];function m(e){return c[15&e]}function l(e){return!!(512&e)}function p(e){return!!(1024&e)}function d(e){return!!(2048&e)}function f(e){return!!(4096&e)}function y(e){return!!(8192&e)}function h(e){return!!(16384&e)}function g(e){return!!(32768&e)}function w(e){const n=e.getGeometryType();return y(n)?e.getPointCount():e.isEmpty()?0:n===a.enumEnvelope?4:n===a.enumPoint?1:f(n)?2:void b("missing type")}function E(e){const n=e.getGeometryType();if(h(n))return e.hasNonLinearSegments();if(n===a.enumGeometryCollection){const n=e;for(let e=0,t=n.getGeometryCount();e<t;e++)if(E(n.getGeometry(e)))return!0;return!1}return!!f(n)&&n!==a.enumLine}function G(e){throw new u(e)}function v(e){throw new r(e)}function P(e){throw new Error(e)}function M(e){throw new i(e)}function B(){P("Geometry type is not supported for 3D operations.")}function C(e){throw new t(12,e)}function x(e){throw new o(e)}function z(e){throw new t(14,e)}function A(e){throw new Error(e)}function b(e){throw new t(13,e)}function T(e){throw new Error(e)}function k(e){throw new s(e)}function _(){z("Operation does not support curves.")}function N(e){e&&E(e)&&_()}function j(e){e&&g(e.getGeometryType())&&z("Unsupported geometry type.")}function I(e){e===a.enumGeometryCollection&&P("Geometry_collection instances are not supported in this operation")}function L(e){I(e.getGeometryType())}function R(e){P(`bad wkid: ${e}`)}function U(e){let n="bad wkt: ";n+=e,n+="...",P(n)}function D(e,n){e||P(n)}export{m as A,L as B,I as C,k as D,a as G,M as a,z as b,b as c,j as d,l as e,f,n as g,h,y as i,E as j,v as k,N as l,C as m,A as n,g as o,d as p,p as q,G as r,T as s,P as t,x as u,w as v,D as w,B as x,R as y,U as z};