HTML5的GeoLocation到底如何工作? [英] How, exactly does HTML5's GeoLocation work?

查看:106
本文介绍了HTML5的GeoLocation到底如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道浏览器共享我的IP地址和附近无线网络的详细信息来确定我的位置,但是它知道关于附近wifi网络的什么样的信息?

I know the browser shares my IP address and details of nearby wireless networks to determine my location, but what sort of info does it know about nearby wifi networks?

例如,我所住的地方没有公共无线网络,而从我的家中可以看到大约5个专用网络,但我的位置确定在20米以内.由于附近没有开放的网络,Google如何确定我的位置?我能想到的唯一方法是,当Google为街景视图绘制街道时,它们会绘制所有无线网络的位置.

For example, where I live are no public wireless networks, and from my home I can see about 5 private networks, yet my location is determined within 20 meters. With there being no open networks nearby, how does Google determine my location? The only way I can think of is that Google mapped the locations of all wireless networks when they mapped streets for Street View.

我已经在网上搜索过,但是我找不到任何具体细节.

I've searched about online, but all I can't find any specific details.

推荐答案

由Firefox发送给Google的数据用于<​​em>所有可见的访问点(公共或私有).对于检测到的每个访问点,它将以下数据发送到https://www.google.com/loc/json:

The data sent by Firefox to Google is for all visible access points, public or private. For each access point detected, it sends the following data to https://www.google.com/loc/json:

  "mac_address": "01-23-45-67-89-ab",
  "signal_strength": 8,
  "age": 0,
  "SSID": "MyAccessPoint"

其中

  • mac_address 是WiFi节点的mac地址.
  • signal_strength 是以dBm为单位测量的当前信号强度.
  • age 是自检测到WiFi节点以来的毫秒数.
  • SSID 是名称或 ESSID 的WiFi节点.
  • mac_address is the mac address of the WiFi node.
  • signal_strength is current signal strength measured in dBm.
  • age is the number of milliseconds since the WiFi node was detected.
  • SSID is the name or ESSID of the WiFi node.

用于对请求进行地理编码的地理参考WiFi数据为

The georeferenced WiFi data used to geocode your request was collected when Google was driving around taking pictures for StreetView.

需要特别注意的是,这就是使用Google的Geolocation Services在Firefox上嵌入HTML5地理位置API的方式. 这是一个实现,而不是规范.如果您的设备具有内置GPS,则可能希望HTML5实现直接查询GPS,而不是使用地理位置服务.

It is important to note that, however, that this is how the HTML5 geolocation API is implmeneted on Firefox using Google's Geolocation Services. This is an implementation, not a specification. If your device has a built-in GPS, it is probably desirable that your HTML5 implementation queries the GPS directly, rather than using a geolocation service.

即使firefox在Windows和Linux上实现此功能的方式也有所不同.使用Windows上的当前Firefox,所有可见的WiFi节点的详细信息都会发送到Google.使用依赖libiw 来访问接入点数据.

Even firefox implements this feature differently on Windows and Linux. Using a current Firefox on Windows, details of all visible WiFi nodes are sent to Google. Using a current Firefox on Linux, only details of the currently connected WiFi node is sent, due to the reliance on libiw for access point data.

正如另一位回答者所指出的那样,Safari使用 Skyhook Wireless 的服务与Google的位置功能大致相同服务.

As another answerer noted, Safari uses Skyhook Wireless's service which does much the same thing as Google's Location Services.

这篇关于HTML5的GeoLocation到底如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆