navigator.geolocation.getCurrentPosition do not work in Firefox 30.0

前端 未结 2 1014
别那么骄傲
别那么骄傲 2020-12-31 10:53

I am using Firefox 30.0(latest FF),navigator.geolocation.getCurrentPosition is working in Chrome but not in this version of FF.

Here is my code

相关标签:
2条回答
  • 2020-12-31 11:33

    I've a possible solution:

    I think that the mozilla guys have change something in the location adquisition process, so now it take more time and the function getCurrentPosition gets a timeout.

    This will answer the question of why it works in chrome, worked in FF 29 and not in FF 30.0.

    But thats a suposition. Now let's get back to the real world:

    I've put a timeout of 10 seconds on the call and now it works. I've done it this way:

    navigator.geolocation.getCurrentPosition(onSuccess, onError, {timeout:10000});
    

    This fixed it for me. It works on FF 30.

    0 讨论(0)
  • 2020-12-31 11:44

    Now I'm using 47 Mozilla. I have tried everything, but all time this problem. BUT then I open about:config in my address bar, go geo.wifi.uri and changed its value to "https://location.services.mozilla.com/v1/geolocate?key=test". works!

    0 讨论(0)
提交回复
热议问题