Set start location in Directions Widget

109
0
3 weeks ago
AnthonyDAlessio
New Contributor II

I have a RouteLayer added to a Directions widget working as intended so a user can put their cursor in one of the two "Stop" boxes and click on spots on the map or use current location to get directions.

I'm trying to add a button that will fill in the first stop box to set a start location (Eventually it will come from some other process but using a button for testing), the user will then select a point on the map for the destination.

My problem comes in attempting to set this first stop.  I'm not getting any errors and I can look at the stop array to see that stop 0 is set to what I'm looking for but it doesn't update the directions widget.  My guess is there is some sort of refresh of the Directions widget or RouteLayer that has to happen but I'm not seeing any code showing this happening.

 
 directionsWidget.layer.stops[0] = {
       geometry: { x: -71.09707, y: -71.09707 },
       name: "Fenway Park"
     };

What am I missing?

 

 

0 Kudos
0 Replies