gpt4 book ai didi

ios - 从 CLLocationManager 中过滤掉不良位置

转载 作者:行者123 更新时间:2023-11-29 10:32:31 25 4
gpt4 key购买 nike

我在使用 CLLocationManager 时经常发现:

self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
self.locationManager.distanceFilter = 10;

它的委托(delegate)方法:

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations;

即使根本没有移动,我也会得到如下所示的结果。我知道定位服务并不总是 100% 准确并且受网络条件的影响,但是有没有什么方法可以过滤掉不良位置,这样我就不会得到这样的随机杂散点?

enter image description here

最佳答案

这很奇怪。我们几乎有相同的代码和我的工作。你执行过一次[self.locationManager startUpdatingLocation]吗?

也尝试添加 [self.locationManager startMonitoringSignificantLocationChanges]

关于ios - 从 CLLocationManager 中过滤掉不良位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28906794/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com