HTML5 的 GeoLocation 究竟是如何工作的? [英] How, exactly does HTML5's GeoLocation work?

查看:27
本文介绍了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 的数据适用于所有可见的访问点,无论是公共的还是私有的.对于检测到的每个接入点,它会将以下数据发送到 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 数据是 谷歌开车时为街景拍照时收集的.

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

需要注意的是,这就是 HTML5 地理定位 API 在 Firefox 上使用 Google 的地理定位服务实现的方式.这是一种实现,而不是规范.如果您的设备具有内置 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.由于 在 Linux 上使用当前的 Firefox,仅发送当前连接的 WiFi 节点的详细信息依赖 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 的 Location 大致相同服务.

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天全站免登陆