2013-02-24 46 views
5

我不熟悉适用于iOS的Google Maps SDK。当用户点击一个标记,而不是显示带有标题和片段的默认信息窗口时,我想将它们引导到我的应用程序中的其他位置(例如模式视图控制器)。我已经搜索了头文件和在线,并且我似乎无法找到与标记上的触摸事件相关的任何内容。有没有人有建议或解决方法?如何拦截Google Maps SDK for iOS中的标记触摸?

回答

14

我相信你想要的是添加的委托,并覆盖didTapMarker方法

/** 
* Called after a marker has been tapped. 
* 
* @param mapView The map view that was pressed. 
* @param marker The marker that was pressed. 
* @return YES if this delegate handled the tap event, which prevents the map 
*   from performing its default selection behavior, and NO if the map 
*   should continue with its default selection behavior. 
*/ 
- (BOOL)mapView:(GMSMapView *)mapView didTapMarker:(id<GMSMarker>)marker; 
+0

我认为该方法已经改变了一点 - (BOOL)MapView类:(GMSMapView中*)的MapView didTapMarker:(GMSMarker *)标记; 现在第二个参数是一个指向GMSMarker类实例的指针。 – 2015-01-30 10:14:42