2013-04-03 15 views
12

Ich weiß, es ist einfach in der Java-Version von Google Maps, aber ich kann nicht herausfinden, wie Sie das Info-Fenster in der Ziel-C-Version des SDK schließen.Schließen Sie Infofenster eines Markers programmgesteuert Google Maps iOS

Ich benutze diese Methode:

-(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]; 
} 

und will eine Zeile hinzufügen, um das Infofenster mit der Markierung assoziiert zu schließen.

Antwort

34

Ich glaube, Sie diese verwenden können:

mapView.selectedMarker = nil; 

Die Kommentare auf der selectedMarker Eigenschaft in GMSMapView.h sagen dies:

/** 
* 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

sehr gut beantwortet ... Danke –

Verwandte Themen