iPhone - 本机应用程序 GeoLocation VS Web 应用程序 GeoLocation

发布于 2024-08-18 07:21:17 字数 352 浏览 5 评论 0原文

这是我的情况;我构建了一个非常简单的网络应用程序,可以查找用户位置并将其绘制在谷歌地图上。 这是我的代码: http://pastebin.com/d3a185efd

当我测试它时,我的位置被检测为 > ;= 距离我实际站立的地方 500 米。

但是

当我打开 Google 地图或 Gowalla 时,我的位置是否正确到小于 20 米?

所以我的问题是:原生 iPhone 应用程序是否比网络应用程序受益于更高的准确率?

如果是这样,为什么?

Here's my situation; I've built a very simple web app that looks up a users location and plots it on a Google map.
Here's my code: http://pastebin.com/d3a185efd

When I test it, my location is detected as being >= 500 meters from where I actually stand.

BUT

When I open up Google Maps or Gowalla my location is correct to within <20 meters?

So my question is: Do native iPhone apps benefit from a higher accuracy rate than web apps?

If so, why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

心作怪 2024-08-25 07:21:17

根据规范,webapp 地理定位应该使用在任何情况下最有效的定位方法 - 因此从理论上讲,人们会假设它在可用时使用 GPS。 rohit 的“最佳答案”中链接的讨论对我来说似乎并不是决定性的 - 这是另一个讨论,有人向您报告了类似的问题,而其他用户则声称获得了准确的 GPS 数据(向下滚动到 9 月 26 日至 28 日的评论) ):

http://www.thecssninja.com/javascript/geolocation-iphone

但是看来地理定位的东西仍然有问题。我怀疑你的问题基本上是一些错误。

According to the specification, webapp geolocation should use whatever positioning method works best in any situation - so in theory, one would assume it uses GPS when available. The discussion linked in the "best answer" by rohit doesn't seem conclusive to me - here is another one, with someone reporting a similar problem to yours and other users professing to getting accurate gps data (scroll down to comments 26-28 Sept):

http://www.thecssninja.com/javascript/geolocation-iphone

But it does seem like the geolocation stuff is buggy still. I'd suspect your problem is basically that, some bug.

眼眸里的那抹悲凉 2024-08-25 07:21:17

根据以下链接,我相信您是通过塔三角测量而不是使用 GPS 在网络应用程序中获取坐标。我真的怀疑GeoIP能否给出500米以内的坐标。

http:// phonegap.lighthouseapp.com/projects/20116/tickets/16-navigatorgeolocation-does-not-make-use-of-gps-data

Based on the following link, I believe you are getting coordinates in web app through tower triangulation and not using GPS. I really doubt if GeoIP can give coordinates within 500 meters.

http://phonegap.lighthouseapp.com/projects/20116/tickets/16-navigatorgeolocation-does-not-make-use-of-gps-data

花海 2024-08-25 07:21:17

地理定位 API 允许高精度参数。
http://dev.w3.org/geo/api/spec-source .html#position_options_interface
(但需要额外的电池,所以最好少用)
你测试过吗?

布尔值:enableHighAccuracy

The geolocation API allows for a high accuracy parameter.
http://dev.w3.org/geo/api/spec-source.html#position_options_interface
(But uses extra battery, so probably best use sparsely)
Have you tested that?

Boolean: enableHighAccuracy

帅的被狗咬 2024-08-25 07:21:17

我认为你会得到不同的结果,因为你忽略了时间的方面。 GPS 会消耗大量电池,并且仅根据命令启动。

HTML5 getCurrentPosition 在 GPS 有机会准确定位您的位置之前拍摄坐标快照。另一方面,谷歌地图应用程序启动,然后观察您的位置,准确性随着时间的推移而增加(你们都知道标记如何移动)。 HTML5也支持观看位置这一功能。

旁注!根据我在 iPhone 上的经验,该设备实际上会存储您的位置一段时间,这意味着如果我启动 Google 地图并让它“区域”在我的位置上,关闭它,然后启动我的网络应用程序并使用 getCurrentPosition 我得到同样准确的读数。

准确性就是让 GPS 发挥其作用。

I think you are getting different results since you are overlooking the aspect of time. The GPS uses lots of battery and only starts up on command.

The HTML5 getCurrentPosition takes a snapshot of the coordinates before the GPS has had a chance to accurately 'zone in' on your position. The Google Maps app on the other hand starts and then watches your position, accuracy increasing over time (you all know how the marker moves). HTML5 also supports this feature of watching the position.

Side note! In my experience from the iPhone, the device will actually store your position for a little while, meaning that if I start up Google Maps and let it 'zone in' on my position, close it and THEN start my webapp and use getCurrentPosition I get an equally accurate reading.

Accuracy is all about letting the GPS do its thing..

烟凡古楼 2024-08-25 07:21:17

我认为 web 应用程序依赖于 geoip 服务(尽最大努力...)将您的 IP 地址转换为 GPS 坐标。
ex: service ex

但是这种获取坐标的方式不如“经典”那么准确一种使用 GPS 设备(例如 3G 或 3Gs iPhone 中包含的设备)来真正检索您的实际位置,而不是像 geoip 服务那样以最佳方式近似它。

更新:例如,在笔记本电脑上使用谷歌地图时使用 GEOIP,但也许您的问题是:“当我在网页中使用 HTML 5 位置对象时,它来自 GPS 硬件还是来自 geoip 服务?”。我真的不能说,我想说它使用 geoip 服务而不是 GPS 硬件,但我不能 100% 确定......

I think that a webapp relies on a geoip service that (does its best to...) converts your IP address into a GPS coordinate.
ex: service ex

However such way to retrieve a coordinate cannot be as accurate as the "classic" one that uses a GPS device (such as the one included in the 3G or 3Gs iphone) to really retrieve your actual location and not approximate it at its best like a geoip service.

UPDATE: GEOIP is used when using google maps on a laptop for instance, but maybe your question was : "when I use the HTML 5 position object in my web page, does it comes from the GPS hardware or from a geoip service ?". This I couldn't really tell, I would say it uses geoip service instead of GPS hardware but I'm not 100% sure...

暖阳 2024-08-25 07:21:17

对于google geo api,它首先尝试通过设备gps找到您的位置,如果失败,它会进行单元三角测量(虚拟gps),如果失败,它会尝试使用wifi mac和ip地址,最后一次尝试是使用客户端IP来获取他的位置地点

for google geo api first it tries to find your location by device gps , if failed it goes cell triangulation (virtual gps) if failed it try to use to wifi mac and ip addresses , the last try is to use the client IP to get his location

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文