Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MapKit iPhone Development - Adding Annotations to a Map - iOS SDK

I would like to create annotations on a Map like this:
img

If you click on the blue arrow a menu should open. In the menu should be two menu points. First a Telephone number (if I click on the number the iphone dial/call this number) and second a "Directions to here".

At the moment I run on this code

MKCoordinateRegion region4 = { {0.0, 0.0 }, { 0.0, 0.0 } }; 
region4.center.latitude = 48.13479 ;
region4.center.longitude = 11.582111;
region4.span.longitudeDelta = 0.01f;
region4.span.latitudeDelta = 0.01f;

DisplayMap *ann4 = [[DisplayMap alloc] init]; 
ann4.title = @"The Title!";
ann4.subtitle = @"The Subtitle!"; 
ann4.coordinate = region4.center; 
[mapView addAnnotation:ann4];

How do I show blue-arrow as shown in the image? Can you please suggest me on this..

like image 857
Laurenz Avatar asked Dec 29 '25 03:12

Laurenz


1 Answers

You have to add a UIButton of type UIButtonTypeDetailDisclosure in the rightCalloutAccessoryView of your MKAnnotationView.

like image 193
saadnib Avatar answered Dec 30 '25 17:12

saadnib



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!