Route :user geolocation to specific point

Hey guys,

I’m new to these technologies so, I’m having troubles in creating a specific program.

I need to create a button that asks to the user to share its position, and from that position to automatically create a route to a place that I have already set before, so it would be much more comfortable to understand what routes use to go from their position to those specific places.

Sorry for the bad english, I hope I was clear enough :sweat_smile:

Hey,

I’m a bit unsure as to what you’re asking. We can’t help you on getting data from your user, but if they specify their starting point and you know the desired endpoint, have a look at the directions endpoint of the openrouteservice.

Hope that helps you out, if not I fear you’ll have to be more specific.
Best regards

Good evening,

I’m sorry if I was too unclear.
I would like to create something where the user shares its position by giving consent to track its position or by putting in a form the addresse where he/she wants to start the track.

To be clearer, if for example I want to bring some people to a supermarket X, I have to create the endpoint as the supermarket X’s addresse and then the user has to specify its position, or by giving consent to position tracking or by writing in input the addresse where he/she wants to start the track.

I hope I was clearer this time, and thanks for the answer.
Best regards

Hi @Sephixas

I am not sure what exactly you meat with “I would like to create”. If you want to create an application that has the features you mentioned, then I am afraid we can not help you, since the application development is out of our scope. But our maps client already has this feature. The maps client is also open source and extendable, so you could use our client directly via maps.openrouteservice.org or run it in yuor own server.

For example, the link below will open the maps client with a predefined destination (it could be a supermarket or anything else) and the user just has to inform the departure place (type an address or select her/his location)

https://maps.openrouteservice.org/#/directions/null/Gustav-Regler-Platz,Saarbrücken,SL,Germany/data/{"coordinates":"null,null;6.9964027404785165,49.234581451570435","options":{"zoom":14,"profile":"cycling-regular","preference":"recommended"}}

2 Likes

Hi and thanks for the answer,

Firstly, I apologize for not being clear enough as to what was necessary.

In second place, I will try to be as clear as I can.
I’m working on a project where I have to improve the “how to find us” section for a website.
Due to the fact that this section has to be simple to understand even for elderly people and people with low knowledge of web surfing , I thought that placing an HTML’s iframe within the ORS map and below some buttons to interact with that map would be the perfect solution.

I made all of these buttons but the only one that is missing is the one where the user clicks and automatically the ORS calculate a route from the user’s position to an endpoint or from the place the user choose in input to the endpoint.
So, the 2 solutions I think that can be useful are:

  • To access to the user’s position and automatically set the route to that position to the endpoint
  • Setting a form input where the user writes where he/she wants to start the route and then ORS calculate the route to the endpoint

In these 2 solutions I do not want that the user has to interact directly with the map but only with a button I create specifically.

The point is: how can I build one of these solutions? I prefer the first one, but even the second one is good.
Is there an API useful for that?
Do I need a specific JS library for these solution like Leaflet or others?

Thanks for your support

I hope that this time I was clear enough :persevere:

Best regards

Hi

after a long time I could return to work on my project.

I’m trying to understand how to create a link like your one.
In few words, I need to understand to create a link like this → OpenRouteService route planner - directions, isochrones and places (all right, it doesn’t allow me to rewrite your link, but whatever), and avoid the standard link where after the destination place, there are lot of numbers impossible to understand (at least for me).

If I would understand that, I would be very close to the finish line of my project.

Thank you so much for your time.

Best regards