【问题标题】:Cannot add waypoints in google maps route on iOS无法在 iOS 上的谷歌地图路线中添加航点
【发布时间】:2020-10-07 08:51:50
【问题描述】:

我正在指定一条由 iOS 上的 Google 地图应用打开的路线。我指定的网址格式为:

"comgooglemaps://?daddr=\(destination.lat),\(destination.lng)&saddr=\(myLocation.coordinate.latitude),\(myLocation.coordinate.longitude)&directionsmode=driving&waypoints=\(wp1.lat),\(wp1.lng)"

无论如何,路线永远不会包括我指定的航点。 iOS可能不支持这种表示法吗?如果有,正确的是什么?

谢谢

【问题讨论】:

标签: ios google-maps


【解决方案1】:

您可以在daddr中添加参数+to:Latitude,Longtitude来添加您想要的额外停靠点(航点)。

这是基于您的示例代码的示例。

comgooglemaps://?&daddr=\(destination.lat),\(destination.lng)+to:\(destination2.lat),\(destination2.lng)&saddr=\(myLocation.coordinate.latitude),\(myLocation.coordinate.longitude)&directionsmode=driving

我的回答基于这篇帖子https://stackoverflow.com/a/47204434/4861618

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-14
    • 1970-01-01
    • 2011-01-27
    相关资源
    最近更新 更多