Display a direction route on Leaflet map

6.5k views Asked by At

how I can display a direction through Waypoints on a Leaflet map.

I used "leaflet-routing-machine" but I can not view the route

L.Routing.control({
   waypoints: [
      L.latLng(52.5002237, -2.94),
      L.latLng(52.5002237, -0.949),
      L.latLng(52.5002237, -1.949)
   ], 
   autoRoute: true,
   routeWhileDragging: true,
}).addTo(map);

any idea or example plz

you can find a complete example here (https://codepen.io/mahmoud-nb/pen/RZzNYr)

1

There are 1 answers

2
iH8 On BEST ANSWER

You should check your console errors. The request to router.project-osrm.org failed:

Failed to load resource: the server responded with a status of 503 (Service Unavailable: Back-end server is at capacity)