如何HTML5地理位置工作? [英] How does HTML5 Geolocation Work?

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

问题描述

Chrome和Firefox都有HTML地理位置实现的。

Chrome and Firefox have HTML Geolocation implemented.

我的问题是:它是如何工作的?他们有本地数据库,并从供应商的信息然后尝试搭配呢?

My question is: how does it work? Do they have a Database locally and get the information from the provider then try to match it?

在哪里DB存储?
是否可以访问?

Where is the DB stored ? Can it be accessed ?

UPDATE1:唯一的缺点地理位置是浏览器必须请求许可用户,这是真的可用性坏事。我理解的安全问题但我仍然不明白这将如何成为一个流行的解决方案。

Update1: the only downside to geolocation is the browser has to ask the user for permission and this is really a bad thing for usability. I understand the security issue but still I don't see how this will become a popular solution.

UPDATE2:Firefox是使用谷歌的WebService来检测位置。现在,这似乎很奇怪考虑到他们是竞争对手了。同时这种行为这对我来说真的太意外了......我跳上每个浏览器都会有它的上(可能离线)解决方案。

Update2 : Firefox is using a Google WebService to detect the location. Now this seems very strange considering they are competitors now. Also this behavior it's really unexpected for me... I hopped each browser will have it's on (maybe offline) solution.

UPDATE3:那么浏览器实际使用你的无线网卡嗅探路由器

Update3 : So the browsers actually sniff for routers using your wireless network card?

UPDATE4:在被浏览器发送到谷歌的Web服务是什么信息结束了吗?检测到的SSID似乎确定(和它是有道理的,如果他们是由谷歌根据自己的身体位置,使匹配的信息在数据库中查找跟踪),但它是如何在国家,谷歌并没有扫描这方面的工作这么好?其他信息您的浏览器发送是你的ip,但这是不够的,针点的确切位置吗?

Update4 : In the end what informations is the browser sending to the the google webservice ? The detected SSID seems ok ( and it makes sense that if they are tracked by google based on their physical position to make a lookup in the database for matching informations ) but how does it work so well in country where google didn't scanned this ? The other info your browser is sending is your ip but this is not enough to pin point your exact location right ?

对于有可能实现这个其他浏览器。他们应该怎么做呢?老德precated GEAR API提供了一些线索的API不仅记录。因此,这不是真正的公开。

Regarding other browsers that might implement this. How should they do it ? The api is not documented only the old deprecated GEAR api gives some clue. So this is not really public.

推荐答案

有关它的价值,API规范本身是不可知的地理位置实现。因此,虽然这是真的,Mozilla Firefox和谷歌浏览器都依赖于通过谷歌的位置服务数据库网络功能的地理位置,这不是标准的要求。例如,移动Safari浏览器在您的iPhone将在某些情况下,利用全球定位系统,而不是WiFi的三角或细胞内的地理位置,根据什么位置服务是在给定时刻最精确和方便。

For what it's worth, the API specification itself is agnostic to the geolocation implementation. So while it's true that Mozilla Firefox and Google Chrome both rely on network-enabled geolocation via Google's Location Service database, that's not a requirement of the standard. For example, Mobile Safari on your iPhone will in some cases use GPS rather than WiFi-triangulation or cell-site geolocation, depending on what location service is most accurate and accessible at a given moment.

和我们希望,未来的浏览器将提供位置提供一些选择。我同意,这将有利于用户的隐私和功能,如果浏览器都支持这并不需要发送的WiFi ID列表给第三方的地理定位技术;我怀疑,如GPS传感器更经常地集成到智能手机和笔记本电脑,我们将看到让你使用GPS感应对W3C地理位置API的浏览器。这也可能是不错的所在位置可在浏览器设置中手动指定台式电脑的功能,这也将是与目前的规范相兼容。

And we can hope that future browsers will provide some choice of the location provider. I agree that it would be good for user privacy and functionality if browsers supported geolocation technologies that didn't require sending a list of WiFi IDs to a third party; I suspect that as GPS sensors are more often integrated into smartphones and laptops, we'll see browsers that let you use GPS sensing for the W3C Geolocation API. It might also be nice to have a feature for desktop computers where the location can be manually specified in browser settings, this would also be compatible with the current spec.

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

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