How does the HTML5 Geolocation API work?

ε祈祈猫儿з 提交于 2019-12-25 01:47:05

问题


I am wondering how the HTML5 Geolocation API works. What I need to know is, the obtained latitude and longitude belongs to whom? Is it the location of the ISP, as I think there is no GPS device attached to my PC or the laptop? Also if it is obtained from the SSID of the WiFi device? Does the WiFi device know it's coordinates?


回答1:


From the W3C Geolocation API Specification (emphasis mine):

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.

Your browser will use the hardware provided to it by "the device hosting the implementation," but neither consistency nor accuracy are guaranteed.



来源:https://stackoverflow.com/questions/28496085/how-does-the-html5-geolocation-api-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!