What are my options for accessing the user's GPS device in a desktop browser?
After reading about Firefox's Geolocation functionality, which doesn't use GPS, I'm wondering what it would take for a browser (IE and/or Firefox) to be able to access a GPS device connected to a normal laptop/desktop computer?
So far the only technology I've found that seems to be able to do this is Google Gears' Geolocation API or device specific APIs such as this Garmin plugin.
Are there any other/better solutions? Browser plugins/extensions are fine for this purpose.
Update: I don't mind elevating the se开发者_如何学运维curity privileges of the browser, using a plugin etc.
Update: "Firefox 3.6 (Gecko 1.9.2) added support for using the GPSD (GPS daemon) service for geolocation on Linux": https://developer.mozilla.org/en/using_geolocation
I don't know of any browsers that support this right now, but the W3C Geolocation API is designed in such a way that a browser could use GPS to determine your location. (Right now I believe the only browser that actually does use GPS is Mobile Safari on iPhone 3.0.)
In Windows 7, the Location Platform can use any number of location provider plug-ins, including those for GPS devices. I don't believe IE8 officially has support for the W3C Geolocation API, but there are experimental versions that have supported it, so that may happen soon.
If you are trying to implement some web based software that runs on a mobile platform you could consider writing your own driver for the GPS that listens on port 80 and then use an AJAX applet client side to query the GPS driver for the current GPS co-ordinates.
This probably doesn't answer your question, but GPSd is the most helpful GPS package I've encountered. Alas, it doesn't support any flavor of Windows.
Looks like this GPS in Browser tool will let IE actually get GPS coordinates via javascript from a connected GPS.
精彩评论