What is the principle of geolocation acquiring a geographical location in HTML5?

Source: Internet
Author: User

http://www.zhihu.com/question/20473051?sort=created

Geolocation's location information sources include GPS, IP address, RFID, WiFi and Bluetooth MAC address, and Gsm/cdms ID, among others. The specification does not specify the sequence of use of these devices, in the implementation of HTML5, mobile phones and other mobile devices, of course, priority to use GPS positioning, and notebook and some flat, the most accurate location is WiFi, as for the network cable Internet desktop, generally only use IP to locate, this accuracy is lowest.

In these methods, GPS positioning is best understood, the satellite directly gives the location data. and the WiFi and IP address location, are not the browser itself can be achieved. Both of these methods must be the IP address or the WiFi signal collected around the routing information, upload to a server, the server's query calculates the location information, and then returned to the browser. Who will provide these query services?

The first thing to look at is chrome, which is obviously a service that Google itself offers. With Chrome's own Capture Method (chrome://net-internals/), you can see that when you use geolocation, Chrome www.googleapis.com/geolocation/v1/ Geolocate interface sent a request, because the request with Spdy encryption, so do not see the specific content, only a bit can be determined, that is, WiFi Internet, is the post method of data transmission, while using the network cable, using the get.

Firefox also uses Google's services, but unlike Chrome's interface, this ishttps://maps.googleapis.com/maps/api/browserlocation/json

The request data is: Browser=firefox&sensor=true&wifi=mac:xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-43&wifi=mac: Xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-43&wifi=mac:xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-43&wifi=mac: Xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-44&wifi=mac:xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-60&wifi=mac: Xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-61&wifi=mac:xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-62&wifi=mac: Xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-63&wifi=mac:xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-63&wifi=mac: Xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-67&wifi=mac:xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-67&wifi=mac: Xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-67&wifi=mac:xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-67&wifi=mac: Xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-74&wifi=mac:xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-82&wifi=mac: xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-84&wifi=mac:xx-xx-xx-xx-xx-xx%7cssid:xxxxxxx%7css:-85

This is very clear, is the perimeter WiFi device SSID, MAC address, and signal strength. (corporate network, route name and MAC address are hidden.) )

Opera uses Google's service, the interface URL is not available, but from the IP address, is also Google's IP.

For browsers that do not support geolocation, you could have called the interface provided by Google's Gears project to query the location, but the service has stopped in 2011 and has not seen a better alternative for the time being.

What is the principle of geolocation acquiring a geographical location in HTML5?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.