title: How to get total driving distance with Google Maps API V3?
body: <p>I used to be able to get it like this:</p>
  
  <pre><code>directionsService.route(directionsRequest, function(directionsResult, directionsStatus) {
      var directionsRenderer = new google.maps.DirectionsRenderer({
          directions: directionsResult,
          map: map
      });
      $('#distance').text(directionsResult.trips[0].routes[0].distance.text)
      $('#duration').text(directionsResult.trips[0].routes[0].duration.text)
  })
  </code></pre>
  
  <p>But it looks like they changed <a href="http://code.google.com/apis/maps/documentation/javascript/reference.html#DirectionsResult" rel="noreferrer">their API</a> on me! Looks like <code>trips</code> is no longer there, and <code>routes</code> only gives you a bunch of legs... do I really have to iterate over all the legs and sum up the distance now?</p>