iOS - Google 地图未显示浏览器中添加的所有 waypoints。在 google 地图应用程序和浏览器(桌面站点)中工作正常

iOS - Google maps not showing all the waypoints added in browser. Working fine in google maps app and browser(with desktop site)

我正在使用一个应用程序,它需要在 waypoints 和 google 地图中的目的地之间传递源。

我首先检查 google 地图应用程序是否可以打开。如果是,我打开 google 地图应用程序,否则我用浏览器打开地图。

下面是我的代码:

func openMaps() {
    if UIApplication.shared.canOpenURL(URL(string: "comgooglemaps://")!) {
        if let mapsAppURL = URL(string: "comgooglemaps://?saddr=56.6440626,-2.8889821&daddr=53.4796061,-2.2455046+to:54.88716525,-2.92375275+to:53.85386995,-2.2135095&directionsmode=driving") {
            UIApplication.shared.open(mapsAppURL, options: [:], completionHandler: nil)
        }
    } else {
        if let url =  URL(string: "https://www.google.co.in/maps/dir/56.6440626,-2.8889821/54.88716525,-2.92375275/53.85386995,-2.2135095/53.4796061,-2.2455046") {
            let safariCont = SFSafariViewController(url: url)
            self.present(safariCont, animated: true, completion: nil)
        }
    }
}

我的问题是:

以下SS供参考

在浏览器中打开时出现实际问题。只有前 3 个坐标可见: https://i.stack.imgur.com/ZLv9v.jpg

请求桌面站点时浏览器没有问题: https://i.stack.imgur.com/ZjG7H.jpg https://i.stack.imgur.com/6rTjs.png

Google 地图应用没有问题: https://i.stack.imgur.com/yktT2.jpg

我不知道这个问题是针对浏览器中的移动站点还是我的代码中存在问题

谢谢!

我认为手机浏览器中的Google地图最多只能多出2张waypoints。它不允许您手动添加更多。如果您尝试自己设置它,而不是传递路由,您会发现您无法设置超过 2 个额外的 waypoints.

这是我添加第二个航路点。请注意菜单中允许您添加停靠点的按钮。

这是我尝试添加的第三个航路点。请注意,添加停止按钮不再可用。

我认为这是移动浏览器中 Google 地图的限制,因为根据 documentation 对于 Google 移动地图应用程序,您最多可以添加 9 张地图附加 waypoints