UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 3.28 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import o from"../../PopupTemplate.js";import i from"../../core/Clonable.js";import r 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{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import n from"../../geometry/Polyline.js";import{directionLineTypeJsonMap as l}from"./networkEnums.js";import{symbolTypes as a}from"../../symbols/support/typeUtils.js";var u;let m=u=class extends(i.ClonableMixin(r)){constructor(e){super(e),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static fromGraphic(e){return new u({directionLineType:l.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:e.attributes.FromLevel??null,geometry:e.geometry,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,symbol:e.symbol,toLevel:e.attributes.ToLevel??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionLineType:null!=this.directionLineType?l.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return null!=this.fromLevel&&(e.FromLevel=this.fromLevel),null!=this.toLevel&&(e.ToLevel=this.toLevel),new t({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};m.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger"},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger"},{name:"FromLevel",alias:"From Level",type:"esriFieldTypeInteger"},{name:"Meters",alias:"Meters",type:"esriFieldTypeDouble"},{name:"Minutes",alias:"Minutes",type:"esriFieldTypeDouble"},{name:"ToLevel",alias:"To Level",type:"esriFieldTypeInteger"}],e([s({type:l.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:l.read}}})],m.prototype,"directionLineType",void 0),e([s({json:{read:{source:"attributes.DirectionPointID"}}})],m.prototype,"directionPointId",void 0),e([s({json:{read:{source:"attributes.Meters"}}})],m.prototype,"distance",void 0),e([s({json:{read:{source:"attributes.Minutes"}}})],m.prototype,"duration",void 0),e([s({json:{read:{source:"attributes.FromLevel"}}})],m.prototype,"fromLevel",void 0),e([s({type:n})],m.prototype,"geometry",void 0),e([s({json:{read:{source:"attributes.ObjectID"}}})],m.prototype,"objectId",void 0),e([s({type:o})],m.prototype,"popupTemplate",void 0),e([s({types:a})],m.prototype,"symbol",void 0),e([s({json:{read:{source:"attributes.ToLevel"}}})],m.prototype,"toLevel",void 0),e([s({readOnly:!0,json:{read:!1}})],m.prototype,"type",void 0),m=u=e([p("esri.rest.support.DirectionLine")],m);const c=m;export{c as default};