RouteLayer.js 21 KB

12345
  1. /*
  2. All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. See https://js.arcgis.com/4.24/esri/copyright.txt for details.
  4. */
  5. import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import"../geometry.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import s from"../core/Collection.js";import n from"../core/Error.js";import{HandleOwnerMixin as a}from"../core/HandleOwner.js";import l from"../core/Logger.js";import{isSome as p,isNone as u,unwrapOrValue as m,unwrap as c}from"../core/maybe.js";import{MultiOriginJSONMixin as y}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as f}from"../core/object.js";import{isAbortError as d}from"../core/promiseUtils.js";import{on as h}from"../core/reactiveUtils.js";import{convertUnit as w}from"../core/unitUtils.js";import{urlToObject as S}from"../core/urlUtils.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{reader as b}from"../core/accessorSupport/decorators/reader.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import{writer as B}from"../core/accessorSupport/decorators/writer.js";import{updateOrigins as P}from"../core/accessorSupport/originUtils.js";import j from"../geometry/Extent.js";import{initializeProjection as I,project as _}from"../geometry/projection.js";import{WGS84 as N}from"../geometry/support/spatialReferenceUtils.js";import L from"./Layer.js";import{BlendLayer as C}from"./mixins/BlendLayer.js";import{OperationalLayer as D}from"./mixins/OperationalLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{sanitizeUrl as F}from"./support/arcgisLayerUrl.js";import T from"./support/RouteSymbols.js";import x from"../portal/Portal.js";import k from"../portal/PortalItem.js";import{TypeKeyword as A}from"../portal/support/portalItemUtils.js";import{fetchServiceDescription as J}from"../rest/networkService.js";import{solve as G}from"../rest/route.js";import U from"../rest/support/DirectionLine.js";import M from"../rest/support/DirectionPoint.js";import{directionsTimeUnitJsonMap as q,directionsLengthUnitJsonMap as E}from"../rest/support/networkEnums.js";import W from"../rest/support/PointBarrier.js";import V from"../rest/support/PolygonBarrier.js";import z from"../rest/support/PolylineBarrier.js";import H from"../rest/support/RouteInfo.js";import K from"../rest/support/RouteParameters.js";import Q from"../rest/support/RouteSettings.js";import Y from"../rest/support/Stop.js";import Z from"../geometry/SpatialReference.js";import $ from"../geometry/Multipoint.js";function X(e){return e.length?e:null}function ee(e){const{defaultTravelMode:t,supportedTravelModes:r}=e;return r.find((e=>e.id===t))}function te(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:te("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:te("esriGeometryPolyline")}}}function re(e){return"layers"in e}function oe(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function ie(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function se(e,t,r){const o=t.networkDataset.networkAttributes.filter((e=>"cost"===e.usageType)),i=ee(t),s=r.travelMode??i;if(u(s))return void he.warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:a,distanceAttributeName:l}=s,m=o.find((e=>e.name===a)),y=o.find((e=>e.name===l)),f=c(r.travelMode)?.impedanceAttributeName??c(r.impedanceAttribute)??t.impedance,d=q.fromJSON(m?.units),h=E.fromJSON(y?.units);if(!d||!h)throw new n("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const w=r.directionsLanguage??t.directionsLanguage,S=c(r.accumulateAttributes)??t.accumulateAttributeNames??[],g=new Set(o.filter((({name:e})=>e===a||e===l||e===f||S.includes(e))).map((({name:e})=>e))),b=e=>{for(const t in e)g.has(t)||delete e[t]};for(const n of e.pointBarriers)p(n.costs)&&(n.addedCost=n.costs[f]??0,b(n.costs));for(const n of e.polygonBarriers)p(n.costs)&&(n.scaleFactor=n.costs[f]??1,b(n.costs));for(const n of e.polylineBarriers)p(n.costs)&&(n.scaleFactor=n.costs[f]??1,b(n.costs));const{routeInfo:v}=e,{findBestSequence:B,preserveFirstStop:P,preserveLastStop:j,startTimeIsUTC:I,timeWindowsAreUTC:_}=r;v.analysisSettings=new Q({accumulateAttributes:S,directionsLanguage:w,findBestSequence:B,preserveFirstStop:P,preserveLastStop:j,startTimeIsUTC:I,timeWindowsAreUTC:_,travelMode:s}),v.totalDuration=ae(v.totalCosts[a]??0,d),v.totalDistance=le(v.totalCosts[l]??0,h),v.totalLateDuration=ae(v.totalViolations[a]??0,d),v.totalWaitDuration=ae(v.totalWait[a]??0,d),p(v.totalCosts)&&b(v.totalCosts),p(v.totalViolations)&&b(v.totalViolations),p(v.totalWait)&&b(v.totalWait);for(const n of e.stops)p(n.serviceCosts)&&(n.serviceDuration=ae(n.serviceCosts[a]??0,d),n.serviceDistance=le(n.serviceCosts[l]??0,h),b(n.serviceCosts)),p(n.cumulativeCosts)&&(n.cumulativeDuration=ae(n.cumulativeCosts[a]??0,d),n.cumulativeDistance=le(n.cumulativeCosts[l]??0,h),b(n.cumulativeCosts)),p(n.violations)&&(n.lateDuration=ae(n.violations[a]??0,d),b(n.violations)),p(n.wait)&&(n.waitDuration=ae(n.wait[a]??0,d),b(n.wait))}async function ne(e){const t=Z.WGS84;return await I(e.spatialReference,t),_(e,t)}function ae(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function le(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:w(e,t,"meters")}function pe(e){const{attributes:t,geometry:r,popupTemplate:o,symbol:i}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:o,symbol:i}}const ue=s.ofType(U),me=s.ofType(M),ce=s.ofType(W),ye=s.ofType(V),fe=s.ofType(z),de=s.ofType(Y),he=l.getLogger("esri.layers.RouteLayer");let we=class extends(C(O(D(R(y(a(L))))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new T,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new ce,this.polygonBarriers=new ye,this.polylineBarriers=new fe,this.routeInfo=null,this.spatialReference=Z.WGS84,this.stops=new de,this.type="route";const t=()=>{this._setStopSymbol(this.stops)};this.own([h((()=>this.stops),"change",t,{sync:!0,onListenerAdd:t})])}writeFeatureCollectionWebmap(e,t,r,o){const i=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),s=i.map(((e,t)=>t)),n="web-map"===o.origin?"featureCollection.layers":"layers";f(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>U.fromGraphic(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>M.fromGraphic(e)))}get fullExtent(){const e=new j({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:Z.WGS84});if(p(this.routeInfo)&&p(this.routeInfo.geometry))return this.routeInfo.geometry.extent??e;if(u(this.stops))return e;const t=this.stops.filter((e=>p(e.geometry)));if(t.length<2)return e;const{spatialReference:r}=t.getItemAt(0).geometry;if(u(r))return e;const o=t.toArray().map((e=>{const t=e.geometry;return[t.x,t.y]}));return new $({points:o,spatialReference:r}).extent}readMaxScale(e,t){return(re(t)?t.layers:t.featureCollection.layers).find((e=>p(e.layerDefinition.maxScale)))?.layerDefinition.maxScale??0}readMinScale(e,t){return(re(t)?t.layers:t.featureCollection.layers).find((e=>p(e.layerDefinition.minScale)))?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>W.fromGraphic(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>V.fromGraphic(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>z.fromGraphic(e)))}readRouteInfo(e,t){const r=this._getNetworkFeatures(t,"RouteInfo",(e=>H.fromGraphic(e)));return r.length>0?r.getItemAt(0):null}readSpatialReference(e,t){const r=re(t)?t.layers:t.featureCollection.layers;if(!r.length)return Z.WGS84;const{layerDefinition:o}=r[0],i=o.spatialReference??o.extent.spatialReference??N;return Z.fromJSON(i)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>Y.fromGraphic(e)),(e=>this._setStopSymbol(e)))}get title(){return p(this.routeInfo)&&p(this.routeInfo.name)?this.routeInfo.name:"Route"}set title(e){e?this._override("title",e):this._clearOverride("title")}get url(){return t.routeServiceUrl}set url(e){null!=e?this._set("url",F(e,he)):this._set("url",t.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){p(this.directionLines)&&(this.directionLines.removeAll(),this._set("directionLines",null)),p(this.directionPoints)&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),p(this.routeInfo)&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new n("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new n("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new n("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(u(this.routeInfo))throw new n("routelayer:route-unsolved","save() requires a solved route");const{portal:r}=t;await r._signIn(),r.user||await t.reload();const{itemUrl:o,itemControl:i}=t;if("admin"!==i&&"update"!==i)throw new n("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const s={messages:[],origin:"portal-item",portal:r,url:o&&S(o),writtenProperties:[]},a=this.write(null,s);return t.extent=await ne(e),t.title=this.title,await t.update({data:a}),t}async saveAs(e,t={}){if(await this.load(),u(this.routeInfo))throw new n("routelayer:route-unsolved","saveAs() requires a solved route");const r=k.from(e).clone();r.extent??(r.extent=await ne(this.fullExtent)),r.id=null,r.portal??(r.portal=x.getDefault()),r.title??(r.title=this.title),r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",A.MULTI_LAYER,"Route Layer"];const{portal:o}=r,i={messages:[],origin:"portal-item",portal:o,url:null,writtenProperties:[]};await o._signIn();const s=t?.folder,a=this.write(null,i);return await o.user.addItem({item:r,folder:s,data:a}),this.portalItem=r,P(i),i.portalItem=r,r}async solve(e,t){const r=e?.stops??this.stops,o=e?.pointBarriers??X(this.pointBarriers),i=e?.polylineBarriers??X(this.polylineBarriers),a=e?.polygonBarriers??X(this.polygonBarriers);if(u(r))throw new n("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((oe(r)||ie(r))&&r.features.length<2||s.isCollection(r)&&r.length<2)throw new n("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(s.isCollection(r))for(const s of r)s.routeName=null;const l=e?.apiKey,c=this.url,y=await this._getServiceDescription(c,l,t),f=ee(y),h=e?.travelMode??f,w=m(e?.accumulateAttributes,[]);p(h)&&(w.push(h.distanceAttributeName),h.timeAttributeName&&w.push(h.timeAttributeName));const S={startTime:new Date},g={accumulateAttributes:w,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:o,polylineBarriers:i,polygonBarriers:a,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!o,returnDirections:!0,returnPolygonBarriers:!!a,returnPolylineBarriers:!!i,returnRoutes:!0,returnStops:!0,stops:r},b=e?K.from(e):new K;for(const s in S)null==b[s]&&(b[s]=S[s]);let v;b.set(g);try{v=await G(c,b,t)}catch(P){throw d(P)?P:new n("routelayer:failed-route-request","the routing request failed",{error:P})}const B=this._toRouteLayerSolution(v);return this._isOverridden("title")||(this.title=m(B.routeInfo.name,"Route")),se(B,y,b),B}update(e){const{stops:t,directionLines:r,directionPoints:o,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,routeInfo:a}=e;this.set({stops:t,pointBarriers:i,polylineBarriers:s,polygonBarriers:n}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",a)}_getNetworkFeatures(e,t,n,a){const l=(re(e)?e.layers:e.featureCollection.layers).find((e=>e.layerDefinition.name===t));if(u(l))return new s;const{layerDefinition:p,popupInfo:m,featureSet:c}=l,y=p.drawingInfo.renderer,{features:f}=c,d=y&&i(y),h=f.map((e=>{const i=r.fromJSON(e),s=n(i);return s.symbol??(s.symbol=d?.getSymbol(i)??this._getNetworkSymbol(t)),s.popupTemplate??(s.popupTemplate=m&&o.fromJSON(m)),s}));return a&&h.some((e=>!e.symbol))&&a(h),new s(h)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,r){if(p(this._cachedServiceDescription)&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const o=await J(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){if(!e||0===e.length)return;if(u(this.defaultSymbols.stops))return;if(e.every((e=>p(e.symbol))))return;const{first:t,last:r,middle:o,unlocated:i,waypoint:s,break:n}=this.defaultSymbols.stops;if(u(this.routeInfo)||1===e.length)return void e.forEach(((i,s)=>{switch(s){case 0:i.symbol=t;break;case e.length-1:i.symbol=r;break;default:i.symbol=o}}));const a=e.map((e=>e.sequence)).filter((e=>p(e))),l=Math.min(...a),m=Math.max(...a);for(const p of e)p.sequence!==l?p.sequence!==m?"ok"===p.status||"not-located-on-closest"===p.status?"waypoint"!==p.locationType?"break"!==p.locationType?p.symbol=o:p.symbol=n:p.symbol=s:p.symbol=i:p.symbol=r:p.symbol=t}_toRouteLayerSolution(e){const t=e.routeResults[0].stops.map((e=>Y.fromJSON(e.toJSON())));this._setStopSymbol(t);const r=new de(t),o=new ye(e.polygonBarriers?.map((e=>{const t=V.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),i=new fe(e.polylineBarriers?.map((e=>{const t=z.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),s=new ce(e.pointBarriers?.map((e=>{const t=W.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),n=H.fromJSON(e.routeResults[0].route.toJSON());n.symbol=this.defaultSymbols.routeInfo;const a=new me(e.routeResults[0].directionPoints?.features.map((e=>{const t=M.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{directionLines:new ue(e.routeResults[0].directionLines?.features.map((e=>{const t=U.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:a,pointBarriers:s,polygonBarriers:o,polylineBarriers:i,routeInfo:n,stops:r}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",U.fields,U.popupInfo,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",M.fields,M.popupInfo,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,r,o,i,s,n){return u(e)||!e.length?null:{featureSet:{features:e.toArray().map((e=>pe(e))),geometryType:r},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:p(t)?t.toJSON():te(r)}},extent:this.fullExtent.toJSON(),fields:o,geometryType:r,hasM:!1,hasZ:!1,maxScale:this.maxScale,minScale:this.minScale,name:s,objectIdField:"__OBJECTID",spatialReference:this.spatialReference.toJSON(),title:n,type:"Feature Layer",typeIdField:""},popupInfo:i}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",W.fields,W.popupInfo,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",V.fields,V.popupInfo,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",z.fields,z.popupInfo,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(p(this.routeInfo)?new s([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",H.fields,H.popupInfo,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",Y.fields,Y.popupInfo,"Stops","Stops");if(u(e))return null;const{stops:t}=this.defaultSymbols,r=p(t)&&p(t.first)&&t.first.toJSON(),o=p(t)&&p(t.middle)&&t.middle.toJSON(),i=p(t)&&p(t.last)&&t.last.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:o,uniqueValueInfos:[{value:"1",symbol:r,label:"First Stop"},{value:`${this.stops.length}`,symbol:i,label:"Last Stop"}]},e}};e([g({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],we.prototype,"_featureCollection",void 0),e([B(["web-map","portal-item"],"_featureCollection")],we.prototype,"writeFeatureCollectionWebmap",null),e([g({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],we.prototype,"_type",void 0),e([g({nonNullable:!0,type:T})],we.prototype,"defaultSymbols",void 0),e([g({readOnly:!0})],we.prototype,"directionLines",void 0),e([b(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],we.prototype,"readDirectionLines",null),e([g({readOnly:!0})],we.prototype,"directionPoints",void 0),e([b(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],we.prototype,"readDirectionPoints",null),e([g({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],we.prototype,"featureCollectionType",void 0),e([g({readOnly:!0})],we.prototype,"fullExtent",null),e([g({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],we.prototype,"legendEnabled",void 0),e([g({type:["show","hide"]})],we.prototype,"listMode",void 0),e([g({type:Number,nonNullable:!0,json:{write:!1}})],we.prototype,"maxScale",void 0),e([b(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],we.prototype,"readMaxScale",null),e([g({type:Number,nonNullable:!0,json:{write:!1}})],we.prototype,"minScale",void 0),e([b(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],we.prototype,"readMinScale",null),e([g({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],we.prototype,"operationalLayerType",void 0),e([g({nonNullable:!0,type:s.ofType(W)})],we.prototype,"pointBarriers",void 0),e([b(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],we.prototype,"readPointBarriers",null),e([g({nonNullable:!0,type:s.ofType(V)})],we.prototype,"polygonBarriers",void 0),e([b(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],we.prototype,"readPolygonBarriers",null),e([g({nonNullable:!0,type:s.ofType(z)})],we.prototype,"polylineBarriers",void 0),e([b(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],we.prototype,"readPolylineBarriers",null),e([g({readOnly:!0})],we.prototype,"routeInfo",void 0),e([b(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],we.prototype,"readRouteInfo",null),e([g({type:Z})],we.prototype,"spatialReference",void 0),e([b(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],we.prototype,"readSpatialReference",null),e([g({nonNullable:!0,type:s.ofType(Y)})],we.prototype,"stops",void 0),e([b(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],we.prototype,"readStops",null),e([g()],we.prototype,"title",null),e([g({readOnly:!0,json:{read:!1}})],we.prototype,"type",void 0),e([g()],we.prototype,"url",null),we=e([v("esri.layers.RouteLayer")],we);const Se=we;export{Se as default};