I am new to iOS development. This is regarding Marker info window in Google Maps iOS SDK.
I understand, we can create a marker with info window using GMSMarkerOption.
GMSMarkerOption *myLocationOption = [GMSMarkerOption alloc];
myLocationOption .title = @"My Location";
myLocationOption .snippet = @"Lat:...., Lang:....";
[mapView addMarkerOption:myLocationOption];
As per the above code, Marker displayed in the Map View as expected. And tapping on marker shows the "My Location" info window in Google maps which is good.
Is there anyway we can show the info window programmatically when the user goes to Custom Map Screen?
Swift 3.0
below line is the answer
(note that it's Options, not Option)
This has changed on Google Maps SDK and it's easier to understand:
You use now setSelectedMarker method to show an info window of a marker
GMSMarkerOptions is deprecated. Using this helped me to show info window without tapping-
swift 3
self.mapView.selectedMarker = marker
In the case of swift 3, you can open the
snipet
usint theselectedMarker
If you are creating the marker in a similar way to:
Happy Coding :)