5

我是 iOS 版 Google Maps SDK 的新手。当用户单击标记时,我不想显示带有标题和片段的默认信息窗口,而是将它们定向到我的应用程序中的其他位置(例如模态视图控制器)。我在头文件和网上搜索过,似乎找不到与标记上的触摸事件有关的任何内容。有没有人有建议或解决方法?

4

1 回答 1

15

我相信您想要的是添加委托并覆盖该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;
于 2013-02-24T23:27:15.967 回答