MKPinAnnotationView Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/MapKit.framework
Availability
Available in iOS 3.0 and later.
Companion guide
Declared in
MKPinAnnotationView.h
Related sample code

Overview

The MKPinAnnotationView class provides a concrete annotation view that displays a pin icon like the ones found in the Maps application. Using this class, you can configure the type of pin to drop and whether you want the pin to be animated into place.

Tasks

Getting and Setting Attributes

Properties

animatesDrop

A Boolean value indicating whether the annotation view is animated onto the screen.

@property (nonatomic) BOOL animatesDrop
Discussion

When this property is YES, the map view animates the appearance of pin annotation views by making them appear to drop onto the map at the target point. This animation occurs whenever the view transitions from offscreen to onscreen.

Availability
  • Available in iOS 3.0 and later.
Declared In
MKPinAnnotationView.h

pinColor

The color of the pin head.

@property (nonatomic) MKPinAnnotationColor pinColor
Discussion

The Maps application uses different pin colors for different types of map annotations. Your own map annotation should use the available pin colors in the same way. For a description of when to use each type of pin, see the constants of “MKPinAnnotationColor”.

Availability
  • Available in iOS 3.0 and later.
Related Sample Code
Declared In
MKPinAnnotationView.h

Constants

MKPinAnnotationColor

The supported colors for pin annotations.

enum {
   MKPinAnnotationColorRed = 0,
   MKPinAnnotationColorGreen,
   MKPinAnnotationColorPurple
};
typedef NSUInteger MKPinAnnotationColor;
Constants
MKPinAnnotationColorRed

The head of the pin is red. Red pins indicate destination points on the map.

Available in iOS 3.0 and later.

Declared in MKPinAnnotationView.h.

MKPinAnnotationColorGreen

The head of the pin is green. Green pins indicate starting points on the map.

Available in iOS 3.0 and later.

Declared in MKPinAnnotationView.h.

MKPinAnnotationColorPurple

The head of the pin is purple. Purple pins indicate user-specified points on the map.

Available in iOS 3.0 and later.

Declared in MKPinAnnotationView.h.