in Frontend Tech, News

geolocation in Firefox 3.5

I came crossed geolocation feature that was introduced in Firefox 3.5. That is very neat functionality that marketings will love for targeted ads. And also for web developer/engineers, it’s something that we can customize the web content based on the users’ location.

It used to require somewhat complex process to get (not technology side tho) the information.

Anyways, in this link you get to see how to access the core API for.

And then here’s the properties of position object:

  • QueryInterface
  • coords : xpconnect wrapped
  • timestamp
  • getInterfaces
  • getHelperForLanguage
  • contractID
  • classDescription : wifi geo location position object
  • classID
  • implementationLanguage
  • flags : 8
  • SINGLETON : 1
  • THREADSAFE : 2
  • MAIN_THREAD_ONLY : 4
  • DOM_OBJECT : 8
  • PLUGIN_OBJECT : 16
  • EAGER_CLASSINFO : 32
  • CONTENT_NODE : 64
  • RESERVED

And interestingly position.coords has some unique properties:

  • QueryInterface
  • latitude
  • longitude
  • altitude
  • accuracy
  • altitudeAccuracy
  • heading
  • speed

As you can see it has speed property. So in theory, with the available properties you can make GPS system on the web.