我正在使用此 URL 获取 JSON 方向(并使用 GMSPolyLine
在 map 上显示):
https://maps.googleapis.com/maps/api/directions/json?&origin=%@&destination=%@&sensor=false
但它返回给我的结果是驾驶,我希望用户在步行和驾驶之间进行选择。
谁能给我步行/选择步行或开车的网址?
非常感谢!
最佳答案
将 URL 参数 mode
设置为值 walking
https://maps.googleapis.com/maps/api/directions/json?&origin=%@&destination=%@&mode=walking
https://developers.google.com/maps/documentation/directions/intro#TravelModes
关于ios - 获取 Google Maps 步行路线 JSON 而不是驾驶,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36035439/