Closed 16bc closed 1 year ago
You're on the right track!
_routeSelected
accepts a second event argument called alternatives that updates the alternative routes.
control._routeSelected({route: routes[idx], alternatives: routes.filter((r, i) => routes.indexOf(r) !== i)});
should work, hopefully
You're on the right track!
Thanks, i replace i to idx, and it works!
control._routeSelected({route: routes[idx], alternatives: routes.filter((r, i) => routes.indexOf(r) !== idx)});
How to select route (to fire 'routeselected') by index? this way partly working:
but hides altroutes on map.
routes
variable got by 'routesfound' event. What is the right way?