Location-Based Services: GPS Prerequisites
As regular readers already know, location-based services are a topic of particular interest to me in recent times. And as I explained a few weeks ago, more robust location-detection features were a key reason why I decided to buy an unlocked iPhone 3G on eBay after having purchased a first-generation iPhone one day earlier. As such, when I read two weeks ago that Google had added "My Location" capabilities to Google Maps, I was motivated to give the service a near-term whirl. In retrospect, my enthusiasm was misplaced.
According to the blog post by Google’s Steve Block (Software Engineer) and Noam Ben Haim (Product Manager):
When you visit Google Maps with a supported web browser, you’ll see a new My Location button in the top left corner of the map. Simply click the button to center the map to your approximate location. If your location can be determined accurately enough, it’s shown with a blue circle, just like on Google Maps for Mobile. Click the button again to remove the blue circle, or to re-center the map after you’ve moved it away…
To obtain your location, Google Maps takes advantage of the W3C Geolocation API standard. The Geolocation API is a new feature available in the latest web browsers which allows any website to access your current location. If you use Internet Explorer, you might be familiar with My Location in Google Toolbar, which is able to provide your location in Google Maps, but this is limited to Internet Explorer. Using the new Geolocation API allows My Location to work in any browser that provides the feature. Currently, you can use My Location in Google Maps if you use Google Chrome, Firefox 3.5 or any other web browser with Gears installed. We hope to support other browsers soon too. You won’t see the My Location button on browsers that don’t support the feature.
So how does it work? When you activate the My Location feature, Google Maps asks your web browser for your location. Typically, your browser uses information about the Wi-Fi access points around you to estimate your location. If no Wi-Fi access points are in range, or your computer doesn’t have Wi-Fi, it may resort to using your computer’s IP address to get an approximate location. As you’d expect, the accuracy of My Location varies with your location, and in some cases, Google Maps may not be able to provide a location at all…
I first tried My Location on the developer preview of the Chrome browser (not the upcoming operating system) for OS X. Although I was presented with the My Location button, it seems not to work on this early Chromium release, as I got nothing back but a perpetually spinning circular cursor.
Next up was the latest public build of Chrome for Windows. Even though the laptop was connected to my Wi-Fi access point-inclusive router, my LAN’s hardware is apparently not in Google’s location-based database. Google thinks I’m in downtown Sacramento, ~2 hours’ drive southwest of me:
Finally, I fired up Firefox for OS X. Even though I’m still running v3.0.12, I have Google Gears installed, so My Location was available. Again, I ended up with a 100-mile discrepancy from reality:
What’s with the invalid relocation? I suspect that my AT&T DSL service’s DHCP assignments come from a Sacramento-based server. My computer has no built-in GPS or cellular access capabilities. Since my WAN IP address assignment is therefore the only information Google has available to it, Sacramento is where it places me.
The cellular tower triangulation capabilities built into the first-generation iPhone are likely more robust than the crude IP-based approach Google’s relying on with browser-based My Location. And perhaps I’ll have better luck when I re-attempt My Location the next time I’m in a more urban setting,or at least connected to a hotspot that’s served by someone like AT&T or T-Mobile and that’s therefore more likely to be in Google’s database. Still, it’s clear to me that satellite-sourced coordinates result in the closest-possible longitude and latitude match.