iPhone核心定位:距离滤镜如何工作?

发布于 2024-09-11 09:46:48 字数 110 浏览 2 评论 0原文

属性 locationmanager.distancefilter 到底有什么作用?它是否确定 didUpdateTolocation 方法被调用的频率?

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

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

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

发布评论

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

评论(1

幻梦 2024-09-18 09:46:48

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

即使设备没有移动,GPS 位置结果也会出现漂移,这是很常见的情况。您可以静止不动,但如果位置精度为 +/- 10 米,则即使设备没有移动,报告的位置也可能变化最多 20m。使用 distanceFilter 可以过滤掉这种无关的运动。

如果您想了解更多信息,请查看我的 中的 distanceFilter 实现CLLocationManager-simulator,就在注释“Apply distanceFilter”下方。

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.

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.

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

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