是否有可能在移动浏览器上获得最大的 GPS 精度? [英] Is it possible to get maximal GPS precision on mobile browser?

查看:17
本文介绍了是否有可能在移动浏览器上获得最大的 GPS 精度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从网络浏览器中以移动设备上可用的最大精度接收 GPS 位置?

Is it possible to receive GPS position with the maximal precision available on a mobile device from within the web browser?

我使用 HTML5 Geolocation 中的 getCurrentPosition()watchPosition() 在移动设备上进行了测试,并在办公楼周围走动.我在 Android HTC Desire(Android 浏览器)和 iPhone 3(Safari)上收到了 70m 的最大精度,没有高度/速度数据,打开了 WiFi.WiFi关闭后,精度下降到800-1000米.

I've made tests on mobile devices using both getCurrentPosition() and watchPosition() from HTML5 Geolocation, walking around an office building. I've received on Android HTC Desire (Android Browser) and iPhone 3 (Safari) maximal precision of 70m, and no altitude/speed data, with WiFi turned on. After the WiFi was turned off, accuracy fell to 800-1000 meters.

同时,在 Android 上的 GPS 测试应用中,我收到了 14m 的 GPS 定位精度,以及高度和速度数据.

In the same time, on GPS Test app on Android, I've received GPS position accuracy of 14m, and additionally altitude and speed data.

因此,正如我所见,我在移动浏览器中的两种设备中都没有收到 GPS 上可用的完整数据集,也没有收到设备传感器可能达到的精度.

So, as I see, I've not received in both devices in mobile browser either the full data set available on GPS, nor the precision possible for device sensors to reach.

那么,我的问题是,浏览器接收到的GPS数据集是受限于设备,还是浏览器本身不能充分利用?我想在我的网络应用程序中获得完整的 GPS 精度,而无需编写普通"移动应用程序.

So, my question is, is the GPS data set that browsers receive is limited by devices, or can the browser itself not make full use of it? I would like to have full GPS precision in my web application without need to write a 'normal' mobile app.

推荐答案

好的,我的同事给了我很有价值的提示.

OK, my work-collegue gave me very valuable hint.

出于安全原因,Android 的内置浏览器(因此,Android 浏览器,我已在其上进行了测试)无法获得完全精确的 GPS 位置.精确度随着预谋而降低.因此,当 WiFi 关闭时,我得到的响应是精度为 800-1000 米.开启 WiFi 后,我收到的回调准确度约为 70 米.

For security reasons, built-in browser for Android (so, Android browser, on which I've made tests) doesn't get GPS location with full precision. Precision is with premeditation lowered. So that, when WiFi was switched off, I've got response that accurance is 800-1000 meters. With WiFi turned on, the accurance I've received on callback was abount 70 meters.

所以,我使用 Opera Mobile 和 Firefox 进行了测试,它们需要获得许可才能在安装时从 GPS 获取准确位置(与 GPS 测试相同).这些浏览器,在关闭 GPS 后,接收到的数据具有准确性 <10 米,与原生应用相同.

So, I've made test with Opera Mobile and Firefox, which are requiring permission to get accurate location from GPS when installed (same as GPS test). These browsers, after switching GPS off received data with accurance < 10 meters, same as native app.

因此,Android 的答案是:不要将 Android 浏览器用于您希望获得高精度 GPS 位置的网站.似乎谷歌人决定,如果用户不接受 Android 浏览器的 GPS 精确位置,他可能不知道这个浏览器向 WWW 站点提供了如此精确的数据.至于 Opera 和 Firefox - 这是用户安装的应用程序,所以这是他的选择.

So the answer for Android is: do not use Android Browser for web sites, for which you want to get GPS location with high accuracy. It seems that Google people decided, that if user did not accepted GPS precise location for Android Browser, he may not be aware, that this browser gives so precise data to WWW sites. As for Opera and Firefox - it's user-installed app, so it's his choice.

关闭 WiFi 的 iPhone 测试为 Safari 提供了 50 米的精度.因此,与 Android 相比,准确性的限制要小得多,但是有限制.但是,用其他支持 HTML5 的浏览器替换 Safari 存在问题,因为 Opera 停止了 iPhone 的开发.

The test for iPhone with WiFi switched off gave 50 meters precision for Safari. So the accuracy is much less restricted as for Android, however the restriction is made. However, there's a problem with replacing Safari with other HTML5-supporting browser, since Opera stopped its development for iPhone.

所有测试均在办公楼外进行,此时可看到 10-12 个 GPS 发射器.

All tests were made outside of the office building, when 10-12 GPS transmitters where in sight.

这篇关于是否有可能在移动浏览器上获得最大的 GPS 精度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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