使用html5测量特定位置和当前位置之间的距离
正如标题所示。知道如何实现这一点吗?
一直在查看 http://www.html5archive.com /2010/12/04/geolocation-api-example-distance-tracking/ 一段时间并尝试修改该代码,但没有成功。
最初不需要自动刷新。
但基本功能应该是获取用户位置并告知用户与特定点之间的距离。
As the title suggests. Any idea how to accomplish that?
Been looking at http://www.html5archive.com/2010/12/04/geolocation-api-example-distance-tracking/ for a while and trying to modify that code, but with no luck.
It doesn't need to be auto refreshing initially.
But basic function should get user location and tell distance between the user and the specific point.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关键代码位于从您指定的页面链接的此页面上。我已将其转换为以下函数:
您需要将特定的纬度和经度作为前两个参数传递给它,并将当前的纬度和经度作为后两个参数。
The key code is on this page linked from the one you specified. I've converted it to a function below:
You need to pass it the specific lat and lon as the first two parameters, and the current lat and lon as the second two.