ios CLLocationManager didUpdateToLocation 经纬度偏移的问题

- (void)locationManager:(CLLocationManager *)manager
    didUpdateToLocation:(CLLocation *)newLocation
         fromLocation:(CLLocation *)oldLocation {
    NSLog(@"%f",newLocation.coordinate.latitude);
    self.location = newLocation;
}

得到的经纬度与实际地理位置始终会有偏移 请问这个问题该如何解决?

你应该测试 CLLocation 对象返回值的准确性,确保符合位置的准确性。

if (newLocation.horizontalAccuracy > 1000) {
  // Throw away this location and wait for another one as this is over 1km away
}

另外,locationManager:didUpdateToLocation:fromLocation:方法可能在iOS6不可用。所以在iOS6以上版本你应该使用locationManager:didUpdateLocations:

应该是用第三方SDK展现位置或者地图吧,经纬度值需要转换,找找SDK里的相关函数,这个是国家要求的,不能直接暴露。

請問一下原提問者,使用locationManager:didUpdateLocations:有解決經緯度偏移了嗎?