Reputation: 1255
I'm using google map for swift. I would to know if theres a method that I can use to hide the info Window whenever I use the delegate will move
func mapView(mapView: GMSMapView, willMove gesture: Bool) {
if gesture {
// Hide info window here
}
}
Upvotes: 2
Views: 2081
Reputation: 5797
The active info window is stored in selectedMarker of GMSMapView. Set it to nil and the info window will disappear.
func mapView(mapView: GMSMapView, willMove gesture: Bool)
{
if mapView.selectedMarker != nil
{
mapView.selectedMarker = nil
}
}
Upvotes: 7