using latest GoogleMaps:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
pod 'GoogleMaps'
In my ios code, I got the didTapMarker declared:
- (BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker{
...
}
I first launch the app, get my map and place a marker on the map... no problems. Everything works as expected. Now I want to click on the marker and pop up a balloon with info on the marker. I can click on that marker all day long and the didTapMarker method never gets called. However, if I drag/move the map slightly in any direction, I can then click on the marker and didTapMarker methods gets called perfectly. From this time on, didTapMarker works as expected for the life of the app.
I've probably got something wrong with the viewDidLoad or something...???
- (void)viewDidLoad
{
[self setDelegate:self ];
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeIndeterminate;
hud.labelText = @"Getting data...";
[super viewDidLoad];
float systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
if (systemVersion >= 7.0)
{
self.navigationController.navigationBar.translucent = NO;
[self setEdgesForExtendedLayout:UIRectEdgeNone];
}
devicesToDraw = [[NSMutableArray alloc] init];
[gmsMapView setDelegate:self];
[self.mapTypeView setHidden:true];
self.mapTypeView.center = CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height/2);
[self.settingsView setHidden:true];
self.mapTypeView.center = CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height/2);
devicesManager= [[DevicesManager alloc] initWithDelegate:[MainViewController getInstance] and:self];
notificationManager = [[NotificationManager alloc] init];
[UIApplication sharedApplication].networkActivityIndicatorVisible = FALSE;
[indicator stopAnimating];
UIBarButtonItem *mapType = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"map_24px.png"] style:UIBarButtonItemStylePlain target:self action:@selector(mapType)];
[mapType setTintColor:[UIColor whiteColor]];
[self.navigationItem setLeftBarButtonItem:self.navigationItem.leftBarButtonItem];
[self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects:self.navigationItem.rightBarButtonItem, mapType, nil]];
[hud hide:true];
}