iphone core location: distance filter how does it work?

江枫思渺然 提交于 2020-01-12 03:55:11

问题


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


回答1:


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".



来源:https://stackoverflow.com/questions/3342558/iphone-core-location-distance-filter-how-does-it-work

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