Geolocation API tests

I’m adding geolocation to my windhistory project. It’s a very easy API. Some quick notes based on a call to getCurrentPosition() with a few options: { maximumAge: 1000*60*60, timeout: 1000*2, enableHighAccuracy: false}

Chrome on MacOS seems to use IP address to identify what city I’m in. It puts me at 37.775/-122.419, the middle of San Francisco, whether my WiFi is on or not.

Safari on MacOS seems to require WiFi location. It won’t geolocate at all if wifi is turned off; the Javascript API returns error -2 (no position available). With WiFi on it seems to use the same airhook style location as the iPhone. It puts me at 37.749/-122.428, which is just about where I’m sitting. MacOS has privacy System Preferences for location services. The geolocation API stops working if you disable location services entirely, but it’s not necessary to have “Safari” checked in order for Safari to geolocate you. That seems like a bug, even if Safari itself is doing some privacy protection.

Firefox 6 on MacOS also seems to use WiFi location, 37.749/-122.428. Didn’t test what it did without wifi.

MSIE 9 on Windows 7, running in a VirtualBox VM on my Mac, gives me a slightly different location of 37.748/-122.416. I’ve got no idea where it got that idea, but it’s a pretty good fix. Certainly not wifi! Maybe Microsoft has a geolocation service guessing based on external IP?

Firefox 4 on Windows 7 (in the VM) puts me at 37.775/-122.419, just like Chrome.

Bottom line: Chrome seems to use an IP database, Safari and Firefox use the Mac API, and who knows what IE is doing.