shajem
shajem

Reputation: 2121

How to add a pinpoint Image to a Map - Code provided

How to add an image in front of a Map Annotation pop up.

Here's an image that will show you what exactly i want to do. I need to add an image on the pin point as shown in the image.

AddMap *st = [[AddMap alloc] init];                 
                st.title = @"title";
                st.coordinate = region.center;                  
                [self.mapView addAnnotation:st];

How to add an image ?

note: AddMap is a class i wrote that initializes the title Variable

Upvotes: 0

Views: 209

Answers (1)

oriolpons
oriolpons

Reputation: 1883

You have to do by setting an image to the property leftCalloutAccessoryView.

Try:

UIImageView *profileIconView = [[UIImageView alloc] initWithImage: ..........
annotationView.leftCalloutAccessoryView = profileIconView;

Hope this helps.

Upvotes: 2

Related Questions