Discussion Forums  >  Maps, Device Location, Tracking

Replies: 2    Views: 198

willjj85
Aspiring developer
Profile
Posts: 93
Reg: Feb 14, 2011
ireland
3,480
11/16/12 06:15 PM (11 years ago)

Is it possible to change info icon on the callout bubble

Is it possible to change the info icon on the callout bubble to a different image on the map drop pin
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
11/17/12 01:47 AM (11 years ago)
Anything's possible. It's a matter of how much skill / understanding you have. The control panel won't allow you to modify this. But, you can easily (if you can get your head around this) modify the map plugin to change this icon. Some basics... 1) Map loads and drops pins, one for each data point. 2) When you tap on a pin, map shows callout bubble. In iOS this is call The an Annotation View 3) Each Annotation view has a bunch of properties like title, subtitle, and ICON. Whoo hoo. The icon isn't actually called an icon (technically), it's called a "rightCalloutAccessoryView" You can see where this is getting set to a button on line 573 of the BT_screen_map.m file. This means the icon is whatever the button is. In this case, it's an "info" button or a "details disclosure button" (if you're opening a new screen and not showing driving direction. Have a look at the logic starting on line 557. "If the button should show directions, create a button using the UIButtonTypeInfoLight icon. If the button should show a screen, create a button using the UIButtonTypeDetailDisclosure" There is not reason you could't create your own button and assign it as the rightCalloutAccessoryView. Enjoy.
 
willjj85
Aspiring developer
Profile
Posts: 93
Reg: Feb 14, 2011
ireland
3,480
like
11/18/12 07:03 PM (11 years ago)
Thank you David really appreciate your help Here is a Screenshot if any one is interested www.dropbox.com/s/hfkc8ca803kno8y/Screenshot%202012.png If any one is looking to change the info Icon here is the code i used //ignore if button type is "none" if([tmpLoadScreenId isEqualToString:@"showDirections"]){ //ignore if button type is "none" if([tmpLoadScreenId isEqualToString:@"showDirections"]){ theButton = [UIButton buttonWithType:UIButtonTypeInfoLight]; }else { if([tmpLoadScreenId length] > 1 || [tmpLoadScreenNickname length] > 1 || [tmpLocation.jsonVars objectForKey:@"loadScreenObject"]){ theButton = [UIButton buttonWithType:UIButtonTypeCustom]; } } //if we have a button... add the appropriate tag + action (the tag tells us what location was tapped if(theButton != nil){ [theButton setTag:[annotation listIndex]]; [theButton addTarget:self action:@selector(calloutButtonTapped:) forControlEvents:UIBarButtonSystemItemAction]; } //set the button. If it's nil, no button will show [theButton setImage:[UIImage imageNamed:@"your image.png"] forState:UIButtonTypeCustom]; annotationView.rightCalloutAccessoryView= theButton; //return the view return annotationView; }
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.