1

I have my OSRM running on UBUNTU.

How do I change the demo server of routing machine to my own OSRM server on Leaflet?

2

You have to configure the settings as mentioned here. so it would be like this

L.Routing.control({
    waypoints: [
        L.latLng(57.74, 11.94),
        L.latLng(57.6792, 11.949)
    ],
    router: new L.Routing.OSRMv1({
        serviceUrl: url_to_your_service
    })
}).addTo(map);
  • I need the URL to pass a check to see my geojson road on my browser because I get "404 not found: /viaroute?loc=45.18452,5.72094&loc=45.36348,5.58775" – Rabie Ben Sep 17 '17 at 10:08
  • the url was "127.0.0.1:5000/route/v1/driving/…" from point A 13.388860,52.517037 to point B 13.385983,52.496891 – Rabie Ben Sep 17 '17 at 15:00
  • It worked for the url of my OSM service url_to_your_service='MyLINUX IP :5000/route/v1' – Rabie Ben Sep 17 '17 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.