UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 1.63 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 e}from"../../chunks/tslib.es6.js";import t from"../../core/JSONSupport.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 s}from"../../core/accessorSupport/decorators/subclass.js";import{getJsonType as r}from"../../geometry/support/jsonUtils.js";import{geometryTypes as i}from"../../geometry/support/typeUtils.js";import{geometryOperationLengthUnitKebabDict as n}from"./geometryOperationLengthUnit.js";let m=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:r(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:[i],json:{write:!0}})],m.prototype,"geometries",void 0),e([o({type:Boolean,json:{write:!0}})],m.prototype,"geodesic",void 0),e([o({type:String,json:{write:!0}})],m.prototype,"lengthUnit",void 0),e([o({type:Number,json:{write:!0}})],m.prototype,"maxSegmentLength",void 0),m=e([s("esri.rest.support.DensifyParameters")],m);const p=m;export{p as default};