UNPKG

@doegis/core

Version:

DOE GIS API

3 lines (1 loc) 7.69 kB
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 u}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as l}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 m}from"./commonProperties.js";import c from"./DataLayer.js";import d from"./FeatureSet.js";import{impedanceAttributeNameJsonMap as v,restrictionAttributeNameJsonMap as w,directionsLengthUnitJsonMap as j,directionsOutputTypeJsonMap as h,directionsStyleNameJsonMap as S,durationImpedanceAttributeNameJsonMap as B,lengthUnitJsonMap as f,outputLineJsonMap as b,restrictUTurnJsonMap as T}from"./networkEnums.js";import g from"./NetworkFeatureSet.js";import A from"./NetworkUrl.js";import N from"./TravelMode.js";import P from"../../geometry/SpatialReference.js";var O;function U(t){return t&&"type"in t}function J(t){return t&&"features"in t&&"doNotLocateOnRestrictedElements"in t}function L(t){return t&&"url"in t}function R(t){return t&&"features"in t}function C(t){return U(t)?c.fromJSON(t):L(t)?A.fromJSON(t):J(t)?g.fromJSON(t):R(t)?d.fromJSON(t):null}function D(t,e,o){s(t)&&(e[o]=r.isCollection(t)?{features:t.toArray().map((t=>t.toJSON()))}:t.toJSON())}let k=O=class extends(e(o)){constructor(t){super(t),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(t){return p(O,t)}readAccumulateAttributes(t){return i(t)?null:t.map((t=>v.fromJSON(t)))}writeAccumulateAttributes(t,e,r){!i(t)&&t.length&&(e[r]=t.map((t=>v.toJSON(t))))}writePointBarriers(t,e,r){D(t,e,r)}writePolygonBarrier(t,e,r){D(t,e,r)}writePolylineBarrier(t,e,r){D(t,e,r)}readRestrictionAttributes(t){return i(t)?null:t.map((t=>w.fromJSON(t)))}writeRestrictionAttributes(t,e,r){!i(t)&&t.length&&(e[r]=t.map((t=>w.toJSON(t))))}readStartTime(t,e){const{startTime:r}=e;return i(r)?null:"now"===r?"now":new Date(r)}writeStartTime(t,e){i(t)||(e.startTime="now"===t?"now":t.getTime())}readStops(t,e){return C(e.stops)}writeStops(t,e,r){D(t,e,r)}};t([n({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],k.prototype,"accumulateAttributes",void 0),t([l("accumulateAttributes")],k.prototype,"readAccumulateAttributes",null),t([y("accumulateAttributes")],k.prototype,"writeAccumulateAttributes",null),t([n(m)],k.prototype,"apiKey",void 0),t([n({json:{write:!0}})],k.prototype,"attributeParameterValues",void 0),t([n({type:String,json:{write:!0}})],k.prototype,"directionsLanguage",void 0),t([u(j)],k.prototype,"directionsLengthUnits",void 0),t([u(h)],k.prototype,"directionsOutputType",void 0),t([u(S)],k.prototype,"directionsStyleName",void 0),t([u(B,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],k.prototype,"directionsTimeAttribute",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"findBestSequence",void 0),t([n({type:Number,json:{write:!0}})],k.prototype,"geometryPrecision",void 0),t([n({type:Number,json:{write:!0}})],k.prototype,"geometryPrecisionM",void 0),t([n({type:Number,json:{write:!0}})],k.prototype,"geometryPrecisionZ",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"ignoreInvalidLocations",void 0),t([u(v,{name:"impedanceAttributeName",ignoreUnknown:!1})],k.prototype,"impedanceAttribute",void 0),t([n({type:Number,json:{write:!0}})],k.prototype,"outputGeometryPrecision",void 0),t([u(f)],k.prototype,"outputGeometryPrecisionUnits",void 0),t([u(b)],k.prototype,"outputLines",void 0),t([n({type:P,json:{name:"outSR",write:!0}})],k.prototype,"outSpatialReference",void 0),t([n({json:{write:!0}})],k.prototype,"overrides",void 0),t([n({json:{name:"barriers",write:!0}})],k.prototype,"pointBarriers",void 0),t([y("pointBarriers")],k.prototype,"writePointBarriers",null),t([n({json:{write:!0}})],k.prototype,"polygonBarriers",void 0),t([y("polygonBarriers")],k.prototype,"writePolygonBarrier",null),t([n({json:{write:!0}})],k.prototype,"polylineBarriers",void 0),t([y("polylineBarriers")],k.prototype,"writePolylineBarrier",null),t([n({type:Boolean,json:{write:!0}})],k.prototype,"preserveFirstStop",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"preserveLastStop",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"preserveObjectID",void 0),t([n({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],k.prototype,"restrictionAttributes",void 0),t([l("restrictionAttributes")],k.prototype,"readRestrictionAttributes",null),t([y("restrictionAttributes")],k.prototype,"writeRestrictionAttributes",null),t([u(T)],k.prototype,"restrictUTurns",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"returnBarriers",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"returnDirections",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"returnPolygonBarriers",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"returnPolylineBarriers",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"returnRoutes",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"returnStops",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"returnTraversedEdges",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"returnTraversedJunctions",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"returnTraversedTurns",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"returnZ",void 0),t([n({type:Date,json:{type:Number,write:!0}})],k.prototype,"startTime",void 0),t([l("startTime")],k.prototype,"readStartTime",null),t([y("startTime")],k.prototype,"writeStartTime",null),t([n({type:Boolean,json:{write:!0}})],k.prototype,"startTimeIsUTC",void 0),t([n({json:{write:!0}})],k.prototype,"stops",void 0),t([l("stops")],k.prototype,"readStops",null),t([y("stops")],k.prototype,"writeStops",null),t([n({type:Boolean,json:{write:!0}})],k.prototype,"timeWindowsAreUTC",void 0),t([n({type:N,json:{write:!0}})],k.prototype,"travelMode",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"useHierarchy",void 0),t([n({type:Boolean,json:{write:!0}})],k.prototype,"useTimeWindows",void 0),k=O=t([a("esri.rest.support.RouteParameters")],k);const I=k;export{I as default};