简体   繁体   English

有方向的谷歌地图在移动设备上不起作用:“找不到路线”

[英]Google Maps having directions doesn't work on mobile : "No Routes Found"

I wanted to have a map having directions set to a static destination.我想要一个map 的方向设置为 static 目的地。

From what i saw, i gave a link as follows:据我所见,我给了一个链接如下:

<a href="https://www.google.com/maps?saddr=My+Location&daddr=760+West+Genesee+Street+Syracuse+NY+13204" target="_blank">link</a>

Which opens up a new page with the map.这会打开一个带有 map 的新页面。

I haven't been able to replicate this on mobile (Android/Ios) however.但是,我无法在移动设备 (Android/Ios) 上复制它。 Following error comes up on the mobile: "No Routes Found" .手机上出现以下错误: “找不到路线”

Can you explain me what am doing wrong?你能解释一下我做错了什么吗?

PS: Am currently using this on a responsive website adding it as a link. PS:我目前在响应式网站上使用它,将其添加为链接。 I don't want this embedded either.我也不想要这个嵌入式。

Thanks.谢谢。

Try changing the URL like the below one.尝试更改如下所示的 URL。 It might help you.它可能会帮助你。

http://maps.google.com/maps?saddr=Current+Location&daddr=Kochi+Kerala+India

Thanks谢谢

The query string format is an older format, so maybe this newer syntax might work:查询字符串格式是一种较旧的格式,因此这种较新的语法可能有效:

<a href="https://www.google.com/maps/dir/Current+Location/760+West+Genesee+Street+Syracuse+NY+13204" target="_blank">link</a>

I've found that sometimes Google likes different phrasings for the current location, so if that doesn't work, you could also try something like Your+Location .我发现有时 Google 喜欢针对当前位置使用不同的措辞,因此如果这不起作用,您也可以尝试使用类似Your+Location

I cannot not use coordinates as source address because I send out a link in an email and my clients can be anywhere in the city when they read it.我不能不使用坐标作为源地址,因为我在 email 中发送了一个链接,我的客户在阅读它时可以在城市的任何地方。

For me neither of "My+Location" nor "Current+Location" worked.对我来说,“我的+位置”和“当前+位置”都不起作用。 It always set the source address to the official center coordinates of the current city or the official address of the inte.net provider.它始终将源地址设置为当前城市的官方中心坐标或 inte.net 提供商的官方地址。 Both on mobile or in desktop browser.无论是在移动设备上还是在桌面浏览器中。 Christian explained here why: https://stackoverflow.com/a/59249673/5356216 Christian 在这里解释了原因: https://stackoverflow.com/a/59249673/5356216

The recommended and working solution in 2022 which is language independent is this:与语言无关的 2022 年推荐和可行的解决方案是:

https://www.google.com/maps/dir/?api=1&destination=760+West+Genesee+Street+Syracuse+NY+13204

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM