Does getCurrentPosition() use GPS navigation?
If I use navigator.geolocation.getCurrentPosition()
in any web page and visit it using web browser of any mobile device wi开发者_运维技巧th GPS, will it use GPS navigation?
The Geolocation API is agnostic of the underlying location information sources and therefore it is up to the browser (and device) to determine how the geolocation data is determined.
See here for more details on how Firefox gets the geo location information from Google, http://code.google.com/p/gears/wiki/GeolocationAPI
Short answer is: they keep a database with the location of all wifi hotspots (most likely collected by the same cars that take streetview footage) and uses that information to provide location data.
精彩评论