2013-04-03 2 views
12

Je sais que c'est facile dans la version java de Google Maps mais je n'arrive pas à comprendre comment fermer la fenêtre d'information dans la version C de l'objectif du SDK.Fermer la fenêtre d'information d'un marqueur google maps iOS

J'utilise cette méthode:

-(void) mapView:(GMSMapView *)mapView 
    didTapInfoWindowOfMarker:(id<GMSMarker>)marker { 

    sharedGlobal.shouldShowPlayer = YES; 

    /* adds the path to the map by decoding google's encoded string */ 
    [self addPath: sharedGlobal.encodedPathString]; 
} 

et que vous voulez ajouter une ligne pour fermer la infowindow associée avec le marqueur.

Répondre

34

Je pense que vous pouvez utiliser ceci:

mapView.selectedMarker = nil; 

Les commentaires sur la propriété selectedMarker à GMSMapView.h dire ceci:

/** 
* The marker that is selected. Setting this property selects a particular 
* marker, showing an info window on it. If this property is non-nil, setting 
* it to nil deselects the marker, hiding the info window. This property is 
* observable using KVO. 
*/ 
@property (nonatomic, strong) id<GMSMarker> selectedMarker; 
+0

très bien répondu ... Merci –