GPS位置更新更准确后,打开谷歌地图



我遇到一个奇怪的问题。我有一个应用程序,它使用GPS基于位置更新的地图显示。我发现GPS精度在应用程序中很差,但如果我打开谷歌地图,然后回到我的应用程序,精度是正确的。

任何想法?

- (void)locationManager:(CLLocationManager *)manager
      didUpdateToLocation:(CLLocation *)newLocation 
      fromLocation:(CLLocation *)oldLocation
{
double lat;
double lng;
lat = newLocation.coordinate.latitude;
lng = newLocation.coordinate.longitude;
//Other stuff that uses the location
}

您可以在创建位置管理器时要求特定的准确性,如下所示:

[manager setDesiredAccuracy:kCLLocationAccuracyBest];

最新更新