title: Google Maps API: find distance of a route
body: <p>I need to track the distance a user has traveled. I capture location of the user every 30 seconds and after user has completed the journey, I have a series of locations of the path user traveled.</p>
  
  <p>I need to find the distance of the path using the recorded locations. I tried to use the <a href="https://developers.google.com/maps/documentation/distance-matrix/intro" rel="nofollow">distance matrix API</a> but I cannot measure the complete distance using one API call. I have to measure the distance between each consecutive locations and add them to get the total distance.</p>
  
  <p>Is there an easier way to do this?</p>