问题
Possible Duplicate:
Calculate distance between two points in google maps V3
Which one is best method to calculate the distance between two points using Google Map V3 API?
- Using Google's Distance Matrix
computeDistanceBetween()method which is defined ingoogle.maps.geometry.sphericalnamespace.
回答1:
(#2) computeDistanceBetween() returns the straight line distance, to get the driving distance, use either (#1) the Distance Matrix or (#3) the Google Maps API v3 Directions Service, see the documentation for examples
reference
来源:https://stackoverflow.com/questions/14625505/method-to-calculate-distance-between-two-points