Mapkit annotation

AK7


Joined
Jun 28, 2011
Messages
1
Reaction score
0
Points
1
dear all

i have a problem with xcode mapkit annotation ... its been three weeks but no luck .... i'm trying to show a picture insted of a pin and also callout withthe blue arrow to link it to other views .... this is the code :


- (void)viewDidLoad
{
[super viewDidLoad];

MKCoordinateRegion Kuwait = {{0.0,0.0},{0.0, 0.0}};
Kuwait.center.latitude = 29.291190;
Kuwait.center.longitude= 47.801514;
Kuwait.span.latitudeDelta = 2;
Kuwait.span.longitudeDelta = 2;
[mapView setRegion:Kuwait animated:YES];

MyAnnotation *marker = [[MyAnnotation alloc]init];
marker.title = @"fist Target";
marker.subtitle = @"Ahmad Alkandri";
marker.coordinate = Kuwait.center;
[mapView addAnnotation:marker];
[mapView setRegion:Kuwait animated:YES];



}

- (MKAnnotationView *) mapView:(MKMapView *) mapView viewForAnnotation:(id ) annotation {
MKPinAnnotationView *customPinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil] autorelease];
customPinView.pinColor = MKPinAnnotationColorGreen;
customPinView.animatesDrop = YES;
customPinView.canShowCallout = YES;
return customPinView;

}
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top