@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 7.3 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 l}from"./commonProperties.js";import{impedanceAttributeNameJsonMap as u,restrictionAttributeNameJsonMap as a,directionsLengthUnitJsonMap as y,directionsOutputTypeJsonMap as c,directionsStyleNameJsonMap as m,durationImpedanceAttributeNameJsonMap as d,lengthUnitJsonMap as v,outputLineJsonMap as w,restrictUTurnJsonMap as h,timeOfDayUsageJsonMap as j,travelDirectionJsonMap as f}from"./networkEnums.js";import b from"./TravelMode.js";import{reader as B}from"../../core/accessorSupport/decorators/reader.js";import{writer as g}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as A}from"../../core/accessorSupport/decorators/enumeration.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=class extends(e(o)){static{P=this}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 s(P,t)}readAccumulateAttributes(t){return null==t?null:t.map(t=>u.fromJSON(t))}writeAccumulateAttributes(t,e,r){t?.length&&(e[r]=t.map(t=>u.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=>a.fromJSON(t))}writeRestrictionAttributes(t,e,r){t?.length&&(e[r]=t.map(t=>a.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([B("accumulateAttributes")],O.prototype,"readAccumulateAttributes",null),t([g("accumulateAttributes")],O.prototype,"writeAccumulateAttributes",null),t([i(l)],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([A(y)],O.prototype,"directionsLengthUnits",void 0),t([A(c)],O.prototype,"directionsOutputType",void 0),t([A(m)],O.prototype,"directionsStyleName",void 0),t([A(d,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],O.prototype,"directionsTimeAttribute",void 0),t([i({json:{write:!0}})],O.prototype,"facilities",void 0),t([g("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([A(u,{name:"impedanceAttributeName",ignoreUnknown:!1})],O.prototype,"impedanceAttribute",void 0),t([i({json:{write:!0}})],O.prototype,"incidents",void 0),t([g("incidents")],O.prototype,"writeIncidents",null),t([i({type:Number,json:{write:!0}})],O.prototype,"outputGeometryPrecision",void 0),t([A(v)],O.prototype,"outputGeometryPrecisionUnits",void 0),t([A(w)],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([g("pointBarriers")],O.prototype,"writePointBarriers",null),t([i({json:{write:!0}})],O.prototype,"polygonBarriers",void 0),t([g("polygonBarriers")],O.prototype,"writePolygonBarrier",null),t([i({json:{write:!0}})],O.prototype,"polylineBarriers",void 0),t([g("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([B("restrictionAttributes")],O.prototype,"readRestrictionAttributes",null),t([g("restrictionAttributes")],O.prototype,"writeRestrictionAttributes",null),t([A(h)],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([B("timeOfDay")],O.prototype,"readTimeOfDay",null),t([g("timeOfDay")],O.prototype,"writeTimeOfDay",null),t([i({type:Boolean,json:{write:!0}})],O.prototype,"timeOfDayIsUTC",void 0),t([A(j)],O.prototype,"timeOfDayUsage",void 0),t([A(f)],O.prototype,"travelDirection",void 0),t([i({type:b,json:{write:!0}})],O.prototype,"travelMode",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"useHierarchy",void 0),O=P=t([n("esri.rest.support.ClosestFacilityParameters")],O);const S=O;export{S as default};