Google Gears Geolocation API

I spotted this on the All Points Blog.

Google Gears is an open source project that allows you to run web applications while you’re offline. It basically caches data in a SQLite database and has a local store to cache things like JavaScript and HTML. They recently added a Geolocation API to Gears, which allows the user to retrieve their current position (via GPS, cell tower triangulation, or IP address).

The API provides these features:

Here’s a simple example from their web site:

<script type=”text/javascript” src=”gears_init.js“></script>
<script type=”text/javascript”>
var geo = google.gears.factory.create(‘beta.geolocation’);

function updatePosition(position) {
alert(‘Current lat/lon is: ‘ + position.latitude + ‘,’ + position.longitude);

function handleError(positionError) {
alert(‘Attempt to get location failed: ‘ + positionError.message);

geo.getCurrentPosition(updatePosition, handleError);

This didn’t do anything for me, but I’m fairly sure I’m doing it wrong.

This is similar to the Fire Eagle Yahoo! service I blogged about last month. The usual we keep your data private message is being trumpeted by Google, while I continue with my creepy creepy creepy summation on the matter.