Mellorine
Mellorine

Reputation: 285

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

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.

Upvotes: 10

Views: 24467

Answers (1)

Patrick
Patrick

Reputation: 81

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!

Upvotes: 8

Related Questions