我使用 map 已经有一段时间了,所以我了解显示用户位置所需发生的事情的基础知识
map.showsUserLocation = YES; //also have the box checked in .xib
设置位置管理器
- (CLLocationManager *)locationManager {
if (locationManager != nil) {
return locationManager;
}
locationManager = [[CLLocationManager alloc] init];
[locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
[locationManager setDelegate:self];
return locationManager;
}
我已经登录并看到我正在使用 didUpdateUserLocation 方法
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation {
if (!userLoc)
{
//NSLog(@"Mapping - didUpdateUserLocation");
userLoc = userLocation.location;
}
[locationManager startUpdatingLocation];
}
而且我还要确保我不会删除用户的注释
if (![annotation isKindOfClass:[MKUserLocation class]])
...那么为什么蓝点在 iPhone 上显示并闪烁,但仅在 iPad 上显示为白点? (两台设备均为 iOS 7.1.1)
最佳答案
只有配备蜂窝网络的 iPad 才能访问 GPS,这就是 MKMapView 中蓝色脉冲点所代表的。每部 iPhone 都有 GPS,这就是为什么您会在该设备上看到脉冲点。
如果没有蜂窝网络 (3G/4G/LTE),iPad 只能使用 WiFi 进行三角定位,这对于导航来说不够准确。
关于ios - UIMapView : User location annotation is white not pulsing blue in iPad only,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24394950/