MKPinAnnotationView: Pin width and height
Asked Answered
A

1

11

What is the width and the height of the MKPinAnnotationView pin in pixels?

Edit: To be more concrete, the width and height of imaginary rectangle on iPhone screen containing the pin.

Albie answered 16/8, 2011 at 12:4 Comment(0)
P
24

According to the code below, the pin image and the MKPinAnnotationView are both 32 points wide and 39 points high:

- (MKAnnotationView *)mapView:(MKMapView *)mapView 
        viewForAnnotation:(id <MKAnnotation>)annotation
{
    MKPinAnnotationView *pav = (MKPinAnnotationView *)[mapView 
            dequeueReusableAnnotationViewWithIdentifier:@"test"];
    if (pav == nil)
    {
        pav = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation 
                reuseIdentifier:@"test"] autorelease];
    }

    pav.annotation = annotation;

    NSLog(@"pav.frame.size = %@, pav.image.size = %@", 
        NSStringFromCGSize(pav.frame.size), 
        NSStringFromCGSize(pav.image.size));

    return pav;
}
Pasquinade answered 16/8, 2011 at 15:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.