Select to view content in your preferred language

Need to show different colors to Stops with text

468
3
09-01-2022 06:34 AM
bkolliboina
New Contributor II

Hi,

Need to show different colors(4 diff colors) along with text to stops based on time delay. but facing challenges to give different colors to middle object.

currently I am using below sample code,

stops: {
  first: {
    type: "simple-marker",
    style: "circle",
   size: 10,
   color: "#FFEF00",
  },
  middle: {
    type: "simple-marker",
    style: "circle",
    size: 10,
    color: "#FFEF00",
  },  
}

If we have any sample CODE/URL/Approach, please suggest.

Thanks in advance.

 

Tags (3)
0 Kudos
3 Replies
Noah-Sager
Esri Regular Contributor

Hi @bkolliboina, which stops are you trying to change the symbology of? Are these the located stops, or the waypoints between located stops? By located stops, I mean stops the user or app explicitly places (e.g. start and end stops).

These blogs demonstrate some options for changing route symbology. Note that labeling is not yet available for the RouteLayer, but you can use a TextSymbol to add text at or near a stop, which is demonstrated at the end of the first blog.

https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/introducing-the-new-routelayer/

https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/changing-directions/

 

0 Kudos
bkolliboina
New Contributor II

Hi @Noah-Sager,

Thanks for quick response.

I need to show different color  for each stop based on condition. below the sample image

bkolliboina_1-1662044470469.png

 

 

0 Kudos
Noah-Sager
Esri Regular Contributor

I see. I think we need a way to filter the waypoints based on the condition(s), and then overwrite the symbology for those points. I'll look into it to see if we can support this workflow.

https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RouteStopSymbols.h...

 

0 Kudos