Recently, I've begun to see the geolocation API at work in my browsers. The crazy thing is, they're the most accurate Geolocation I've ever had. I live in va and most other geolocation services make it look like i live in new jersey or chicago. So whre do thes开发者_如何学运维e browsers get this data?
Firefox is getting your location from Google location service. It is well explained on http://www.mozilla.com/en-US/firefox/geolocation/ . You should check out this too: http://googlecode.blogspot.com/2009/04/google-location-services-now-in-mozilla.html
You can also check firefox implementation, https://developer.mozilla.org/En/Using_geolocation . It uses the Gears geolocation API.
It seems obvious that Chrome is using the same API.
Firefox and Chrome get their geolocation data from Google's geolocation service, as documented above. Apple's Safari gets its data from Skyhook. Google's data comes from two sources:
When Google wardrives taking photos for street view, they also sniff wireless access points and cell phone cell ids. The geolocation service sends the MAC address of nearby wireless APs and cell ids to google, who presumably do some triangulation in their database to come up with the accurate location.
If you don't have any wireless or cell phone connectivity it uses your ip address. This is far less accurate.
精彩评论