Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 04-10-2009, 11:33 PM   #8 (permalink)
craiglittle
New Member
 
Join Date: Nov 2008
Location: BrisVegas
Posts: 105
Send a message via Skype™ to craiglittle
Default

I also had problems getting the location indicator to show properly. It worked in the simulator (showed a blue dot at Cupertino), but no blue dot for my location when I tested on my upgraded iPhone...

It appears that the mapView:viewForAnnotation: delegate method is now called for the location annotation as well as your manually added annotations, a behaviour slightly different from Beta 1. Because I processed it as one of my annotations, it had a red pin on the map instead of a blue dot, and because I have 69 annotations it got lost in the clutter.

I now use the following code (sort of) to determine whether I want to display a pin annotation (for my annotations) or the blue location dot:

Code:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
	static NSString *defaultPinID = @"CameraAnnotation";
	MKPinAnnotationView *retval = nil;
	
	if ([annotation isMemberOfClass:[CameraAnnotation class]]) {
		retval = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
		if (retval == nil) {
			retval = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID] autorelease];
		}
		
		if (retval) {
			[retval setPinColor:MKPinAnnotationColorGreen];
			retval.animatesDrop = YES;
			retval.canShowCallout = NO;
		}
	}
	
    return retval;
}
__________________
The important thing is not so much that every child should be taught, as that every child should be given the wish to learn.
- Sir John Lubbock.
craiglittle is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,813
Threads: 89,206
Posts: 380,629
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Leoknico
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:43 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.