Is it possible to get maximal GPS precision on mobile browser?

后端 未结 2 607
傲寒
傲寒 2020-12-17 04:04

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

I\'ve made tests on mobile devices using

相关标签:
2条回答
  • 2020-12-17 04:34

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

    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.

    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.

    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.

    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.

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

    0 讨论(0)
  • 2020-12-17 04:40

    As per this answer, you could try using the enableHighAccuracy option (if you’re not already).

    But see Why is Geolocation in Mobile Safari way less accurate than the location in a native App? in relation to the iPhone, where it seems like the JavaScript geolocation API in Mobile Safari doesn’t get as accurate location information as the Location Services API for native apps.

    0 讨论(0)
提交回复
热议问题