@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 7.45 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 n}from"../../core/maybe.js";import{property as s}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 u}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as y}from"../../core/accessorSupport/decorators/writer.js";import{apiKey as c}from"./commonProperties.js";import{impedanceAttributeNameJsonMap as m,restrictionAttributeNameJsonMap as d,directionsLengthUnitJsonMap as v,directionsOutputTypeJsonMap as w,directionsStyleNameJsonMap as j,durationImpedanceAttributeNameJsonMap as h,lengthUnitJsonMap as f,outputLineJsonMap as b,restrictUTurnJsonMap as g,timeOfDayUsageJsonMap as B,travelDirectionJsonMap as A}from"./networkEnums.js";import P from"./TravelMode.js";import T from"../../geometry/SpatialReference.js";var O;function S(t,e,o){n(t)&&(e[o]=r.isCollection(t)?{features:t.toArray().map((t=>t.toJSON()))}:t.toJSON())}let D=O=class extends(e(o)){constructor(t){super(t),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.defaultCutoff=null,this.defaultTargetFacilityCount=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.facilities=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.incidents=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines=null,this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnDirections=!1,this.returnFacilities=!1,this.returnIncidents=!1,this.returnPointBarriers=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=null,this.timeOfDay=null,this.timeOfDayIsUTC=null,this.timeOfDayUsage=null,this.travelDirection=null,this.travelMode=null,this.useHierarchy=!1}static from(t){return p(O,t)}readAccumulateAttributes(t){return i(t)?null:t.map((t=>m.fromJSON(t)))}writeAccumulateAttributes(t,e,r){!i(t)&&t.length&&(e[r]=t.map((t=>m.toJSON(t))))}writeFacilities(t,e,r){S(t,e,r)}writeIncidents(t,e,r){S(t,e,r)}writePointBarriers(t,e,r){S(t,e,r)}writePolygonBarrier(t,e,r){S(t,e,r)}writePolylineBarrier(t,e,r){S(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([s({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],D.prototype,"accumulateAttributes",void 0),t([u("accumulateAttributes")],D.prototype,"readAccumulateAttributes",null),t([y("accumulateAttributes")],D.prototype,"writeAccumulateAttributes",null),t([s(c)],D.prototype,"apiKey",void 0),t([s({json:{write:!0}})],D.prototype,"attributeParameterValues",void 0),t([s({type:Number,json:{write:!0}})],D.prototype,"defaultCutoff",void 0),t([s({type:Number,json:{write:!0}})],D.prototype,"defaultTargetFacilityCount",void 0),t([s({type:String,json:{write:!0}})],D.prototype,"directionsLanguage",void 0),t([l(v)],D.prototype,"directionsLengthUnits",void 0),t([l(w)],D.prototype,"directionsOutputType",void 0),t([l(j)],D.prototype,"directionsStyleName",void 0),t([l(h,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],D.prototype,"directionsTimeAttribute",void 0),t([s({json:{write:!0}})],D.prototype,"facilities",void 0),t([y("facilities")],D.prototype,"writeFacilities",null),t([s({type:Number,json:{write:!0}})],D.prototype,"geometryPrecision",void 0),t([s({type:Number,json:{write:!0}})],D.prototype,"geometryPrecisionM",void 0),t([s({type:Number,json:{write:!0}})],D.prototype,"geometryPrecisionZ",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"ignoreInvalidLocations",void 0),t([l(m,{name:"impedanceAttributeName",ignoreUnknown:!1})],D.prototype,"impedanceAttribute",void 0),t([s({json:{write:!0}})],D.prototype,"incidents",void 0),t([y("incidents")],D.prototype,"writeIncidents",null),t([s({type:Number,json:{write:!0}})],D.prototype,"outputGeometryPrecision",void 0),t([l(f)],D.prototype,"outputGeometryPrecisionUnits",void 0),t([l(b)],D.prototype,"outputLines",void 0),t([s({type:T,json:{name:"outSR",write:!0}})],D.prototype,"outSpatialReference",void 0),t([s({json:{write:!0}})],D.prototype,"overrides",void 0),t([s({json:{name:"barriers",write:!0}})],D.prototype,"pointBarriers",void 0),t([y("pointBarriers")],D.prototype,"writePointBarriers",null),t([s({json:{write:!0}})],D.prototype,"polygonBarriers",void 0),t([y("polygonBarriers")],D.prototype,"writePolygonBarrier",null),t([s({json:{write:!0}})],D.prototype,"polylineBarriers",void 0),t([y("polylineBarriers")],D.prototype,"writePolylineBarrier",null),t([s({type:Boolean,json:{write:!0}})],D.prototype,"preserveObjectID",void 0),t([s({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],D.prototype,"restrictionAttributes",void 0),t([u("restrictionAttributes")],D.prototype,"readRestrictionAttributes",null),t([y("restrictionAttributes")],D.prototype,"writeRestrictionAttributes",null),t([l(g)],D.prototype,"restrictUTurns",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"returnDirections",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"returnFacilities",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"returnIncidents",void 0),t([s({type:Boolean,json:{name:"returnBarriers",write:!0}})],D.prototype,"returnPointBarriers",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"returnPolygonBarriers",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"returnPolylineBarriers",void 0),t([s({type:Boolean,json:{name:"returnCFRoutes",write:!0}})],D.prototype,"returnRoutes",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"returnTraversedEdges",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"returnTraversedJunctions",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"returnTraversedTurns",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"returnZ",void 0),t([s({type:Date,json:{type:Number,write:!0}})],D.prototype,"timeOfDay",void 0),t([u("timeOfDay")],D.prototype,"readTimeOfDay",null),t([y("timeOfDay")],D.prototype,"writeTimeOfDay",null),t([s({type:Boolean,json:{write:!0}})],D.prototype,"timeOfDayIsUTC",void 0),t([l(B)],D.prototype,"timeOfDayUsage",void 0),t([l(A)],D.prototype,"travelDirection",void 0),t([s({type:P,json:{write:!0}})],D.prototype,"travelMode",void 0),t([s({type:Boolean,json:{write:!0}})],D.prototype,"useHierarchy",void 0),D=O=t([a("esri.rest.support.ClosestFacilityParameters")],D);const N=D;export{N as default};