larryq
larryq

Reputation: 16309

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.

Upvotes: 5

Views: 6565

Answers (1)

Doodloo
Doodloo

Reputation: 919

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 ;)

Upvotes: 6

Related Questions