Hot answers tagged

1

As suggested in the comments: there is a simple solution via fetching the POIs calculating the detours and picking the best route in the end like I did with similar requirements here. Another option would be to attach the POI information directly in the graph, and do the graph search (Dijkstra or A*) until you find a set of suitable ones, then calculate the ...


1

The route method does not pass any options on to the router. You'll want to use the getRouter method to set the router options first. Then you can recalculate using route: L.easyButton('<img src="pic.png">', function(btn,map){ myRouter.getRouter().options.costing = "pedestrian"; myRouter.route(); }).addTo(map);


1

About the 2nd part _routes can't be accessed directly, but you can use the routesfound event right after .addTo(map) function: routeControl.on('routesfound', function (e) { distance = e.routes[0].summary.totalDistance; time = e.routes[0].summary.totalTime; });



Only top voted, non community-wiki answers of a minimum length are eligible