Java - Google maps API - 两个地址之间的距离

Cra*_*der 15 java api google-maps

使用Google Maps API如何确定两个位置之间的行车距离?平台-Java

Red*_*ing 14

您需要使用Google Directions Web Service.您可以发出HTTP请求,将两个位置指定为参数,然后返回描述两点之间方向的JSON(或XML).

注意:谷歌地图服务条款明确规定禁止使用谷歌地图网络服务而不将结果放在谷歌地图上.

  • @seanizer:由于这个问题要求"行驶距离",我认为"最短路线"比"乌鸦飞行"更有用,除非你有一辆坦克. (6认同)
  • 有一些[限制](http://code.google.com/intl/zh-CN/apis/maps/documentation/directions/#Limits),您只能在显示地图时使用此网络服务.超出此范围,您将获得[请求拒绝](http://maps.google.com/maps/api/directions/xml?origin=Berlin&destination=Munich) (3认同)