UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 1.26 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as r}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as o,subclass as e}from"../../core/accessorSupport/decorators.js";import s from"../../geometry/SpatialReference.js";import{getJsonType as i}from"../../geometry/support/jsonTypeUtils.js";import{srToRESTValue as a}from"../../geometry/support/spatialReferenceUtils.js";let n=class extends t{constructor(r){super(r),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const r=this.geometries.map(r=>r.toJSON()),t=this.geometries[0],o={};return o.outSR=a(this.outSpatialReference),o.inSR=a(t.spatialReference),o.geometries=JSON.stringify({geometryType:i(t),geometries:r}),this.transformation&&(o.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),null!=this.transformForward&&(o.transformForward=this.transformForward),o}};r([o()],n.prototype,"geometries",void 0),r([o({type:s,json:{read:{source:"outSR"}}})],n.prototype,"outSpatialReference",void 0),r([o()],n.prototype,"transformation",void 0),r([o()],n.prototype,"transformForward",void 0),n=r([e("esri.rest.support.ProjectParameters")],n);export{n as default};