【发布时间】:2013-02-10 00:44:11
【问题描述】:
我是 iOS 版 Google Maps SDK 的新手。当用户单击标记时,我不想显示带有标题和 sn-p 的默认信息窗口,而是将它们定向到我的应用程序中的其他位置(例如模态视图控制器)。我已经搜索了头文件和在线,我似乎找不到与标记上的触摸事件有关的任何内容。有没有人有建议或解决方法?
【问题讨论】:
我是 iOS 版 Google Maps SDK 的新手。当用户单击标记时,我不想显示带有标题和 sn-p 的默认信息窗口,而是将它们定向到我的应用程序中的其他位置(例如模态视图控制器)。我已经搜索了头文件和在线,我似乎找不到与标记上的触摸事件有关的任何内容。有没有人有建议或解决方法?
【问题讨论】:
我相信您想要的是添加委托并覆盖 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;
【讨论】: