开发者

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

I have tried it both on an actual device (iPad) and the iPhone simulator (ios 4)

I see the map but no Apple headquarters (blue pin) even if I zoom in.

In my OnViewLoad function I have:

mapView = [[MKMapView alloc]开发者_JAVA百科 initWithFrame:self.view.bounds];

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

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


In your -mapView:viewForAnnotation: method, return nil if the annotation is a userLocation object:

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

This is needed to make sure, the iOS default implementation is used to show the blue userLocation dot.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜