你好朋友我看过很多关于gps准确性问题的帖子,但它一直没有工作
-(void) locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
NSString *latstr = [NSString stringWithFormat:@"%f", newLocation.coordinate.latitude];
NSString *longstring=[NSStringstringWithFormat:@"%f",newLocation.coordinate.longitude];
if (abs(howRecent)>5.0)
{
[self.locationManager startUpdatingLocation];
return;
}
if(abs(newLocation.horizontalAccuracy)<0.0f)
{
[self.locationManager startUpdatingLocation];
return;
}
if(newLocation.horizontalAccuracy>65.0f)
{
[self.locationManager startUpdatingLocation];
return;
}
self.latstring = [latstr copy];
self.longstr = [longstring copy];
if((updateLocationFirst||loadFirstView))
{
[[NSUserDefaults standardUserDefaults]setObject:latstring forKey:@"Latitude"];
[[NSUserDefaults standardUserDefaults]setObject:longstr forKey:@"Longitude"];
[self displayParticularDaySpecial];
loadFirstView=FALSE;
updateLocationFirst=FALSE;
[self.locationManager stopUpdatingLocation];
}
}
这里的问题是,如果我正在降低精度值,它需要花费大量时间来加载,并且当您到达目的地时,这个值有问题,那么我将针对某些地址向谷歌 api 发送纬度和经度。 0.6 英里的差异。