こんにちは友人 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];
}
}
ここでの問題は、精度の値を減らしている場合、一部のアドレスに関して緯度と経度をGoogle APIに送信しているため、読み込みに時間がかかり、目的地に関して目的地に到達したときにこの値に問題があることです0.6マイルの差。