开发者

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

开发者 https://www.devze.com 2023-02-19 20:39 出处:网络
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

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 th开发者_JAVA百科e units of measure being returned. (I'm probably looking in the wrong place.) Thanks for the help.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消