UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 1.54 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{getJsonType as s}from"../../geometry/support/jsonUtils.js";import{geometryTypes as i}from"../../geometry/support/typeUtils.js";import{geometryOperationLengthUnitKebabDict as p}from"./geometryOperationLengthUnit.js";let n=class extends e{constructor(t){super(t),this.geometry1=null,this.geometry2=null,this.distanceUnit=null,this.geodesic=null}toJSON(){const t={},e=this.geometry1;e&&(t.geometry1=JSON.stringify({geometryType:s(e),geometry:e}),t.sr=JSON.stringify(this.geometry1.spatialReference.toJSON()));const o=this.geometry2;return o&&(t.geometry2=JSON.stringify({geometryType:s(o),geometry:o})),this.distanceUnit&&(t.distanceUnit=p.toJSON(this.distanceUnit)),this.geodesic&&(t.geodesic=this.geodesic),t}};t([o({types:i,json:{write:!0}})],n.prototype,"geometry1",void 0),t([o({types:i,json:{write:!0}})],n.prototype,"geometry2",void 0),t([o({type:String,json:{write:!0}})],n.prototype,"distanceUnit",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"geodesic",void 0),n=t([r("esri.rest.support.DistanceParameters")],n);const m=n;export{m as default};