OSRM - Create Direction Link using current position

Viewed 8

Here's what I'm trying to do. I have two lat, lngs. One is the target or the end point, the other is a stop.

I'm trying to open a map in a browser that finds the route from a individual or the current location to the endpoint via the stop using OSRM.

I tested this link:

https://map.project-osrm.org/?z=16&center=43.411867%2C3.193932&loc=43.415569%2C3.195112&loc=43.408945%2C3.191700&hl=de&alt=0&srv=0

It's good. But I want to add a control where a user can enter their current location.

I tried to add &loc=0%2C0 as starting point.

https://map.project-osrm.org/?z=16&center=43.411867%2C3.193932&loc=0%2C0&loc=43.415569%2C3.195112&loc=43.408945%2C3.191700&hl=de&alt=0&srv=0

Now there are three control boxes. But the first control does not provide the option to enter the current position.

How can I add the possibility to enter a custom start point?

0 Answers
Related