views:

59

answers:

0

Hi,

I try to inherit from MKPinAnnotationView to display additional information on the callout,

but unfortunately when I use this class, pins seems overlapping each over whereas it display in the good order when I use original MKPinAnnotationView.

You can see how it display below after.

with my custom subclass of MKPinAnnotationView :

mkpinannotation overlap problem 1 alt text

and whith the original class :

mkpinannotation well display 1 mkpinannotation well display 1

Like you see pin instantiate with my custom class are not well order and seems to overlap.

I use my class or the original one in the

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

delegate method.

like that :

MyCustomPinView *customPinView = [[[MyCustomPinView alloc] 
                                       initWithAnnotation:myAnnotation 
                                       reuseIdentifier:identifier] 
                                   autorelease];

Is anyone know where the problem come from ?

It seems that original pin view arrange pin by distance on the screen before to display it. But because my custom class is a subclass of it, I don't know why it doesn't work.