UNPKG

@doegis/core

Version:

DOE GIS API

3 lines (1 loc) 1.55 kB
import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as t}from"../../geometry.js";import{JSONMap as s}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{getJsonType as n}from"../../geometry/support/jsonUtils.js";const m=new s({9001:"meters",9002:"feet",9036:"kilometers",9093:"miles",109012:"nautical-miles",109001:"yards"});let p=class extends o{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:n(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=m.toJSON(this.lengthUnit)),this.maxSegmentLength&&(e.maxSegmentLength=this.maxSegmentLength),e}};e([r({types:[t],json:{write:!0}})],p.prototype,"geometries",void 0),e([r({type:Boolean,json:{write:!0}})],p.prototype,"geodesic",void 0),e([r({type:String,json:{write:!0}})],p.prototype,"lengthUnit",void 0),e([r({type:Number,json:{write:!0}})],p.prototype,"maxSegmentLength",void 0),p=e([i("esri.rest.support.DensifyParameters")],p);const g=p;export{g as default};