Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps V3 API -- geometry library is using what distance measure?

I'm using the google.maps.geometry.spherical's "computeDistanceBetween" function to get the distance between two points on a map. I get a numeric value just fine, but does anyone know what units it's in? (Meters? Yards?) And is it possible to pass a parameter into the function to return, say miles? If there's a conversion utility function I'd be grateful to know of it.

I've looked at Google's API documentation but can't see anything about the units of measure being returned. (I'm probably looking in the wrong place.) Thanks for the help.

like image 431
larryq Avatar asked Mar 23 '11 18:03

larryq


1 Answers

You set the unit you want to use. Read here: https://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/4580d3c5f7c08d7a?pli=1 Based on what you can find here: http://code.google.com/apis/maps/documentation/javascript/reference.html#DirectionsUnitSystem either set a metric or an imperial system, and then you're free to do any further conversion yourself ;)

like image 120
Doodloo Avatar answered Sep 30 '22 16:09

Doodloo