0

I am working on maps and when you tap a annotation it shows the title and description. Problem is one annotation is very close to the user's current location so i can't see the title of that annotation because its not tapeable. When i try to tap the annotation nothing happens.

- (MKAnnotationView *) mapView:(MKMapView *)mapView
         viewForAnnotation:(id <MKAnnotation>) annotation {

if ([annotation isKindOfClass:[MKUserLocation class]]) {
    //Don't trample the user location annotation (pulsing blue dot).
    return nil;
}

MKPinAnnotationView *pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"pin"];
pinView.animatesDrop = YES;
pinView.canShowCallout = YES;

if (pinView == nil)
    pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pin"];


if([[pinView.annotation title] isEqualToString:@"Store"])
{
    pinView.pinColor = MKPinAnnotationColorGreen;
}

return pinView;

}

Is there anyway i can bring the annotation front that blue dot that shows current location?

4

1 回答 1

1

所以我搬家了

pinView.canShowCallout = YES;

在返回 pinView 之前的最后一个,它起作用了。

于 2014-07-09T19:55:02.180 回答