UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 6.69 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import o from"../../core/Collection.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import{ensureClass as s}from"../../core/accessorSupport/ensureType.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{enumeration as l}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../core/accessorSupport/decorators/reader.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import u from"../../geometry/SpatialReference.js";import{apiKey as y}from"./commonProperties.js";import{impedanceAttributeNameJsonMap as c,restrictionAttributeNameJsonMap as m,lengthUnitJsonMap as d,outputLineJsonMap as v,outputPolygonJsonMap as w,restrictUTurnJsonMap as j,travelDirectionJsonMap as h}from"./networkEnums.js";import g from"./TravelMode.js";var B;let P=class extends(e(r)){static{B=this}constructor(t){super(t),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.defaultBreaks=null,this.excludeSourcesFromPolygons=null,this.facilities=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.mergeSimilarPolygonRanges=!1,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines=null,this.outputPolygons=null,this.outSpatialReference=null,this.overlapLines=!1,this.overlapPolygons=!1,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnFacilities=!1,this.returnPointBarriers=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.splitLinesAtBreaks=!1,this.splitPolygonsAtBreaks=!1,this.timeOfDay=null,this.timeOfDayIsUTC=null,this.travelDirection=null,this.travelMode=null,this.trimOuterPolygon=!1,this.trimPolygonDistance=null,this.trimPolygonDistanceUnits=null,this.useHierarchy=null}static from(t){return s(B,t)}readAccumulateAttributes(t){return null==t?null:t.map(t=>c.fromJSON(t))}writeAccumulateAttributes(t,e,o){t?.length&&(e[o]=t.map(t=>c.toJSON(t)))}writeFacilities(t,e,o){b(t,e,o)}writePointBarriers(t,e,o){b(t,e,o)}writePolygonBarrier(t,e,o){b(t,e,o)}writePolylineBarrier(t,e,o){b(t,e,o)}readRestrictionAttributes(t){return null==t?null:t.map(t=>m.fromJSON(t))}writeRestrictionAttributes(t,e,o){t?.length&&(e[o]=t.map(t=>m.toJSON(t)))}readTimeOfDay(t,e){const{timeOfDay:o}=e;return null==o?null:"now"===o?"now":new Date(o)}writeTimeOfDay(t,e){null!=t&&(e.timeOfDay="now"===t?"now":t.getTime())}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],P.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],P.prototype,"readAccumulateAttributes",null),t([a("accumulateAttributes")],P.prototype,"writeAccumulateAttributes",null),t([i(y)],P.prototype,"apiKey",void 0),t([i({json:{write:!0}})],P.prototype,"attributeParameterValues",void 0),t([i({type:[Number],json:{write:!0}})],P.prototype,"defaultBreaks",void 0),t([i({type:[String],json:{write:!0}})],P.prototype,"excludeSourcesFromPolygons",void 0),t([i({json:{write:!0}})],P.prototype,"facilities",void 0),t([a("facilities")],P.prototype,"writeFacilities",null),t([i({type:Number,json:{write:!0}})],P.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],P.prototype,"geometryPrecisionM",void 0),t([i({type:Number,json:{write:!0}})],P.prototype,"geometryPrecisionZ",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"ignoreInvalidLocations",void 0),t([l(c,{name:"impedanceAttributeName",ignoreUnknown:!1})],P.prototype,"impedanceAttribute",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"mergeSimilarPolygonRanges",void 0),t([i({type:Number,json:{write:!0}})],P.prototype,"outputGeometryPrecision",void 0),t([l(d)],P.prototype,"outputGeometryPrecisionUnits",void 0),t([l(v)],P.prototype,"outputLines",void 0),t([l(w)],P.prototype,"outputPolygons",void 0),t([i({type:u,json:{name:"outSR",write:!0}})],P.prototype,"outSpatialReference",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"overlapLines",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"overlapPolygons",void 0),t([i({json:{write:!0}})],P.prototype,"overrides",void 0),t([i({json:{name:"barriers",write:!0}})],P.prototype,"pointBarriers",void 0),t([a("pointBarriers")],P.prototype,"writePointBarriers",null),t([i({json:{write:!0}})],P.prototype,"polygonBarriers",void 0),t([a("polygonBarriers")],P.prototype,"writePolygonBarrier",null),t([i({json:{write:!0}})],P.prototype,"polylineBarriers",void 0),t([a("polylineBarriers")],P.prototype,"writePolylineBarrier",null),t([i({type:Boolean,json:{write:!0}})],P.prototype,"preserveObjectID",void 0),t([i({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],P.prototype,"restrictionAttributes",void 0),t([p("restrictionAttributes")],P.prototype,"readRestrictionAttributes",null),t([a("restrictionAttributes")],P.prototype,"writeRestrictionAttributes",null),t([l(j)],P.prototype,"restrictUTurns",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"returnFacilities",void 0),t([i({type:Boolean,json:{name:"returnBarriers",write:!0}})],P.prototype,"returnPointBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"returnPolygonBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"returnPolylineBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"splitLinesAtBreaks",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"splitPolygonsAtBreaks",void 0),t([i({json:{write:!0}})],P.prototype,"timeOfDay",void 0),t([p("timeOfDay")],P.prototype,"readTimeOfDay",null),t([a("timeOfDay")],P.prototype,"writeTimeOfDay",null),t([i({type:Boolean,json:{write:!0}})],P.prototype,"timeOfDayIsUTC",void 0),t([l(h)],P.prototype,"travelDirection",void 0),t([i({type:g,json:{write:!0}})],P.prototype,"travelMode",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"trimOuterPolygon",void 0),t([i({type:Number,json:{write:!0}})],P.prototype,"trimPolygonDistance",void 0),t([l(d)],P.prototype,"trimPolygonDistanceUnits",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,"useHierarchy",void 0),P=B=t([n("esri.rest.support.ServiceAreaParameters")],P);const f=P;function b(t,e,r){null!=t&&(e[r]=o.isCollection(t)?{features:t.toArray().map(t=>t.toJSON())}:t.toJSON())}export{f as default};