UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 4.6 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 t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../PopupTemplate.js";import s from"../../core/Clonable.js";import o from"../../core/JSONSupport.js";import{property as i}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 p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";import u from"../../geometry/Point.js";import{getPrefixedProperties as d,setPrefixedProperties as n,toKebabImpedanceAttributes as m,fromKebabImpedanceAttributes as c}from"../route/utils.js";import{statusJsonMap as y,fullEdgeJsonMap as b,curbApproachJsonMap as h,barrierTypeJsonMap as j,sideOfEdgeJsonMap as g}from"./networkEnums.js";import{symbolTypes as f}from"../../symbols/support/typeUtils.js";var C;let S=class extends(s.ClonableMixin(o)){static{C=this}constructor(t){super(t),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(t,e){return d(e.attributes,"Attr_")}writeCosts(t,e){n(t,e,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"}]}static fromGraphic(t){return new C({addedCost:t.attributes.AddedCost??null,barrierType:null!=t.attributes.BarrierType?j.fromJSON(t.attributes.BarrierType):null,costs:null!=t.attributes.Costs?m(JSON.parse(t.attributes.Costs)):null,curbApproach:null!=t.attributes.CurbApproach?h.fromJSON(t.attributes.CurbApproach):null,fullEdge:null!=t.attributes.FullEdge?b.fromJSON(t.attributes.FullEdge):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,status:null!=t.attributes.Status?y.fromJSON(t.attributes.Status):null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:this.barrierType?j.toJSON(this.barrierType):null,Costs:this.costs?JSON.stringify(c(this.costs)):null,CurbApproach:this.curbApproach?h.toJSON(this.curbApproach):null,FullEdge:this.fullEdge?b.toJSON(this.fullEdge):null,Name:this.name,Status:this.status?y.toJSON(this.status):null};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([i()],S.prototype,"addedCost",void 0),t([i({type:j.apiValues,json:{name:"attributes.BarrierType",read:{reader:j.read},write:{writer:j.write}}})],S.prototype,"barrierType",void 0),t([i()],S.prototype,"costs",void 0),t([a("costs",["attributes"])],S.prototype,"readCosts",null),t([l("costs")],S.prototype,"writeCosts",null),t([i({type:h.apiValues,json:{read:{source:"attributes.CurbApproach",reader:h.read}}})],S.prototype,"curbApproach",void 0),t([i({type:b.apiValues,json:{name:"attributes.FullEdge",read:{reader:b.read},write:{writer:b.write}}})],S.prototype,"fullEdge",void 0),t([i({type:u,json:{write:!0}})],S.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],S.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],S.prototype,"objectId",void 0),t([i({type:r})],S.prototype,"popupTemplate",void 0),t([i({type:g.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:g.read}}})],S.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],S.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],S.prototype,"sourceOid",void 0),t([i({type:y.apiValues,json:{read:{source:"attributes.Status",reader:y.read}}})],S.prototype,"status",void 0),t([i({types:f})],S.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],S.prototype,"type",void 0),S=C=t([p("esri.rest.support.PointBarrier")],S);export{S as default};