Select to view content in your preferred language

Unable to Find multiple routes between the two points on the map(Source&Destination)

690
4
Jump to solution
12-11-2023 11:31 PM
PRAVEENPATNANA
Emerging Contributor

Hi team& @JuliePowell ,

I developed the displaying route for the two points i.e Source and destination & i successfully displaying the route between these two points with the help of ArcGIS RestAPI(arcGISRest.solveRoute) , now i has a requirement i.e i has to display the possible routes min(2 or 3) not the single route between the selected points(source& destination) how to do it with ArcGIS RestAPI or anyway with arcGIS javascript ?

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
Noah-Sager
Esri Regular Contributor

Hi @PRAVEENPATNANA, yes, I think you are correct on both counts. Currently, to get additional routes, you would need to make additional requests.

View solution in original post

0 Kudos
4 Replies
JuliePowell
Esri Contributor

@PRAVEENPATNANA to display routes in the JS Maps SDK, I recommend using RouteLayers which allow you to display multiple routes on the map. Here is a blog that outlines how these work: https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/introducing-the-new-routelayer/

To see the part that specifically covers displaying multiple routes, go to "Route Visualization."

0 Kudos
JuliePowell
Esri Contributor

Oh, I might have read your question wrong - you want to display to POSSIBLE routes between the same two points. The network service doesn't support returning multiple alternate routes in a single request. You could pass in a barrier preventing traveling on certain roads which would cause it to take an alternate route, but there is no way to do this automatically.

0 Kudos
PRAVEENPATNANA
Emerging Contributor

@JuliePowell Ok mam, i understood so at a time isn't possible for displaying the possible routes , so we able to display only one route according to the Profile like(Fastest,shortest,Avoid Tolls) ?

i think Network layer should give only one object i.e one route for every request?

0 Kudos
Noah-Sager
Esri Regular Contributor

Hi @PRAVEENPATNANA, yes, I think you are correct on both counts. Currently, to get additional routes, you would need to make additional requests.

0 Kudos