Work in progress: HTML5 Geo location extension for Joomla
Written by Ian Norton Tuesday, 27 July 2010 16:12
As the internet moves from desks and laps into peoples hands in the form of mobile phones, I've began to think of the opportunities that this change in usage habits is bringing about. We currently search for information on the basis of it's title, date or a category within websites, with HTML 5, we're able to detect a users location quite accurately using geo location and serve up content based on their position. Suddenly rather than struggling to find a restaurant nearby as Google's offering us search results from around the world, we're able to refine our search to just our immediate surroundings.
How could this be useful for CMS?
Any content management system would quickly be capable of offering up geo-sensitive information to a user if the longitude and latitude of an article are entered when saving an item. We can take it another step and start publishing the collected data in RDF format to allow search engines and other sites to make use of the data, enabling more geo sensitive devices to find content that's relevant to them.
How does it work?
Wifi hotspots tend to be tied to specific locations, more so when there's a collection of several, Google and SkyHook have been capturing this data for the last few years and are now able to calculate your location based on your surrounding wifi networks. If wifi's not available, then fallbacks may be used:
- The last known location of a device is saved locally
- The surrounding mobile network mast identifiers
- A devices GPS can provide a very accurate location but requires a lot more power and rarely works indoors.
Pitfalls and problems
Obtaining a users geographic position from a device is currently very hit and miss on the desktop, firstly, when connected to ethernet I got nothing returned using any browser. In testing I found that Firefox (3.6.8 OSX) was flaky when returning my position, the best it got was 50 metres away (brilliant), the worst was 100 miles away in London, and it also thought I was at my old house that I moved from 4 weeks ago, whilst these issues are annoying they are manageable. All data returned by the HTML 5 geo web service contains an accuracy paramater, if the data's not accurate we could simply ignore it. Others who tested a demo page reported similar findings, both Firefox and Safari were slow at times to return location data, making the user think they'd stalled.
Mobile wins each time
Testing on my iPhone and iPad (wifi model) I got pretty accurate results, within 5 metres on my iPhone and 30 metres on the iPad. The iPhone is assisted by having GSM, UMTS and GPS radios that it can use as either fallbacks or in the case of GPS, get a very accurate reading. The iPad gave identical results as desktop Safari (as expected) It seems that with only the local wifi networks to rely on results can be a little off - with a mobile device there's far more fallbacks when data looks a little odd.
Handle errors and offer alternatives
It's important to offer an alternative to people who can't or won't provide their location data, this can be in the form of a post code look up, or by dropping a pin into a map and doing a search around that area.
Next..
I'm hoping to have a demo of the Joomla extension ready in the next week and aim to make it available on the Joomla Extension Directory.