UIMapView:用户位置注释仅在iPad中为白色而不是蓝色脉冲 [英] UIMapView: User location annotation is white not pulsing blue in iPad only

查看:125
本文介绍了UIMapView:用户位置注释仅在iPad中为白色而不是蓝色脉冲的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用地图一段时间,所以我理解了显示用户位置需要发生的基本知识

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

设置locationManager

set up the locationManager

- (CLLocationManager *)locationManager {

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

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

return locationManager;
}

我已经登录并看到我正在点击didUpdateUserLocation方法

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]])

...为什么蓝点在iPhone上显示并发出脉冲,但只在iPad上显示为白点? (两个设备都是iOS 7.1.1)

...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)

推荐答案

只有拥有手机的iPad才能访问GPS,这就是蓝色脉冲dot代表MKMapView。每个iPhone都有GPS,这就是为什么你会看到该设备上的脉冲点。

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.

如果没有蜂窝(3G / 4G / LTE),iPad只能使用WiFi进行三角测量,这不足以导航。

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

这篇关于UIMapView:用户位置注释仅在iPad中为白色而不是蓝色脉冲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆