繁体   English   中英

使用Mapkit时,我可以看到完全可滚动的地图,但是没有Apple总部?

[英]In using the Mapkit, I can see the fully scrollable map however no Apple headquarters?

我已经在实际设备(iPad)和iPhone模拟器(ios 4)上都尝试过

即使放大地图,我也看不到地图,但没有看到苹果总部(蓝色图钉)。

在我的OnViewLoad函数中,我有:

mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];

mapView.showsUserLocation=TRUE;
mapView.mapType=MKMapTypeHybrid;

[self.view insertSubview:mapView atIndex:0];

-mapView:viewForAnnotation:方法中,如果注释是userLocation对象,则返回nil:

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
    if ([annotation isMemberOfClass:[MKUserLocation class]]) {
        return nil;
    }
    // your normal code
}

需要确保使用iOS默认实现来显示蓝色的userLocation点。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM