UIMapView: User location annotation is white not pulsing blue in iPad only

本秂侑毒 提交于 2019-12-10 18:09:34

问题


I've been working with maps for a while so I understand the basics of what needs to happen to show the user's location

map.showsUserLocation = YES; //also have the box checked in .xib

set up the locationManager

- (CLLocationManager *)locationManager {

if (locationManager != nil) {
    return locationManager;
}

locationManager = [[CLLocationManager alloc] init];
[locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
[locationManager setDelegate:self];

return locationManager;
}

I've logged and see that I'm hitting the didUpdateUserLocation method

- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation {

if (!userLoc)
{
    //NSLog(@"Mapping - didUpdateUserLocation");
    userLoc = userLocation.location;
}

    [locationManager startUpdatingLocation];
}

and I'm also making sure I don't remove the user's annotation

if (![annotation isKindOfClass:[MKUserLocation class]])

...so why is the blue dot showing and pulsing on the iPhone, but showing as a white dot only on the iPad? (Both devices are iOS 7.1.1)


回答1:


Only iPad's with cellular will have access to the GPS which is what the blue pulsing dot represents in MKMapView. Every iPhone has GPS which is why you are seeing the pulsing dot on that device.

Without cellular (3G/4G/LTE) the iPad can only use WiFi to triangulate position, which is not accurate enough for navigation.



来源:https://stackoverflow.com/questions/24394950/uimapview-user-location-annotation-is-white-not-pulsing-blue-in-ipad-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!