Montre les différentes Broches images dans MKMapview

Dans mon MKMap vue j'ai personnalisé l'annotation de la goupille avec une image. Mais encore certaines broches sont statiques et ne pas montrer l'image donnée.

Je suis en utilisant -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id )annotation pour définir le code pin de l'image.

Ajouter mon code et écran ici:

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


if ([annotation isKindOfClass:[MKUserLocation class]])
    return nil;

static NSString* AnnotationIdentifier = @"AnnotationIdentifier";
MKPinAnnotationView* pinView = [[MKPinAnnotationView alloc]
                                 initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier];
pinView.animatesDrop=YES;
pinView.canShowCallout=YES;
    pinView.pinColor= MKPinAnnotationColorGreen;

    pinView.enabled = YES;
    pinView.canShowCallout = YES;
    pinView.image=[UIImage imageNamed:@"bublerest.png"]; //here I am giving the image  





UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton setTitle:annotation.title forState:UIControlStateNormal];
[rightButton addTarget:self
                action:@selector(showDetails:)
      forControlEvents:UIControlEventTouchUpInside];

    pinView.rightCalloutAccessoryView = rightButton;

UIImageView *profileIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"rest_image2.png"]];
pinView.leftCalloutAccessoryView = profileIconView;


return pinView;
}

Montre les différentes Broches images dans MKMapview

Des idées?

  • Pouvez-vous voir votre carte personnalisée icônes à tous pour les broches ou les quelques épingles de ne pas les montrer?
InformationsquelleAutor | 2013-02-21