I have a mapView with a strange behavior: When I open it, everything works fine. The user (blue with circles) is going to be located and the 3 pins are in position. But (I don't know why) after a some time, the blue point turns into a pin - but only when I have slow connection speed.
Here's what I got:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
MKPinAnnotationView *pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"pinView"];
if (!pinView && ![annotation isKindOfClass:[MKUserLocation class]])
{
pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pinView"];
pinView.pinColor = MKPinAnnotationColorRed;
pinView.animatesDrop = YES;
pinView.canShowCallout = YES;
UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinView.rightCalloutAccessoryView = rightButton;
if (annotation == self.locationZH1)
{
[pinView setTag:1];
}
else if (annotation == self.locationZH2)
{
[pinView setTag:2];
}
else if (annotation == self.locationZH3)
{
[pinView setTag:3];
}
else if (annotation == self.locationLU1)
{
[pinView setTag:4];
}
}
else
{
pinView.annotation = annotation;
}
return pinView;
}