0
votes

I'm new to iOS development as well as Google Maps SDK for iOS.

I'm currently working on an iPhone application & I want to open the info window of the Google Map Markers when the app is launching. (Pop up the info window by default, without clicking on the marker balloon).

Is there any way to accomplish this task?

Here is my code:

GMSMarker *marker = [[GMSMarker alloc] init];
marker.flat = YES;
marker.appearAnimation=YES;
marker.position = CLLocationCoordinate2DMake(lt,ln);
marker.title = name;
marker.snippet = type;

[self.mapView setSelectedMarker:marker];

marker.map = self.mapView;
2
try to put [self.mapView setSelectedMarker:marker]; after marker.map = self.mapView; :)TonyMkenu
tried it ,, but had no luck.. Nothing happened ..Udaya Sri

2 Answers

1
votes

If you try to create marker in didTapAtCoordonate, you should create your marker in:

[[NSOperationQueue mainQueue] addOperationWithBlock:^{
   //create your marker here
}];

From here: infowindow not displaying with marker in didTapAtCoordinate method

0
votes

Where are you calling that code? You might want to try putting it in viewWillAppear or viewDidAppear. It may be that setting the selected marker doesn't work until after the map has started rendering.