How to use the location sensor to track live location of a vehicle?

I want to make an app that can track a vehicle’s live location like a share live locations option in WhatsApp. So far I have made the location sensor show the current location when the screen is opened but when I move to a different place the marker in the maps doesn’t change. I have to refresh the screen to make the marker shift to the new location. How can I make the marker move along the maps when I move?

You’ll need to call Get Current Location inside of a loop or use a timer (probably a better option). That way, each time the timer fires, you get the updated location and add a marker to the map.

1 Like

Thank you very much for the reply. I found it very useful.

2 Likes