【问题标题】:Get Google Maps walking directions JSON instead of driving获取谷歌地图步行路线 JSON 而不是开车
【发布时间】:2016-03-16 12:16:24
【问题描述】:

我正在使用此 URL 获取 JSON 路线(并使用 GMSPolyLine 在地图上显示):

https://maps.googleapis.com/maps/api/directions/json?&origin=%@&destination=%@&sensor=false

但它返回给我的结果是驾驶,我希望用户在步行和驾驶之间进行选择。

谁能给我步行的网址/选择步行还是开车?

非常感谢!

【问题讨论】:

    标签: ios json google-maps google-maps-sdk-ios directions


    【解决方案1】:

    将 URL 参数 mode 设置为值 walking

    https://maps.googleapis.com/maps/api/directions/json?&origin=%@&destination=%@&mode=walking
    

    https://developers.google.com/maps/documentation/directions/intro#TravelModes

    【讨论】:

      猜你喜欢
      • 2012-05-17
      • 1970-01-01
      • 2015-04-18
      • 2012-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-04
      • 1970-01-01
      相关资源
      最近更新 更多