UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 6.48 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../PopupTemplate.js";import r from"../../core/Clonable.js";import a from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as o}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../geometry/Point.js";import{directionPointTypeJsonMap as p}from"./networkEnums.js";import{symbolTypes as u}from"../../symbols/support/typeUtils.js";var m;let c=class extends(r.ClonableMixin(a)){static{m=this}constructor(e){super(e),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.type="direction-point",this.voiceInstruction=null}readArrivalTime(e,t){return null!=t.attributes.ArrivalTime?new Date(t.attributes.ArrivalTime):null}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AlternateName",alias:"Alternative Name",type:"esriFieldTypeString"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time Offset",type:"esriFieldTypeInteger"},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble"},{name:"BranchName",alias:"Branch Name",type:"esriFieldTypeString"},{name:"DirectionPointType",alias:"Directions Point Type",type:"esriFieldTypeInteger"},{name:"DisplayText",alias:"Display Text",type:"esriFieldTypeString"},{name:"ExitName",alias:"Exit Name",type:"esriFieldTypeString"},{name:"IntersectingName",alias:"Intersecting Name",type:"esriFieldTypeString"},{name:"Level",alias:"Level",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ShortVoiceInstruction",alias:"Short Voice Instruction",type:"esriFieldTypeString"},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger"},{name:"TowardName",alias:"Toward Name",type:"esriFieldTypeString"},{name:"VoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString"}]}static fromGraphic(e){return new m({alternateName:e.attributes.AlternateName??null,arrivalTime:null!=e.attributes.ArrivalTime?new Date(e.attributes.ArrivalTime):null,arrivalTimeOffset:e.attributes.ArrivalUTCOffset??null,azimuth:e.attributes.Azimuth??null,branchName:e.attributes.BranchName??null,directionPointType:p.fromJSON(e.attributes.DirectionPointType),displayText:e.attributes.DisplayText??null,exitName:e.attributes.ExitName??null,geometry:e.geometry,intersectingName:e.attributes.IntersectingName??null,level:e.attributes.Level??null,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,sequence:e.attributes.Sequence,shortVoiceInstruction:e.attributes.ShortVoiceInstruction??null,stopId:e.attributes.StopID??null,symbol:e.symbol,towardName:e.attributes.TowardName??null,voiceInstruction:e.attributes.VoiceInstruction??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionPointType:this.directionPointType?p.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return null!=this.alternateName&&(e.AlternateName=this.alternateName),null!=this.arrivalTime&&(e.ArrivalTime=this.arrivalTime.getTime()),null!=this.arrivalTimeOffset&&(e.ArrivalUTCOffset=this.arrivalTimeOffset),null!=this.azimuth&&(e.Azimuth=this.azimuth),null!=this.branchName&&(e.BranchName=this.branchName),null!=this.displayText&&(e.DisplayText=this.displayText),null!=this.exitName&&(e.ExitName=this.exitName),null!=this.intersectingName&&(e.IntersectingName=this.intersectingName),null!=this.level&&(e.Level=this.level),null!=this.name&&(e.Name=this.name),null!=this.shortVoiceInstruction&&(e.ShortVoiceInstruction=this.shortVoiceInstruction),null!=this.towardName&&(e.TowardName=this.towardName),null!=this.voiceInstruction&&(e.VoiceInstruction=this.voiceInstruction),new t({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};e([s({json:{read:{source:"attributes.AlternateName"}}})],c.prototype,"alternateName",void 0),e([s({type:Date})],c.prototype,"arrivalTime",void 0),e([o("arrivalTime",["attributes.ArrivalTime"])],c.prototype,"readArrivalTime",null),e([s({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],c.prototype,"arrivalTimeOffset",void 0),e([s({json:{read:{source:"attributes.Azimuth"}}})],c.prototype,"azimuth",void 0),e([s({json:{read:{source:"attributes.BranchName"}}})],c.prototype,"branchName",void 0),e([s({type:p.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:p.read}}})],c.prototype,"directionPointType",void 0),e([s({json:{read:{source:"attributes.DisplayText"}}})],c.prototype,"displayText",void 0),e([s({json:{read:{source:"attributes.ExitName"}}})],c.prototype,"exitName",void 0),e([s({type:l})],c.prototype,"geometry",void 0),e([s({json:{read:{source:"attributes.IntersectingName"}}})],c.prototype,"intersectingName",void 0),e([s({json:{read:{source:"attributes.Level"}}})],c.prototype,"level",void 0),e([s({json:{read:{source:"attributes.Name"}}})],c.prototype,"name",void 0),e([s({json:{read:{source:"attributes.ObjectID"}}})],c.prototype,"objectId",void 0),e([s({type:i})],c.prototype,"popupTemplate",void 0),e([s({json:{read:{source:"attributes.Sequence"}}})],c.prototype,"sequence",void 0),e([s({json:{read:{source:"attributes.ShortVoiceInstruction"}}})],c.prototype,"shortVoiceInstruction",void 0),e([s({json:{read:{source:"attributes.StopID"}}})],c.prototype,"stopId",void 0),e([s({types:u})],c.prototype,"symbol",void 0),e([s({json:{read:{source:"attributes.TowardName"}}})],c.prototype,"towardName",void 0),e([s({readOnly:!0,json:{read:!1}})],c.prototype,"type",void 0),e([s({json:{read:{source:"attributes.VoiceInstruction"}}})],c.prototype,"voiceInstruction",void 0),c=m=e([n("esri.rest.support.DirectionPoint")],c);export{c as default};