@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 12.5 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import i from"../../PopupTemplate.js";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as a}from"../../core/JSONSupport.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";import l from"../../geometry/Point.js";import{getTimezoneOffset as u,getPrefixedProperties as n,setPrefixedProperties as p,toKebabImpedanceAttributes as d,fromKebabImpedanceAttributes as m}from"../route/utils.js";import{statusJsonMap as b,locationTypeJsonMap as c,curbApproachJsonMap as y,sideOfEdgeJsonMap as v}from"./networkEnums.js";import{symbolTypes as T}from"../../symbols/support/typeUtils.js";import{reader as h}from"../../core/accessorSupport/decorators/reader.js";import{writer as f}from"../../core/accessorSupport/decorators/writer.js";var C;let w=class extends(r(a)){static{C=this}constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.positionAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,t){return u(t.attributes.ArriveTime,t.attributes.ArriveTimeUTC)}readCumulativeCosts(e,t){return n(t.attributes,"Cumul_")}readDepartTimeOffset(e,t){return u(t.attributes.DepartTime,t.attributes.DepartTimeUTC)}set geometry(e){this._get("geometry")&&(this._set("positionAlong",null),this._set("sideOfEdge",null),this._set("sourceId",null),this._set("sourceOid",null),this._set("status",null)),this._set("geometry",e)}readServiceCosts(e,t){return n(t.attributes,"Attr_")}writeServiceCosts(e,t){p(e,t,"Attr_")}writeTimeWindowEnd(e,t){null!=e&&(t.attributes||(t.attributes={}),t.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,t){null!=e&&(t.attributes||(t.attributes={}),t.attributes.TimeWindowStart=e.getTime())}readViolations(e,t){return n(t.attributes,"Violation_")}readWait(e,t){return n(t.attributes,"Wait_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate",editable:!0,nullable:!0,length:36},{name:"ArrivalUTCOffset",alias:"Arrival Time Offset",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString",editable:!0,nullable:!0,length:1048576},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate",editable:!0,nullable:!0,length:36},{name:"DepartureUTCOffset",alias:"Departure Time Offset",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble",editable:!0,nullable:!0},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"Name",alias:"Name",type:"esriFieldTypeString",editable:!0,nullable:!0,length:255},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",editable:!0,nullable:!0,length:255},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString",editable:!0,nullable:!0,length:1048576},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate",editable:!0,nullable:!0,length:36},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate",editable:!0,nullable:!0,length:36},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble",editable:!0,nullable:!0}]}static fromGraphic(e){return new C({arriveCurbApproach:null!=e.attributes.ArrivalCurbApproach?y.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:null!=e.attributes.ArrivalTime?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:null!=e.attributes.CumulativeCosts?d(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:null!=e.attributes.CurbApproach?y.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:null!=e.attributes.DepartureCurbApproach?y.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:null!=e.attributes.DepartureTime?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:null!=e.attributes.LocationType?c.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:null!=e.attributes.ServiceCosts?d(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:null!=e.attributes.Status?b.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:null!=e.attributes.TimeWindowEnd?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:null!=e.attributes.TimeWindowStart?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach?y.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime?.getTime()??null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts?JSON.stringify(m(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach?y.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach?y.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime?.getTime()??null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType?c.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts?JSON.stringify(m(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status?b.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd?.getTime()??null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart?.getTime()??null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new t({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};e([s({type:y.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:y.read}}})],w.prototype,"arriveCurbApproach",void 0),e([s({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],w.prototype,"arriveTime",void 0),e([s()],w.prototype,"arriveTimeOffset",void 0),e([h("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],w.prototype,"readArriveTimeOffset",null),e([s({json:{name:"attributes.Bearing",read:!1,write:!0}})],w.prototype,"bearing",void 0),e([s({json:{name:"attributes.BearingTol",read:!1,write:!0}})],w.prototype,"bearingTol",void 0),e([s()],w.prototype,"cumulativeCosts",void 0),e([h("cumulativeCosts",["attributes"])],w.prototype,"readCumulativeCosts",null),e([s()],w.prototype,"cumulativeDistance",void 0),e([s()],w.prototype,"cumulativeDuration",void 0),e([s({type:y.apiValues,json:{name:"attributes.CurbApproach",read:{reader:y.read},write:{writer:y.write}}})],w.prototype,"curbApproach",void 0),e([s({type:y.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:y.read}}})],w.prototype,"departCurbApproach",void 0),e([s({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],w.prototype,"departTime",void 0),e([s()],w.prototype,"departTimeOffset",void 0),e([h("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],w.prototype,"readDepartTimeOffset",null),e([s({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],w.prototype,"distanceToNetworkInMeters",void 0),e([s({type:l,json:{write:!0},value:null})],w.prototype,"geometry",null),e([s()],w.prototype,"lateDuration",void 0),e([s({type:c.apiValues,json:{name:"attributes.LocationType",read:{reader:c.read},write:{writer:c.write}}})],w.prototype,"locationType",void 0),e([s({json:{name:"attributes.Name"}})],w.prototype,"name",void 0),e([s({json:{name:"attributes.NavLatency",read:!1,write:!0}})],w.prototype,"navLatency",void 0),e([s({json:{name:"attributes.ObjectID"}})],w.prototype,"objectId",void 0),e([s({type:i})],w.prototype,"popupTemplate",void 0),e([s({json:{name:"attributes.PosAlong"}})],w.prototype,"positionAlong",void 0),e([s({json:{name:"attributes.RouteName"}})],w.prototype,"routeName",void 0),e([s()],w.prototype,"serviceCosts",void 0),e([h("serviceCosts",["attributes"])],w.prototype,"readServiceCosts",null),e([f("serviceCosts")],w.prototype,"writeServiceCosts",null),e([s()],w.prototype,"serviceDistance",void 0),e([s()],w.prototype,"serviceDuration",void 0),e([s({json:{name:"attributes.Sequence"}})],w.prototype,"sequence",void 0),e([s({type:v.apiValues,json:{name:"attributes.SideOfEdge",read:{reader:v.read},write:{writer:v.write}}})],w.prototype,"sideOfEdge",void 0),e([s({json:{read:{source:"attributes.SnapX"}}})],w.prototype,"snapX",void 0),e([s({json:{read:{source:"attributes.SnapY"}}})],w.prototype,"snapY",void 0),e([s({json:{read:{source:"attributes.SnapZ"}}})],w.prototype,"snapZ",void 0),e([s({json:{name:"attributes.SourceID"}})],w.prototype,"sourceId",void 0),e([s({json:{name:"attributes.SourceOID"}})],w.prototype,"sourceOid",void 0),e([s({type:b.apiValues,json:{name:"attributes.Status",read:{reader:b.read},write:{writer:b.write}}})],w.prototype,"status",void 0),e([s({types:T})],w.prototype,"symbol",void 0),e([s({type:Date,json:{name:"attributes.TimeWindowEnd"}})],w.prototype,"timeWindowEnd",void 0),e([f("timeWindowEnd")],w.prototype,"writeTimeWindowEnd",null),e([s()],w.prototype,"timeWindowEndOffset",void 0),e([s({type:Date,json:{name:"attributes.TimeWindowStart"}})],w.prototype,"timeWindowStart",void 0),e([f("timeWindowStart")],w.prototype,"writeTimeWindowStart",null),e([s()],w.prototype,"timeWindowStartOffset",void 0),e([s({readOnly:!0,json:{read:!1}})],w.prototype,"type",void 0),e([s()],w.prototype,"violations",void 0),e([h("violations",["attributes"])],w.prototype,"readViolations",null),e([s()],w.prototype,"waitDuration",void 0),e([s()],w.prototype,"wait",void 0),e([h("wait",["attributes"])],w.prototype,"readWait",null),w=C=e([o("esri.rest.support.Stop")],w);export{w as default};