Paragon
Paragon

Reputation: 1012

MKMapView - user current location blue dot covers the annotations

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?

Upvotes: 0

Views: 626

Answers (1)

Paragon
Paragon

Reputation: 1012

So i moved

pinView.canShowCallout = YES;

in the last before returning the pinView and it worked.

Upvotes: 1

Related Questions