Method to calculate distance between two points [duplicate]

久未见 提交于 2019-12-22 18:00:21

问题


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?

  1. Using Google's Distance Matrix
  2. computeDistanceBetween() method which is defined in google.maps.geometry.spherical namespace.

回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!