Reverse Directions?

717
4
Jump to solution
10-25-2013 05:08 AM
StevenGraf1
Occasional Contributor III
How would you go about reversing the directions using the closestFacilityTask widget from esri?

https://developers.arcgis.com/en/javascript/jssamples/routetask_closest_facility.html
0 Kudos
1 Solution

Accepted Solutions
StevenGraf1
Occasional Contributor III
I figured it out.  Undo what what stated earlier and add the following parameter

[HTML] params.travelDirection = 'esriNATravelDirectionFromFacility';[/HTML]

View solution in original post

0 Kudos
4 Replies
ManishkumarPatel
Occasional Contributor II
How would you go about reversing the directions using the closestFacilityTask widget from esri?

https://developers.arcgis.com/en/javascript/jssamples/routetask_closest_facility.html



Hi,

If you need to reverse the directions just interchange the facilities and incidents

params.incidents = facilities;

params.facilities = incidents;


Have a look at this fiddle: http://jsfiddle.net/Hgv3B/4/

Hope this helps.

Thanks & Regards,
Manish
0 Kudos
StevenGraf1
Occasional Contributor III
Thanks!  I figured it was something simple like that.
0 Kudos
StevenGraf1
Occasional Contributor III
I noticed then when you change the params that it doesn't call the right number of resources.  Is there a way to fix this?
0 Kudos
StevenGraf1
Occasional Contributor III
I figured it out.  Undo what what stated earlier and add the following parameter

[HTML] params.travelDirection = 'esriNATravelDirectionFromFacility';[/HTML]
0 Kudos