2013-04-03 55 views
12

我知道在Java版本的谷歌地图很容易,但我不知道如何让信息窗口关闭在客观的C版本的SDK。关闭信息窗口的标记编程google地图iOS

我用这个方法:

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

并希望添加一行代码以关闭与标记相关的信息窗口。

回答

34

我认为你可以这样做:

mapView.selectedMarker = nil; 

在GMSMapView.h上selectedMarker属性的评论这样说:

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

很好回答...谢谢您 –

相关问题