I used to be able to get it like this:
directionsService.route(directionsRequest, function(directionsResult, directionsStatus) {
var directionsRenderer =
Mark's answer is in meters for totalDistance
and seconds for totalDuration
.
If you're in the U.S. and want miles with a single decimal point, multiply like so:
var METERS_TO_MILES = 0.000621371192;
$('#distance').text((Math.round( totalDistance * METERS_TO_MILES * 10 ) / 10)+' miles');
And if you want minutes:
$('#distance').text(Math.round( totalDuration / 60 )+' minutes');