Possible Duplicate:
HTML5 Precise GeoLocation

I'm not sure if this question should be asked here or not by here it goes:

In html5 there is a function navigator.geolocation.getCurrentPosition which can locate your position. I've tested this function in IE, chrome, and firefox. While IE doesn't seem to be very accurate, firefox and chrome were able to locate my position with only 10 meters error. Considering that I'm using a laptop, connected to internet though a wimax router via wireless connection, and I'm sure my laptop doesn't have any GPS devices, do you have any ideas how are they finding my location.

I'm sure it's not based on IP since all sites working with IP just give results way off my actual position. and it doesn't seem to be some protocol which browsers use to ask my ISP since IE does not give same results as others.


The Geolocation API defines a high-level interface to location information associated only with the device hosting the implementation, such as latitude and longitude. The API itself is agnostic of the underlying location information sources. Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs, as well as user input. No guarantee is given that the API returns the device's actual location.



Additionally, @fmark's answer at StackOverflow has more details on how it's implemented in Firefox. Implementation varies across browsers and platforms.

The data sent by Firefox to Google is for all visible access points, public or private. For each access point detected, it sends the following data to https://www.google.com/loc/json:

"mac_address": "01-23-45-67-89-ab",
"signal_strength": 8,
"age": 0,
"SSID": "MyAccessPoint"

{ . . . }

Not the answer you're looking for? Browse other questions tagged or ask your own question.