Using "Current Location" by default in Directions widget (4x)

564
2
Jump to solution
01-12-2022 11:13 PM
ZA1
by
New Contributor III

Hello,

Using the Directions widget I would like to:

  • Use Current Location as starting point by default 
  • Auto-populate destination with some address 

i.e.:

ZA1_0-1642057852832.png

Unfortunately, I have not found properties in the documentation to do this.

Any help would be greatly appreciated. 

Thank you  

 

 

0 Kudos
1 Solution

Accepted Solutions
Noah-Sager
Esri Regular Contributor

Hi @ZA1, unfortunately it is not currently possible to pre-populate the Directions widget with two different addresses or locations. However, we have some enhancements coming that might make this possible at a future release. 

If you don't need the Directions widget, you could handle the routing and the turn-by-turn directions yourself using route: https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-route.html

 

View solution in original post

2 Replies
Noah-Sager
Esri Regular Contributor

Hi @ZA1, unfortunately it is not currently possible to pre-populate the Directions widget with two different addresses or locations. However, we have some enhancements coming that might make this possible at a future release. 

If you don't need the Directions widget, you could handle the routing and the turn-by-turn directions yourself using route: https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-route.html

 

ZA1
by
New Contributor III

Hi @Noah-Sager . Once again, thanks for the info, much appreciated! 🙂 

 

Am I right in thinking that pre-population of fields in JSAPI 4 is generally an issue? 

Previously I struggled to find a way to automatically populate fields in the Create Workflow of the Editor widget. (link to post)