Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox 5, Geolocating and "Not Now" Issue

Has anyone out there had to deal with and managed to find a viable workaround for the Firefox 5 geolocation issue I posted in the following bug report. It's easier to link to the report than re-describe it here.

https://bugzilla.mozilla.org/show_bug.cgi?id=675533

Surely I'm not the only one on the planet this has bitten.

like image 947
Chris Avatar asked Aug 03 '11 20:08

Chris


2 Answers

This doesn't really solve the root of your problem but my strategy for handling this is setting a default location point that I use right away (not waiting for the geolocation question to be answered).

If I get a location from the user, I just change it to the new location. If I get a rejection or no answer at all, I just stay on the default location.

It's also my experience that a desktop client (in my case Firefox on a stationary Windows computer) takes much longer to respond than a mobile client (in my case Safari on iPhone). I was forced to set the timeout to 10 seconds (10000) to give the desktop client enough time to respond. So if you have a map, initializing it and centering on a default location directly will give the user a map on the screen much faster than if you have to wait for a response.

Good luck with your positioning project!

like image 138
tkahn Avatar answered Jan 03 '23 17:01

tkahn


I might be a bit late but hope I can help others. My workaround is based on a delayed call. If there is no fix when the delayed call is fires, I become suspicious :)

var timeIsPassig = false;

function anyThing(){
  timeIsPassig = true;
  setTimeout(
    function(){
      if (timeIsPassig) {
        timeIsPassig = false;
        console.log("Waiting too much... Or did you say not now? :-P");
        }
      },
    10000
    );
  navigator.geolocation.getCurrentPosition(
    function (pos) {timeIsPassig = false; /* rest of positioning*/},
    function (err) {timeIsPassig = false; /* rest of error handling*/},
    {maximumAge: 30000, timeout: 10000, enableHighAccuracy: true}
    )
  }
like image 26
GISGusting Avatar answered Jan 03 '23 17:01

GISGusting