In order to track our movements and draw a route on the map, we need to create an array of points, each with its own latitude and longitude values. The MapView will take in this array of points as a property called
route, and draw a series of lines to provide a visual representation of the route for the user.
In this recipe, we will create a timer that records our location every minute and adds it to the points array. When each new point is recorded, we will access the Google Directions API to determine the distance and add it to our overall tally of how far we have traveled.
Note that this recipe has been designed to work on iOS devices and has not been tested on Android. To use this code on Android, you will ...