为什么地理定位不返回准确的地址
谁能向我解释为什么当我允许 HTML5 地理定位演示使用我的位置时它总是返回纽约,但是当我使用手机时它会显示我的确切位置?我正在尝试在我的网站上实现“当前位置”功能,但我不知道是否可行。
谢谢
Could anyone explain to me why when I allow HTML5 Geolocation Demos to use my location it always returns New York, however, when I go on my phone it shows my exact position? I am trying to implement a 'current location' function on my website, though I don't know if it is possible.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的手机具有 GPS 无线电,可以将您的位置范围缩小到十米左右。您的计算机(通常)没有这样的功能。您的浏览器可以使用您的 IP 地址等信息来接近您的实际位置,但它无法实现任何目标就像手机的精度一样。
Your phone has a GPS radio that can narrow your location down to within ten or so meters. Your computer (generally) has no such capability. Your browser can use information like your IP address to get close to your actual location, but it can't achieve anything like your phone's precision.
您的手机可以使用许多附加信息,可以比典型的有线桌面更准确地确定您的位置。值得注意的是:
GPS
的信号强度一般而言,GPS 在可用时可能会提供最高的准确度。在晴朗的天空视野下,大多数手机都可以使用 GPS 对您进行地理定位,误差范围在 5 米或更短的范围内。
Wi-Fi
Google/Apple 等公司拥有与已知 AP SSID 相匹配的信息/MAC 地址到地理位置。手机能够将信息发送到服务(例如 Google 的 地理定位 API )关于它可以看到的 AP 及其信号强度。该服务根据对这些 AP 的了解以及服务提供商用于根据 AP 信号强度确定位置的任何专有算法返回位置估计。
手机信号塔
与 Wi-Fi 信息非常相似,您的手机可以将手机信号塔可见性/信号强度信息发送给服务,该服务可以根据对正在考虑的手机信号塔的了解来估计位置。
以下是手机可能向 Google 地理定位服务发送的内容示例(逐字复制)来自链接):
请注意,示例中的某些信息甚至比我所描述的更详细。但您可能会了解典型的现代手机提供的有关位置的提示,而台式机则无法提供。
根据我个人的经验,基于 Wi-Fi/蜂窝塔的地理定位不如 GPS 准确,但也相当不错。例如,在没有 GPS 芯片的基本型号 iPad 上,仅依靠 Wi-Fi/手机信号塔,我通常可以获得 50 米范围内的精确度。在人口更密集的 Wi-Fi 区域(例如在城市),我认为准确度会更好,并且随着时间的推移会继续变得更好。
There are a number of pieces of additional information available to your phone that can be used to determine your location more accurately than on a typical wired desktop. Notably:
GPS
Generally speaking, GPS when available is likely to give the highest accuracy. With a clear view of the sky, most phones can geolocate you using GPS to within 5 meters or less.
Wi-Fi
Companies like Google/Apple have information matching known AP SSIDs/MAC addresses to geographic locations. A phone is able to send information off to a service (such as Google's geolocation API) about the APs it can see and their signal strength. The service returns an estimate of location based on what it knows about those APs and any proprietary algorithms the service provider uses to determine location based on AP signal strengths.
Cell towers
Much like Wi-Fi information, your phone can send off cell tower visibility/signal strength information to a service which can estimate location based on what it knows about the cell towers under consideration.
Here's an example of what a phone might send off to Google's geolocation service (copied verbatim from the link):
Note that some of the information in the example is even more detailed than what I've described. But you probably get the idea about the kind of hints regarding location that a typical modern phone provides that a desktop machine can't.
From my personal experience, Wi-Fi/Cell tower based geolocation is not as accurate as GPS, but can be quite good. For example on a base model iPad without a GPS chip, I can often get accuracy within 50 meters based off Wi-Fi/cell towers alone. In more densely populated Wi-Fi areas (e.g. in the city) I imagine the accuracy is even better and will continue to get better over time.