I want to calculate the direct distance between to p开发者_如何学Pythonositions in metric form. (ie: from A to B in kilometers).
I didn't understand what computeDistanceBetween method returns in units.
Thanks
It's in meters. To convert to kilometers divide by 10241000, obviously.
google.maps.geometry.spherical.computeDistanceBetween(
Moscow, Leningrad
); // 679601 m
By the way, the underlying code of this library method is based on the Haversine formula.
精彩评论