UIMapView:用户位置注释是白色的,而不是仅在iPad中呈现蓝色
我一直在使用地图一段时间,所以我了解需要发生什么显示用户的位置的基础知识
map.showsUserLocation = YES; //also have the box checked in .xib
设置locationManager
- (CLLocationManager *)locationManager { if (locationManager != nil) { return locationManager; } locationManager = [[CLLocationManager alloc] init]; [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters]; [locationManager setDelegate:self]; return locationManager; }
我已经logging,看到我正在打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来进行三angular测量,这对于导航来说是不够准确的。