My vehicle for learning about HTML5 geolocation was to write another Foursquare application. Since I don’t have a BB or iPhone or an Android phone, I use the Foursquare mobile website to do my check-ins. On that site, I have to do a search of venues to check-in to based on my “current” (i.e., last) city. That is fine if you’re always in the same city, but I bounce between Mississauga and Markham daily. Those cities aren’t even adjacent!
Occasionally, my search results aren’t even close to where I physically am. It would be great if the mobile website knew where I was when I visited the site, but it doesn’t do yet. I wonder how I could solve this problem? Oh right, by using HTML5 geolocation!
I put together a quick Foursquare check-in site called Foursquare Finder that does this. It only works if you have a HTML5 geolocation-capable browser, which is probably Firefox 3.5 (although Safari 5 and Google Chrome may work, but I never tried). Once you give it permission, it will retrieve your current location and then find the check-in venues nearby. You can also filter based on a search term.
The concept works quite well, but technically there seem be some challenges (out of my control). HTML5 geolocation seems to be a nascent technology and I get different results from different computers within the same LAN! I think it has to do with browser or OS version differences. On my netbook, I get an accuracy of ~40m, but my desktop reports an accuracy of 140000m!
And then, half the time, geolocation within the browser won’t work at all, so I use Google APIs as a fallback. For whatever reason, I can’t get the Google API to be accurate at all, it just seems to determine that you’re in a particular city. And not even the right one; when I’m in Markham it puts me in North York, and when I’m in Mississauga, it puts me in Etobicoke!
Hi! and welcome to the eclectic personal blog of Kevin Quan. Come in, stay awhile, peek into the nooks & crannies, and learn a bit about me and my interests.