84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
小伙看你根骨奇佳,潜力无限,来学PHP伐。
请看 html5 关于 Geolocation API 规范的描述:
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.
来源
这已经指明了这个API返回位置的源信息来自于GPS、IP、RFID、WiFi、蓝牙MAC地址、GSM/CDMA,甚至户输入。并不保证得到结果是设置所在的实际位置。因此,如果源信息设备能提供GPS信号则返回的结果就准确,如果测试模拟的设备根本获取不到GPS信息,那么只能通过其他允许的信号源了,就这里而言很可能是IP地址。精度当然差很多
navigator.geolocation得到的坐标是按wgs84标准来的,高德的坐标系貌似是按gcj02标准来的,你需要转换下才能判断是否是准确的。
请看 html5 关于 Geolocation API 规范的描述:
来源
这已经指明了这个API返回位置的源信息来自于GPS、IP、RFID、WiFi、蓝牙MAC地址、GSM/CDMA,甚至户输入。并不保证得到结果是设置所在的实际位置。因此,如果源信息设备能提供GPS信号则返回的结果就准确,如果测试模拟的设备根本获取不到GPS信息,那么只能通过其他允许的信号源了,就这里而言很可能是IP地址。精度当然差很多
navigator.geolocation得到的坐标是按wgs84标准来的,高德的坐标系貌似是按gcj02标准来的,你需要转换下才能判断是否是准确的。