@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2.97 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../PopupTemplate.js";import o from"../../core/Clonable.js";import s from"../../core/JSONSupport.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../geometry/Polyline.js";import{getPrefixedProperties as m,toKebabImpedanceAttributes as c,fromKebabImpedanceAttributes as u}from"../route/utils.js";import{barrierTypeJsonMap as y}from"./networkEnums.js";import{symbolTypes as n}from"../../symbols/support/typeUtils.js";var b;let d=class extends(o.ClonableMixin(s)){static{b=this}constructor(t){super(t),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(t,e){return m(e.attributes,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}]}static fromGraphic(t){return new b({barrierType:null!=t.attributes.BarrierType?y.fromJSON(t.attributes.BarrierType):null,costs:null!=t.attributes.Costs?c(JSON.parse(t.attributes.Costs)):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,scaleFactor:t.attributes.ScaleFactor??null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,BarrierType:this.barrierType?y.toJSON(this.barrierType):null,Costs:this.costs?JSON.stringify(u(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([p({type:y.apiValues,json:{read:{source:"attributes.BarrierType",reader:y.read}}})],d.prototype,"barrierType",void 0),t([p()],d.prototype,"costs",void 0),t([a("costs",["attributes"])],d.prototype,"readCosts",null),t([p({type:l,json:{write:!0}})],d.prototype,"geometry",void 0),t([p({json:{name:"attributes.Name"}})],d.prototype,"name",void 0),t([p({json:{name:"attributes.ObjectID"}})],d.prototype,"objectId",void 0),t([p({type:r})],d.prototype,"popupTemplate",void 0),t([p()],d.prototype,"scaleFactor",void 0),t([p({types:n})],d.prototype,"symbol",void 0),t([p({readOnly:!0,json:{read:!1}})],d.prototype,"type",void 0),d=b=t([i("esri.rest.support.PolylineBarrier")],d);export{d as default};