Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 offline mode and geolocation

Is it possible to still use the geolocation features when you are in offline mode in HTML5? It appears that when I am online (navigator.onLine = true), the geolocation works fine. But when I go offline (navigator.onLine = false), I get thrown to my error callback and the error indicates geolocation not available.

like image 955
HunterX3 Avatar asked Sep 12 '10 00:09

HunterX3


1 Answers

It's going to depend on how the GeoLocation in that particular browser is wired up. In Firefox, GeoLocation depends on Google Location Services which works by sending some network information to a web service - obviously this is not going to work when you're offline as the web service will not be available.

If you had a browser which communicated directly with GPS hardware then it would work offline, but I don't think you'll find any desktop browsers with that sort of integration - maybe some mobile ones will.

like image 70
robertc Avatar answered Sep 19 '22 17:09

robertc