About Html5-geolocation

Source: Internet
Author: User

At the beginning, I wanted to achieve a map effect in my resume: get the current position of HR automatically, and make distance difference with my location. If within the corresponding range, the corresponding dialog box pops up Balabala. The initial code was written and tested in the browser (Chrome for Mac) and the browser was asked to http://www.googleapis.com for latitude and longitude. See this domain name heart is half cold, because of well-known reasons, that is not that what geolocation can not get geographic information. Turn over some documents, ask some experts, found that the problem in the desktop browser may be non-solution.

 

In the HTML5 documentation, the location information about geolocation, including GPS, IP address, RFID, WiFi and Bluetooth MAC address, and Gsm/cdms ID, and so on. But the specification does not specify the use of these equipment sequencing, in the specific implementation, mobile phones and other mobile devices will be preferred to use GPS positioning, and notebook and without GPS tablet, the most accurate location is WiFi, as for the network cable Internet desktop, generally only use IP to locate, accuracy is worrying.

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. However, Firefox, Chrome, opera and other mainstream browsers are provided by Google's API to query, the wall may be very large.

The final possible solution is:do not use this API on your PC. One query API is wall, and secondly, even if not by the wall, at most can only be done by IP address to find your city.

Technically there may be no solution, but there are some ways to solve the problem from an interactive point of view: for example, deliberately locating the error, giving the user the prompt to manually change the current coordinates (by searching or dragging the start pointer).

Before the question asked: https://www.zhihu.com/question/39362267

About Html5-geolocation

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.