Firefox 3.5 does geolocation!
- 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…
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!
Related articles by Zemanta
- Google Location Services now in Mozilla Firefox (google-code-updates.blogspot.com)
- W3C Geolocation API – Making Websites Location-aware (slideshare.net)
- New Geo For Devs From Google I/O (radar.oreilly.com)
- Opera, Now With Geolocation (mashable.com)
- Firefox 3.5 Gets Geolocation, Powered by Google (lifehacker.com)
- Google and Mozilla team up to pinpoint your location (venturebeat.com)
- Location awareness spreads to Opera browser (arstechnica.com)
Joe 09:45 on June 10, 2009 Permalink |
Update: indeed, the bug has been fixed in Firefox 3.5b99 – but some requests return a very unaccurate estimate, while others are perfect within only a few meters error.
I guess in some cases Wifi is used, while in other cases generic Geo IP tables are used (e.g. if the Wifi lookup times out?).
Doug Turner 03:14 on June 23, 2009 Permalink |
exactly. if a wifi position is found, that is the location that is shared with the website. if no wifi position is found, a location based on IP is shared.
Keep in mind, all of this is optional — we don’t share anything until you click “share location” in the notification bar.
Hope that helps!
Doug Turner
Johan Sundström 04:13 on June 24, 2009 Permalink |
Works fine in the iPhone 3G mobile Safari (OS 3.0) browser, too.
Joe 06:54 on June 24, 2009 Permalink |
Cool, thanks!
It doesn’t work out of the box on Android’s Webkit browser on the G1, need Google’s interface for that apparently.