我想知道是否有办法从 MKMapView 获取接收到的位置的准确性。
我原以为下面的代码会起作用,但事实并非如此。我也可以直接登录该属性吗?
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation {
if (userLocation.location.horizontalAccuracy == kCLLocationAccuracyBest) {
NSLog(@"Best");
}
if (userLocation.location.horizontalAccuracy == kCLLocationAccuracyBestForNavigation) {
NSLog(@"Best for nav");
}
if (userLocation.location.horizontalAccuracy == kCLLocationAccuracyHundredMeters) {
NSLog(@"100m");
}
if (userLocation.location.horizontalAccuracy == kCLLocationAccuracyKilometer) {
NSLog(@"km");
}
if (userLocation.location.horizontalAccuracy == kCLLocationAccuracyNearestTenMeters) {
NSLog(@"10m");
}
if (userLocation.location.horizontalAccuracy == kCLLocationAccuracyThreeKilometers) {
NSLog(@"3km");
}
}
一个圆圈通常代表一个位置的准确性,将其包裹在蓝色的小圆圈周围,因此显然正在发送准确性。
谢谢你的尽心帮助。