@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 1.39 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{getJsonType as i}from"../../geometry/support/jsonTypeUtils.js";import{geometryTypes as r}from"../../geometry/support/typeUtils.js";import{geometryOperationLengthUnitKebabDict as n}from"./geometryOperationLengthUnit.js";let g=class extends t{constructor(e){super(e),this.geometries=null,this.geodesic=null,this.lengthUnit=null,this.maxSegmentLength=null}toJSON(){const e={};if(this.geometries&&this.geometries.length>0){const t=this.geometries.map(e=>e.toJSON());e.geometries=JSON.stringify({geometryType:i(this.geometries[0]),geometries:t}),e.sr=JSON.stringify(this.geometries[0].spatialReference.toJSON())}return this.geodesic&&(e.geodesic=this.geodesic),this.lengthUnit&&(e.lengthUnit=n.toJSON(this.lengthUnit)),this.maxSegmentLength&&(e.maxSegmentLength=this.maxSegmentLength),e}};e([o({types:[r],json:{write:!0}})],g.prototype,"geometries",void 0),e([o({type:Boolean,json:{write:!0}})],g.prototype,"geodesic",void 0),e([o({type:String,json:{write:!0}})],g.prototype,"lengthUnit",void 0),e([o({type:Number,json:{write:!0}})],g.prototype,"maxSegmentLength",void 0),g=e([s("esri.rest.support.DensifyParameters")],g);const m=g;export{m as default};