00Eek
00Eek

Reputation: 43

Is there a way to get a GPS location from a USB device with Javascript/HTML5?

I'm trying to get the location off of a GlobalSat G-Star IV USB GPS device to use in a webpage. I've found the Geolocation API and can get it to work on phones with built-in GPS (based off of http://w3schools.com/html5/html5_geolocation.asp), but it always returns "error.POSITION_UNAVAILABLE" when I try to use it with my USB device on a desktop PC (using the latest versions of Chrome and Firefox). For some reason, it's not even pulling a location based on my IP address, but that's beside the point, since I need the highest accuracy possible for my project. I've made sure that my browser is allowing sites to access my location and there is nothing else blocking it that I can identify.

Is there any way to get the Geolocation API to work in this way or am I restricted to working with devices that have built-in GPS?

Upvotes: 4

Views: 2273

Answers (1)

Jos Dirksen
Jos Dirksen

Reputation: 1903

It depends on the platform you are on. Apparently firefox on linux uses GPSD http://catb.org/gpsd/ which in theory at least should allow you to access your USB connected GPS device.

http://www.andygup.net/?p=600 provides a nice overview of how the various browsers implement the geolocation API.

Upvotes: 1

Related Questions