iphone核心位置:距离过滤器如何工作? [英] iphone core location: distance filter how does it work?

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

问题描述

locationmanager.distancefilter 属性究竟是什么?它是否确定调用 didUpdateTolocation 方法的频率??

What exactly the property locationmanager.distancefilter do? Does it determine how often the didUpdateTolocation method gets called??

推荐答案

它过滤掉了短暂的动作。因此,如果CL检测到设备移动了20米,但距离过滤器设置为30米,则不会通知您。一旦位置移动到足以超过距离过滤器设置,您将获得didUpdateToLocation回调。

It filters out short moves. So if CL detects that the device moved 20 meters, but your distance filter is set to 30m you will not be notified. Once the position has moved enough to exceed your distance filter setting then you will get a didUpdateToLocation callback.

即使设备没有,GPS位置结果也很常见不动了。您可以静止但如果位置精度为+/- 10米,即使设备没有移动,报告的位置也可以变化到20米。使用distanceFilter可以过滤掉那种无关的动作。

It is very common for GPS position results to wander even when a device isn't moving. You can be standing still but if the position accuracy is +/- 10 meters, the reported position can change up to 20m even though the device didn't move. Using distanceFilter allows you to filter out that kind of extraneous motion.

如果您想了解更多信息,请查看我在 CLLocationManager-simulator ,位于注释Apply distanceFilter的正下方。

If you want to know more, take a look at my implementation of distanceFilter in my CLLocationManager-simulator, just below the comment "Apply distanceFilter".

这篇关于iphone核心位置:距离过滤器如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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