0

In my app i have n arrays of annotations in my app, foodannotations, gasannotations, and shoppingannotations. I want each array of annotations to show a different colored pin. I am currently using.

  • :You got the answer. Post your answer and flag as duplicate. Instead of link show the answer that was more helpful to others – TamilKing Oct 31 '13 at 04:47

1 Answers1

0

Already a discussion was been done regarding this. Please search question if it is already available before you ask. Thanks.

Pls refer the following links:

iPhone SDK: MapKit multiple custom annotations

Multiple Arrays of Annotations, Different Pin Color for Each Array?

Do this in viewForAnnotation:

int annType = ((YourAnnotationClass *)annotation).annotationType;
switch (annType)
{
    case 0 :   //Food
        pinview.pinColor = MKPinAnnotationColorRed;
    case 1 :   //Gas
        pinview.pinColor = MKPinAnnotationColorGreen;
    default :  //default or Shopping
        pinview.pinColor = MKPinAnnotationColorPurple;
}
Community
  • 1
  • 1