Developers GPS in browser


Get GPS position from a browser using javascript

This feature in GpsGate will allow web pages to read the position from a GPS connected to your local computer in a safe and controlled way. This opens up for very cool web applications which can become position aware.

Some example applications are to make a form that automatically includes a GPS position before it is posted to a web server. Or a map displayed in the browser which marks out your current position.

Make sure you have GpsGate Client 2.6 or later installed, and have “GPS in Browser” added as Output.

Requirements

You need a built in GPS or a GPS connected to your computer and GpsGate must be running. GPS in browser works with any browser that handles javascripts. It is tested on Internet Explorer, Firefox, Opera, Safari, and Opera Mobile on Windows Mobile / Pocket PC.

Answers To Common Questions

1. Is it safe? Which web site can access my GPS position?
Yes, it is safe. Web pages that you view in your browser can request the GPS position using Javascript. But you as a user will always be asked to permit a certain page to do so.

2. Can I connect my GPS to a map on any site now?
No, a web page must be specially designed to take advantage of this feature. See the developer section below for more information.

3. Can I turn this feature off?
Yes, simply remove “GPS in browser” from your Outputs in GpsGate. Or exit GpsGate.

4. Can the GPS be turned on only when it is accessed by a page?
Yes, make sure “Close input on idle” (Pocket PC) or “Close input when no outputs conencted” (Windows) is selected. With this option selected GpsGate will only activate the GPS when it is needed, this will save battery. You must select “Show more options…” in the “Advanced” tab to see this option. By default it is turned off.

For Developers

“GPS in browser” uses cross scripting. GpsGate runs a small local web server from which your page can request GPS information. A javascript library is included to make this really simple.

The GPS in Browser function in covered in detail in this forum post.