在 Google Maps SDK for native iOS/objective C 中的 InfoWindow/Marker 上添加 Click 事件 [英] Adding Click Event on InfoWindow/Marker in Google Maps SDK for native iOS/objective C
问题描述
简单的问题
我正在开发一款适用于 iOS 的应用程序,我在其中嵌入了适用于原生 iOS 的新 Google 地图.一切都很好,除了一个问题,我在这里和谷歌都找不到适合本地 IOS/Objective-C 的解决方案(如果有,请告诉我,抱歉打扰你)
I´m working on an App for iOS where I embedded the new Google Map for native iOS. Everything works fine except one problem where I can´t find a propper solution for native IOS/ Objective-C neither here nor at google (if there is one please show me and sorry for annoying you)
我想要的:我希望用户单击打开信息窗口的标记.如果他单击或点击信息窗口后,它应该会打开一个包含更多信息的新 UIView.
What I want: I want the User to Click on the Marker that opens the Info Window. After If he clicks or taps on the Info Window it should open a New UIView with further Informations.
我该怎么做?
感谢您的建议
推荐答案
1.符合GMSMapViewDelegate
协议
@interface YourViewController () <GMSMapViewDelegate>
// your properties
@end
2.设置您的 mapView_
委托.
2.set your mapView_
delegate.
mapView_.delegate = self;
3.实现GMSMapViewDelegate
方法
- (void)mapView:(GMSMapView *)mapView didTapInfoWindowOfMarker:(GMSMarker *)marker {
// your code
}
btw,marker.userData
很有用.您可以在其中设置您需要的数据并在 -mapView:didTapInfoWindowOfMarker:
btw, marker.userData
is useful. you can set your needed data into it and use it in - mapView:didTapInfoWindowOfMarker:
这篇关于在 Google Maps SDK for native iOS/objective C 中的 InfoWindow/Marker 上添加 Click 事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!