【问题标题】:Google Maps: “Unsupported Link Google Maps can't open this link” but only the first time谷歌地图:“不支持的链接谷歌地图无法打开此链接”但只是第一次
【发布时间】:2019-12-18 23:00:46
【问题描述】:

我的 Wayfinder PWA 移交给 Google 地图,以显示前往校园建筑的路线。这些链接符合https://developers.google.com/maps/documentation/urls/guide 上的建议。在 iOS 上,当您第一次尝试使用这些链接时,Google 地图会打开并显示错误“不支持的链接”。后续尝试按预期工作。

这是一个链接示例: https://www.google.com/maps/dir/?api=1&destination=52.4055882,-1.5035222&travelmode=walking 在 Wayfinder 应用程序中找到https://wayfinder.coventry.ac.uk/buildings/alison-gingell.html?location=coventry-university

我尝试使用 encodeURL() 对字符串进行编码,但这似乎对输出或行为没有任何影响。

googleMapLink() {
  let link =
    'https://www.google.com/maps/dir/?api=1&destination=' +
    this.destination.lat +
    ',' +
    this.destination.lng +
    '&travelmode=walking'
  return link
}

更新: 查看@xomena 共享的链接,这是一个已知问题。似乎旅行模式参数可能是一个促成因素。我试过没有它,它工作正常。可接受的解决方法。谢谢@xomena。

googleMapLink() {
      let link =
        'https://www.google.com/maps/dir/?api=1&destination=' +
        this.destination.lat +
        ',' +
        this.destination.lng
      return link
    }

【问题讨论】:

标签: google-maps


【解决方案1】:

您也可以使用此 URL https://maps.google.com/?saddr=start&daddr=end。这对我有用。 maps/ 或 maps/dir/ URL 在移动 iOS/Android 谷歌地图应用中不起作用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-23
    • 1970-01-01
    • 1970-01-01
    • 2015-10-13
    • 1970-01-01
    • 2015-04-23
    • 1970-01-01
    相关资源
    最近更新 更多