Firefox 3.5 does geolocation!

Firefox crop circle
Image by KonMan via Flickr

Since early beta release of Firefox 3.1 there is experimental support for the experimental W3C Geolocation API.

Now Doug Turner, one of the engineers who is behind the Geolocation support in Firefox, wrote a nice background story geolocation in Firefox 3.5 (hacks.mozilla.org). A very interesting read, and it turns out that geolocation is not only for mobile devices, but also available in regular Firefox versions, using wifi or IP address mapping.

Using Firefox 3.5 or another location aware browser? Give it a try by clicking the button below, a map with your current location will be loaded…

Note:

  • Firefox 3.5b4 has an annoying bug (#490046) which lets you get your location only once per run.
  • Privacy is an issue, Firefox asks for permission by showing a notification bar on top of the screen. Click “Tell them” to proceed…

    Click "tell Them"...

Map your location…

What the script does…

// call native geolocation API:
navigator.geolocation.getCurrentPosition(callback);

// callback initializes a google map with the geo data:
function callback(position) {
    ...
    var point = new GLatLng(position.coords.latitude, 
         position.coords.longitude);
    ...
}

Google provides a similar Geolocation API implementation through Gears.

Got another browser where the API works? Please leave a comment!

Reblog this post [with Zemanta]