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