关于Google Maps API 3:计算两点之间距离的方法

Method to calculate distance between two points

本问题已经有最佳答案,请猛点这里访问。

Possible Duplicate:
Calculate distance between two points in google maps V3

使用Google Map V3 API计算两点之间的距离的最佳方法是哪一种?

  • 使用Google的距离矩阵
  • google.maps.geometry.spherical名称空间中定义的computeDistanceBetween()方法。

  • (#2)computeDistanceBetween()返回直线距离,以获取行驶距离,请使用(#1)Distance Matrix或(#3)Google Maps API v3路线服务,请参见示例文档

    参考