@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 7.5 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Clonable.js";import r from"../../core/Collection.js";import o from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import{ensureClass as n}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../../core/accessorSupport/decorators/writer.js";import a from"../../geometry/SpatialReference.js";import{apiKey as y}from"./commonProperties.js";import{impedanceAttributeNameJsonMap as c,restrictionAttributeNameJsonMap as m,directionsLengthUnitJsonMap as d,directionsOutputTypeJsonMap as v,directionsStyleNameJsonMap as w,durationImpedanceAttributeNameJsonMap as h,lengthUnitJsonMap as j,outputLineJsonMap as f,restrictUTurnJsonMap as b,timeOfDayUsageJsonMap as B,travelDirectionJsonMap as g}from"./networkEnums.js";import A from"./TravelMode.js";var P;function T(t,e,o){null!=t&&(e[o]=r.isCollection(t)?{features:t.toArray().map((t=>t.toJSON()))}:t.toJSON())}let O=P=class extends(e.ClonableMixin(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 n(P,t)}readAccumulateAttributes(t){return null==t?null:t.map((t=>c.fromJSON(t)))}writeAccumulateAttributes(t,e,r){t?.length&&(e[r]=t.map((t=>c.toJSON(t))))}writeFacilities(t,e,r){T(t,e,r)}writeIncidents(t,e,r){T(t,e,r)}writePointBarriers(t,e,r){T(t,e,r)}writePolygonBarrier(t,e,r){T(t,e,r)}writePolylineBarrier(t,e,r){T(t,e,r)}readRestrictionAttributes(t){return null==t?null:t.map((t=>m.fromJSON(t)))}writeRestrictionAttributes(t,e,r){t?.length&&(e[r]=t.map((t=>m.toJSON(t))))}readTimeOfDay(t,e){const{timeOfDay:r}=e;return null==r?null:"now"===r?"now":new Date(r)}writeTimeOfDay(t,e){null!=t&&(e.timeOfDay="now"===t?"now":t.getTime())}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],O.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],O.prototype,"readAccumulateAttributes",null),t([u("accumulateAttributes")],O.prototype,"writeAccumulateAttributes",null),t([i(y)],O.prototype,"apiKey",void 0),t([i({json:{write:!0}})],O.prototype,"attributeParameterValues",void 0),t([i({type:Number,json:{write:!0}})],O.prototype,"defaultCutoff",void 0),t([i({type:Number,json:{write:!0}})],O.prototype,"defaultTargetFacilityCount",void 0),t([i({type:String,json:{write:!0}})],O.prototype,"directionsLanguage",void 0),t([s(d)],O.prototype,"directionsLengthUnits",void 0),t([s(v)],O.prototype,"directionsOutputType",void 0),t([s(w)],O.prototype,"directionsStyleName",void 0),t([s(h,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],O.prototype,"directionsTimeAttribute",void 0),t([i({json:{write:!0}})],O.prototype,"facilities",void 0),t([u("facilities")],O.prototype,"writeFacilities",null),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([s(c,{name:"impedanceAttributeName",ignoreUnknown:!1})],O.prototype,"impedanceAttribute",void 0),t([i({json:{write:!0}})],O.prototype,"incidents",void 0),t([u("incidents")],O.prototype,"writeIncidents",null),t([i({type:Number,json:{write:!0}})],O.prototype,"outputGeometryPrecision",void 0),t([s(j)],O.prototype,"outputGeometryPrecisionUnits",void 0),t([s(f)],O.prototype,"outputLines",void 0),t([i({type:a,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([u("pointBarriers")],O.prototype,"writePointBarriers",null),t([i({json:{write:!0}})],O.prototype,"polygonBarriers",void 0),t([u("polygonBarriers")],O.prototype,"writePolygonBarrier",null),t([i({json:{write:!0}})],O.prototype,"polylineBarriers",void 0),t([u("polylineBarriers")],O.prototype,"writePolylineBarrier",null),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([p("restrictionAttributes")],O.prototype,"readRestrictionAttributes",null),t([u("restrictionAttributes")],O.prototype,"writeRestrictionAttributes",null),t([s(b)],O.prototype,"restrictUTurns",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnDirections",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnFacilities",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnIncidents",void 0),t([i({type:Boolean,json:{name:"returnBarriers",write:!0}})],O.prototype,"returnPointBarriers",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:{name:"returnCFRoutes",write:!0}})],O.prototype,"returnRoutes",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,"timeOfDay",void 0),t([p("timeOfDay")],O.prototype,"readTimeOfDay",null),t([u("timeOfDay")],O.prototype,"writeTimeOfDay",null),t([i({type:Boolean,json:{write:!0}})],O.prototype,"timeOfDayIsUTC",void 0),t([s(B)],O.prototype,"timeOfDayUsage",void 0),t([s(g)],O.prototype,"travelDirection",void 0),t([i({type:A,json:{write:!0}})],O.prototype,"travelMode",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"useHierarchy",void 0),O=P=t([l("esri.rest.support.ClosestFacilityParameters")],O);const S=O;export{S as default};