开发者

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

开发者 https://www.devze.com 2023-02-03 17:08 出处:网络
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.

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

精彩评论

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