Leaflet - Draw road path in real-time based on two marker

17,079

This is OSRM, the Open Source Routing Machine. Here is a demo: http://map.project-osrm.org/

You can actually use it through HTTP request in any language you want: Python, javascript, java, C, ... Check the doc!

Share:
17,079
Mellorine
Author by

Mellorine

Updated on June 08, 2022

Comments

  • Mellorine
    Mellorine almost 2 years

    Here's the sample of application that draw road path based on two markers enter image description here

    Sorry I cannot search the tutorial to create this one because I cannot determine the right keyword.

    All i want is to place two markers, then the road path will be created between those markers. It will adjust as one marker is moved.

    Please provide insights on how this can be achieved. A sample code is much appreciated. Thank you in advance.

  • Beda Schmid
    Beda Schmid about 2 years
    Hi, I see they have a "foot" option but that is moot. It is the same route as a car or bike would take mostly. Now when you set the option to have map > hike, you will see what the actual "foot" path would be. Do you know of any possibility to actually use the "hike" paths as route? I can also not find information on the pricing of this service. Is this free? Thank you!
  • chovy
    chovy about 2 years
    Please provide code examples.