计算两点之间距离的方法 [英] Method to calculate distance between two points

查看:135
本文介绍了计算两点之间距离的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

>计算谷歌地图V3中两点之间的距离


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


  1. 使用Google的距离Matrix

  2. computeDistanceBetween() google.maps.geometry.spherical

  3. 解决方案

    (#1)距离矩阵或(#3)Google Maps API v3 路线服务,请参阅文件中的示例

    参考资料


    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.

    解决方案

    (#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

    这篇关于计算两点之间距离的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆