Geolocation goodness
I’ve posted the article “Using geolocation“, which provides introductory information on using the new geolocation API being introduced in Firefox 3.1. I’ll be adding a working example tomorrow (later today, actually, now that I look at my clock and see it’s already Friday). I’ve also not yet documented the interfaces behind geolocation, but I’ll be doing those tomorrow.
As always, if you happen to notice any errors, please feel free to correct them or let me know what needs fixing so I can do it.
Enjoy!

October 10th, 2008 at 4:34 am
I’ve added Geolocation support to BrowserSpy.dk. It’s online at http://browserspy.dk/geolocation.php
Perhaps you could add the link to the article?
October 10th, 2008 at 7:53 am
Great article, but I noticed a mistake.
In the example for “Watching the current position”, you use the function getCurrentPosition, instead of watchPosition. Also it would be great to have some more information about how frequently the position is updated.
Also for position.velocity, in which direction is it calculated (latitude, longitude, altitude)? If it’s directionless then surely it’s better renamed to speed, not velocity - see Wikipedia for the distinction.
October 10th, 2008 at 9:42 am
What geolocation data is being used here? Is this allowing sites to view my current location? Questions: (1) How many computers today actually have geolocation hardware so that they will know where the computer is? and (2) How can I restrict this information? I don’t want random sites to know exactly where I am in the world…
October 10th, 2008 at 10:55 am
Chris — you’re right, IMHO it should be “speed” rather than “velocity.” I’ll suggest that.
Jason — The user is asked for permission before revealing location information. Currently, Firefox uses Skyhook’s database (the same one used by the iPod touch and iPhone, for example). It is/will be possible to develop additional data providers for location information, and I’m sure Fennec will offer GPS support for example.
October 10th, 2008 at 10:57 am
I’ve updated the documentation with information about requesting permission and about the Skyhook database being the default information source.
October 10th, 2008 at 3:03 pm
I need to clarify — I was wrong; there are no built-in data providers for geolocation information, and Skyhook support is not planned.