是否有任何简单的方法来覆盖 geolocation api 的默认行为并且只是硬编码你现在的位置?
Are there any easy ways to override the default behaviors of the geolocation api and just hard code your current location?
我认为这对于测试和出于隐私原因(提供虚假位置数据)很有用
I think this would be useful for testing and for privacy reasons (providing fake location data)
我以为有一个附加功能,但我似乎找不到.现在唯一的选择似乎是将 about:config geo.wifi.url 更改为一些替代网络服务,我认为这过于复杂.
I thought there was an add on for this but I can't seem to find one. Only option right now seems to be changing the about:config geo.wifi.url to some alternative webservice, which I consider overly complicated.
有什么想法吗?
谢谢
理想场景
有人实现了一个显示谷歌地图的插件,我可以选择一个新的默认位置.
Somebody implements an add-on where a google map appears and I can pick a new default location.
geo.wifi.uri 不需要是 web 服务.您也可以使用 file://...
The geo.wifi.uri does not need to be a webservice. You can also set it to a local uri with file://...
文件应该是一个json文件,内容如下:
The file should be a json file with content like this:
{"location": {
"latitude": 48.777025000000002,
"longitude": 9.1713909999999998,
"accuracy": 10.0}}
更新:对于 Firefox 9+,格式已更改:
Update: For Firefox 9+, the format has changed:
{
"status": "OK",
"accuracy": 10.0,
"location": {"lat": 48.777, "lng": 9.171}
}
或者您可以将它们结合起来支持两者:
Or you can combine them to support both:
{
"status": "OK",
"accuracy": 10.0,
"location": {
"lat": 48.777,
"lng": 9.171,
"latitude": 48.777,
"longitude": 9.171,
"accuracy": 10.0
}
}
更新:看起来手动设置此首选项被假设为 Google 服务的提供商阻止.请参阅 错误 716453更新 2: geo.wifi.uri 不是 geo.wifi.url
Update: it looks like manually setting this preference is blocked by the provider assuming the Google service. See Bug 716453 Update 2: geo.wifi.uri not geo.wifi.url
这篇关于允许手动输入的 Firefox 地理定位提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Angular 2/Typescript 中使用 IScrollUse IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
Anime.js 在 Ionic 3 项目中不起作用anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 项目中不起作用)
Ionic 3 - 使用异步数据更新 ObservableIonic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用异步数据更新 Observable)
Angular 2:在本地 .json 文件中找不到文件Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
在 Ionic 2 中,如何创建使用 Ionic 组件的自定义指In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何创建使用 Ionic 组件的自定义指令?)
将 ViewChild 用于动态元素 - Angular 2 &离子2Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(将 ViewChild 用于动态元素 - Angular 2 amp;离子2)