Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does HTML5 Geolocation Work?

Chrome and Firefox have HTML Geolocation implemented.

My question is: how does it work? Do they have a Database locally and get the information from the provider then try to match it?

Where is the DB stored ? Can it be accessed ?

Update1: the only downside to geolocation is the browser has to ask the user for permission and this is really a bad thing for usability. I understand the security issue but still I don't see how this will become a popular solution.

Update2 : Firefox is using a Google WebService to detect the location. Now this seems very strange considering they are competitors now. Also this behavior it's really unexpected for me... I hopped each browser will have it's on (maybe offline) solution.

Update3 : So the browsers actually sniff for routers using your wireless network card?

Update4 : In the end what informations is the browser sending to the the google webservice ? The detected SSID seems ok ( and it makes sense that if they are tracked by google based on their physical position to make a lookup in the database for matching informations ) but how does it work so well in country where google didn't scanned this ? The other info your browser is sending is your ip but this is not enough to pin point your exact location right ?

Regarding other browsers that might implement this. How should they do it ? The api is not documented only the old deprecated GEAR api gives some clue. So this is not really public.

like image 503
johnlemon Avatar asked Nov 18 '10 09:11

johnlemon


People also ask

How is geolocation implemented in HTML5?

If supported, run the getCurrentPosition() method. If not, display a message to the user. If the getCurrentPosition() method is successful, it returns a coordinates object to the function specified in the parameter (showPosition) The showPosition() function outputs the Latitude and Longitude.

How accurate is HTML5 geolocation?

How accurate is HTML5 geolocation? HTML5 geolocation is more accurate than other tracking methods, like IP geolocation. However, it is best used for devices that feature a GPS, like a smartphone. While it can work for desktops, HTML5 is best suited for GPS devices.

How does HTML5 geolocation work explain with the help of code snippet?

HTML5 Geolocation. The Geolocation is one of the best HTML5 API which is used to identify the user's geographic location for the web application. Most of the geolocation services use Network routing addresses such as IP addresses, RFID, WIFI and MAC addresses or internal GPS devices to identify the user's location.

Does HTML5 have geolocation?

The HTML5 geolocation feature lets you find out the geographic coordinates (latitude and longitude numbers) of the current location of your website's visitor.


1 Answers

First, an amazing demo

Try this in Chrome.

How it works

Here is your answer. Click on "How Google Chrome determines your location".

From that page:

If you allow Google Chrome to share your location with a site, the browser will send local network information to Google Location Services to get an estimate of your location. The browser can then share your location with the requesting site. The local network information used by Google Location Services to estimate your location includes information about visible WiFi access points, including their signal strength; information about your local router; your computer's IP address. The accuracy and coverage of Google Location Services will vary by location.

Google Chrome saves your location information so that it can be easily retrieved. This information is periodically updated; the frequency of updates depends on changes to your local network information.

Also, I believe that Google Location Services contains a database built from data collected by Google Street View vans as they match locations with WiFi signals from routers (or at least used to).

Accessing the database

As for the database (Google Location Services), this SO question will help you access it.

like image 103
Chetan Avatar answered Sep 28 '22 02:09

Chetan