本文介绍了用于Firefox的地理位置提供程序允许手动输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有简单的方法来覆盖的默认行为,只是硬代码您的当前位置?

我认为这对测试和隐私的原因是有用的(提供假的位置数据)



有什么想法?



谢谢

理想情景

有人在谷歌地图出现的地方实现了一个附加组件,我可以选择一个新的默认位置。

geo.wifi .uri不需要成为一个web服务。你也可以用文件将它设置为本地URI:// ...

这个文件应该是一个json文件,其内容如下所示:

  {location:{
latitude:48​​.777025000000002,
longitude:9.1713909999999998,
:10.0}}

更新: +,格式已经改变:

  {
status:OK,
:10.0,
location:{lat:48.777,lng:9.171}
}

或者你可以将它们结合起来以支持两者:

  {
status :
精确度:10.0,
location:{
lat:48.777,
lng:9.171,
纬度:48.777,
longitude:9.171,
准确性:10.0
}
}

更新:它看起来像是手动设置此rence被承担Google服务的提供商阻止。请参阅
更新2: geo.wifi.uri不是geo.wifi.url


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)

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.

Any ideas?

Thanks

Ideal Scenario

Somebody implements an add-on where a google map appears and I can pick a new default location.

解决方案

The geo.wifi.uri does not need to be a webservice. You can also set it to a local uri with file://...

The file should be a json file with content like this:

{"location": {
              "latitude": 48.777025000000002, 
              "longitude": 9.1713909999999998, 
              "accuracy": 10.0}}

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
    }
}

Update: it looks like manually setting this preference is blocked by the provider assuming the Google service. See Bug 716453Update 2: geo.wifi.uri not geo.wifi.url

这篇关于用于Firefox的地理位置提供程序允许手动输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 02:25