Is there a way to actually to that in its current state?
Add some stops and then query the route.
The widgets stops collection property is part of the viewModel:
I know, but when deleted and added again the widget won't make a new query with the same results.
Have you actually validated that setting the stops dynamically will solve the route and display directions? I have tried this and it does not seem to be the case. Unless there is something else I need to do besides specifying viewModel stops.
Would love your input!
Chris, No I did not test this myself. It use to work in 3.x but 4.x Directions widget is still in Beta.
We are working to add support for this in a future release. I don't currently have an ETA on when this functionality will be available.
Has there been any update on this? I'd like to use all of the nifty UI/UX interactions that come with the built-in widget, but without requiring manual input of start/end stops.
Would very much appreciate an update.
I am also looking for a 'proper' way to programmatically add stops to the directions widget.
I am successful at adding the geometries to the ViewModel, and can route successfully, however this leaves the widget in a semi-broken state, as the search inputs and the related Directions._stops && Directions._stopsToSearches properties do not get populated, so if I change one of the stops manually in the widget (like changing the start location), ALL the programmatically entered stops get removed and only the manually entered stop is present.
for now, I am hooking into the 'after render' event with dojo's aspect.after method, and manually setting the input text value and disabling the input so the user is unable to change stops, BUT this is not going to work for my customer in the long run.
I have no problem manually performing all the steps to add the 'stop' objects to keep the ViewModel and Widget in sync, but trying to look through the minified code to determine what steps I actually need to take hasn't gotten me anywhere, as it is near impossible to tell what the parameter types are, or even the correct order to do things. Is there an engineer that can help with the required steps? Thanks!
Retrieving data ...