如何在我的浏览器中模拟纬度和经度值(用于地理定位测试)? [英] How to simulate latitude and longitude values in my browser (for geolocation testing)?

查看:244
本文介绍了如何在我的浏览器中模拟纬度和经度值(用于地理定位测试)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



任何人都有测试凝胶位置的经验吗?

我开发了一个web应用程序,它需要我在我的浏览器中模拟经纬度值进行地理定位测试。基于网络的应用程序?



预先感谢! 伪造地理定位



有很多原因可能会导致您想要在Firefox中伪造你的位置。一个很好的理由是在没有wlan卡的计算机上取消你的位置,例如在工作中,或者没有可用于您周围的WLAN的数据。假装你需要的是一个文本文件(例如./home/username/.mynewlocation.txt),它包含以下内容:

  {location:{latitude:50.941863,longitude:6.958374,accuracy:20.0}} 

此文件在Firefox中的路径为:file://home/username/.mynewlocation.txt在您的位置栏中键入about:config,确认警告,搜索geo.wifi.url ,并用上面的新网址替换旧网址(https://www.google.com/loc/json)。重新启动firefox,享受你的新位置: - )



解释:
纬度/经度=>你想拥有的位置,去谷歌地图,选择位置,点击链接,并使用ll =参数中的值
准确度=>您要公布的准确度,单位为米。


I'm developing a web app where it requires me to simulate the latitude and longitude values in my browser for geolocation testing.

Has anybody has experience in testing gelocation based apps?

Thanks in advance!

解决方案

Faking geolocations

There are many reasons why you would want to fake your location in firefox. One good reason would be "un-faking" your location on computers with no wlan cards, e.g. at work, or where there’s no data available for the WLANs around you. All you need for faking is a text file (eg. /home/username/.mynewlocation.txt) somewhere on your computer with the following content:

{"location":{"latitude":50.941863,"longitude":6.958374, "accuracy":20.0}} 

The path in Firefox to this file is: file://home/username/.mynewlocation.txt Type about:config in your location bar, confirm the warning, search for geo.wifi.url, and replace the old url (https://www.google.com/loc/json) with your new one from above. Restart firefox, enjoy your new location :-)

Explanation: latitude/longitude => the location you want to have, go to google maps, select location, click on "Link" and use the values from the ll= parameter accuracy => the accuracy you want to announce, in meters.

这篇关于如何在我的浏览器中模拟纬度和经度值(用于地理定位测试)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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