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