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.
Solved! Go to Solution.
Hi @PRAVEENPATNANA, yes, I think you are correct on both counts. Currently, to get additional routes, you would need to make additional requests.
@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."
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.
@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?
Hi @PRAVEENPATNANA, yes, I think you are correct on both counts. Currently, to get additional routes, you would need to make additional requests.