GeoLocation without a network connection

574 views
Skip to first unread message

Colin Hendricks

unread,
Mar 4, 2014, 10:09:43 PM3/4/14
to chromiu...@chromium.org
I have a field service application written in html5/js and delivered as a cached web app in Chrome on Windows (using a cache.manifest) to ruggedized laptops that have GPS chips in them. The application uses indexeddb to store data and sends it to the server when an Internet connection  is available. Works great... except that when I try to use the html5 js geolocation api to location stamp my data, Chrome refuses to return a position when the laptop does not have an Internet connection, even though it's got a perfectly good GPS chip providing a perfectly good GPS position to Windows. My expectation is that the Chrome browser ought to use the GPS chip to provide a position to the geolocation api call I'm making regardless of whether it has a good Internet connection or not. Instead, I think it's trying to talk to a Google server-side api, and then giving up.

Any ideas on how to work around this? Feels like a bug in the browser to me...

BTW, the geolocation service in other browsers running my same codebase, like Safari on iOS, provide a location using their GPS chip even when they do not have an Internet connection.

Thanks for any help.

TheHairyOne

unread,
Mar 5, 2014, 5:45:37 PM3/5/14
to chromiu...@chromium.org
As a matter of interest if you connect with the internet - then remove the internet, does the program still run?
ie. once you have loaded all the requirements for the geo-location API does it keep going after internet removal - if so try and include their calls in your manifest??
I know it shouldn't be neccessary, but welcome to google killing off weird stuff inside chrome for whatever reason............

Colin Hendricks

unread,
Mar 7, 2014, 4:10:23 PM3/7/14
to chromiu...@chromium.org
Yes, my program still runs fine when the network is gone, but the geolocation api no longer works because it tries to call www.googleapis.com all the time, even if I have a local GPS chip that is perfectly aware of my position without asking google for help.

I tested this on IE11, firefox and opera and they all have the same limitation.

The solution I found is to use GpsGate client, which is a small native Windows program that exposes the GPS chip position info http at a localhost port, which can then be consumed by my web application.
Reply all
Reply to author
Forward
0 new messages