Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Mobile Products: iPhone, iPad, iPod
iOS and Apps
Mapkit annotation
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="AK7" data-source="post: 1259224" data-attributes="member: 206203"><p>dear all </p><p></p><p>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 :</p><p></p><p></p><p>- (void)viewDidLoad</p><p>{</p><p> [super viewDidLoad];</p><p> </p><p> MKCoordinateRegion Kuwait = {{0.0,0.0},{0.0, 0.0}};</p><p> Kuwait.center.latitude = 29.291190;</p><p> Kuwait.center.longitude= 47.801514; </p><p> Kuwait.span.latitudeDelta = 2;</p><p> Kuwait.span.longitudeDelta = 2;</p><p> [mapView setRegion:Kuwait animated:YES];</p><p> </p><p> MyAnnotation *marker = [[MyAnnotation alloc]init];</p><p> marker.title = @"fist Target";</p><p> marker.subtitle = @"Ahmad Alkandri";</p><p> marker.coordinate = Kuwait.center; </p><p> [mapView addAnnotation:marker];</p><p> [mapView setRegion:Kuwait animated:YES];</p><p> </p><p> </p><p> </p><p> }</p><p></p><p>- (MKAnnotationView *) mapView<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" />MKMapView *) mapView viewForAnnotation<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" />id ) annotation {</p><p> MKPinAnnotationView *customPinView = [[[MKPinAnnotationView alloc] initWithAnnotation<img src="/images/smilies/angel.gif" class="smilie" loading="lazy" alt=":a" title="Angel :a" data-shortname=":a" />nnotation reuseIdentifier:nil] autorelease];</p><p> customPinView.pinColor = MKPinAnnotationColorGreen;</p><p> customPinView.animatesDrop = YES;</p><p> customPinView.canShowCallout = YES;</p><p> return customPinView;</p><p> </p><p>}</p></blockquote><p></p>
[QUOTE="AK7, post: 1259224, member: 206203"] 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; } [/QUOTE]
Verification
Post reply
Forums
Apple Mobile Products: iPhone, iPad, iPod
iOS and Apps
Mapkit annotation
Top