Real time navigation with the help of Geolocation

How can i make my navigation instruction change on the basis of my current location ? Basically i want to make dynamic routing instruction.

Do you mean you want to “follow a route” using your gps location in the same way google maps tells you when to turn etc ?
The easy way is to use this library which works with the graphhopper web api https://www.graphhopper.com/blog/2019/02/11/get-started-with-graphhopper-navigation/

or
you can build your own which was my lockdown exercise :slight_smile: if you want a walkthrough of how to do that, let me know

1 Like

Thanks for the reply @james_nz . yeah I want my app to work same like the google map works. I get my route from my server where i calculate my routes using graph-hopper and then receive a response from the server having poly-line coordinates and the routing instructions with distance and time. I would like to utilize these data’s and want my app to tell the users when to make the turn. I tried with comparing the current location and linestring coordinates but that not a good idea because the geolocation accuracy may be wrong sometimes. so I was searching for a new algorithm or a solution that fits with my app.

Would you not just send an updated request with a new start location (which is your current location)?

In the past with android I could set the GPS accuracy level (from memory it was in meters) and it would use GPS and cell tower locations to increase accuracy, that was a few years ago now. It was pretty accurate pinging every 10 seconds.
I also think you lose accuracy if you ping it too quickly.

When you send the updated request you could somehow set it to read the top instruction (turn left in 50m) etc.

Powered by Discourse