简体   繁体   English

以编程方式谷歌地图iOS的标记的关闭信息窗口

[英]Close info window of a marker programmatically google maps iOS

I know it's easy in the java version of Google Maps but I can't figure out how to get the info window to close in the objective C version of the SDK. 我知道谷歌地图的java版本很容易,但我无法弄清楚如何在SDK的目标C版本中关闭信息窗口。

I'm using this method: 我正在使用这种方法:

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

And want to add a line to close the infowindow associated with marker. 并希望添加一行来关闭与标记相关的信息窗口。

I think you can use this: 我想你可以用这个:

mapView.selectedMarker = nil;

The comments on the selectedMarker property in GMSMapView.h say this: 对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;

迅速

mapView.selectedMarker?.title = nil

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Maps在标记信息窗口iOS中显示语音气泡 - Google Maps Showing speechbubble in marker info window iOS 如何在不点击标记的情况下在 iOS 谷歌地图中显示信息窗口? - How to show a Info window in iOS Google maps without tapping on Marker? Google Maps SDK iOS - 带UIButton的自定义标记信息窗口 - Google Maps SDK iOS - Custom marker info window with UIButton 如何使用AFnetworking图像缓存在iOS Google Maps中刷新标记信息窗口? - How to refresh marker info window in iOS Google maps with AFnetworking Image cache? 在Google地图上加载标记的自定义信息窗口时,iOS应用程序冻结 - iOS app freezes when loading custom info window for marker on Google Maps 如何在iOS谷歌地图中显示所有信息窗口而无需点击标记? - How to show all Info window in iOS Google maps without tapping on Marker? ios谷歌地图绘制多个标记问题(信息窗口和标记重复) - ios google maps plotting multiple markers issues(info window and marker repeating) 如何在ios上添加一个按钮到谷歌地图标记信息窗口? - How can i add a button to google maps marker info window on ios? 在iOS中移动Google地图信息窗口 - Moving Google Maps Info Window in iOS IOS谷歌地图sdk中的自定义信息窗口 - Custom info window in IOS google maps sdk
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM