开发者

Sometimes I receive the wrong GPS location

Sometimes I receive the wrong value for my current location, an error of up to 2 miles. Am I doing everything correctly?

self.myLocation = [[CLLocationManager alloc] init];
myLocation.delegate = self;
myLocation.desiredAccuracy = kCLLoca开发者_StackOverflowtionAccuracyBest;
[myLocation startUpdatingLocation];

What's the most accurate method to receive GPS location?


You get a stream of location updates from the device when you start monitoring location change and so you need to consider both the timestamp of the location update and its horizontal accuracy.

Use the timestamp to reject old values (for example when you first start monitoring, you will be sent an accurate (at the time) but old cached value).

Use the horizontal accuracy to reject values that are outside of your desired range.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜