Why is Geolocation in Mobile Safari way less accurate than the location in a native App?

人走茶凉 提交于 2019-12-04 06:15:24

Old: Here are the test result for getCurrentPosition function with wifi turned off on android 2.2, iOS4, and iOS5.

On both android browser and iOS 4 Safari, I'm getting GPS accuracy level in magnitude of 1000 meters. But on iOS 5 Safari, I'm able to get down to 5 meter accuracy. Seems GPS has improved on iOS 5, but it is just a small slice of the market out there. Overall, it is still not good to develop web app that relies on accurate GPS reading.

Something I found during testing - the android browser GPS stops responding after about 70 calls made to getCurrentLocation. This might be a device specific problem but it is another unreliable factor in browser based GPS functionality.

Update: I was testing with the watchPosition function call and it is produced much more accurate result on Android and iOS4. It the way to go... Sample code: http://jsbin.com/ugebif/3

Paul D. Waite
  1. I can’t, but only due to laziness :)

  2. I’m not sure, but I suspect Safari is using the non-GPS parts of the iPhone’s location awareness.

  3. Again, I’m not sure, but Dive into HTML5 mentions that the HTML5 geolocation API lets you pass a PositionOptions object to getCurrentPosition, and that this object has an enableHighAccuracy property.

    Setting that to true might make Safari use the same high-accuracy positioning as CLLocationManager. (I’ve no experience with this myself though.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!