I am using google maps ios sdk. I have created a custom xib file for info window.
The issue I am getting is whenever I tap on a marker it the google map automatically makes the marker in center and then on next tap info window
is displayed.
What I want is the tapped marker should display info window
on immediately instead of tap on second time
Here is the code I'm using
- (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker {
if (marker != self.pointMarker) {
if (!self.shuttleInfoWindow) {
[self initShuttleInfoWindowObject];
}
Shuttle* shuttle = (Shuttle*)marker.userData;
if (shuttle) {
[self.shuttleInfoWindow setCurrentShuttle:shuttle];
}
self.shuttleInfoWindow.isInfoWindowDisplayed = YES;
return self.shuttleInfoWindow;
}
return nil;
}
- (void)initShuttleInfoWindowObject {
self.shuttleInfoWindow = [[[NSBundle mainBundle] loadNibNamed:@"InfoWindow" owner:self options:nil] objectAtIndex:0];
[self.shuttleInfoWindow setFrame:CGRectMake(0,
0,
self.shuttleInfoWindow.frame.size.width,
self.shuttleInfoWindow.frame.size.height)];
self.shuttleInfoWindow.delegate = self;
}