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.
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.
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 ...