当前位置 - Google地图 - 链接到路线 [英] Current Location - Google Maps - Link to Directions

查看:106
本文介绍了当前位置 - Google地图 - 链接到路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做一件看起来很容易的事情,但造成了一些混乱。我正尝试使用预填充的目标地址和来自地址的链接前往Google地图,以继承用户的当前位置。从别人指示的内容来看,如果我使用当前位置作为发件人地址,它会为我做所有事情。

相反,当我访问来自不同位置的网址,它仍然会加载原始的当前位置,而不是实际的当前位置。



我确定这很容易,但我希望有人能指引我正确的方向。



可以找到该链接这里

作为用户的位置不是你所期望的,当前位置将被谷歌视为任何其他地址,并且谷歌试图鳍d与查询匹配的地方。



当有人告诉你当前位置将迫使谷歌解决用户的位置时,这是错误的。



您可以自行定位用户,然后根据地理定位结果创建链接。


I'm trying to do what seemed to be an easy thing but has resulted in some confusion. I'm trying to have a link going to Google Maps with the destination address pre-filled and the from address to inherit the user's current location. From what someone else had instructed, if I used 'current location' as the 'from address', it'd do everything for me.

Instead, when I access the URL from a different location, it's still loading the original "current location" and not the actual current location.

I'm sure it's something stupidly easy, but I'm hoping that someone could point me in the right direction.

The link can be found here.

解决方案

What you expect to be the users location is not what you expect, "current location" will be taken by google as any other address, and google tries to find a place that matches the query.

When somebody told you that "current location" will force google to resolve the location of the user, this is wrong.

You may geolocate the user on your own and then create the link based on the geolocation-result.

这篇关于当前位置 - Google地图 - 链接到路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆