简体   繁体   English

Google Maps SDK iOS - 带UIButton的自定义标记信息窗口

[英]Google Maps SDK iOS - Custom marker info window with UIButton

I'm working on an iOS project which shows map with pinned locations. 我正在开发一个iOS项目,该项目显示带有固定位置的地图。 When user taps on a location an Custom Info window is shown with some details. 当用户点击位置时,会显示自定义信息窗口,其中包含一些详细信息。 I use the below method to 我用下面的方法来

- (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker

The custom info window has a set of labels & buttons. 自定义信息窗口有一组标签和按钮。 As of now everything is working perfectly except that the IBOutlet of the UIButton in the custom info window is not firing. 截至目前,除了自定义信息窗口中的UIButton的IBOutlet未触发外,一切都运行良好。 Its like Google Maps is rendering the custom info window as an image. 就像Google Maps将自定义信息窗口渲染为图像一样。

Is there any way where i can have buttons inside of it and have Touch Up inside fired? 有什么方法我可以在里面有按钮,并在内部触摸Touch Up?

You cannot create an UIButton in a info window, it's a snapshot of the UIView, what you can do, is create an UItapGesture recognizer or use another delegade didTapInfoWindowOfMarker 您无法在信息窗口中创建UIButton,它是UIView的快照,您可以做的是创建UItapGesture识别器或使用其他委托didTapInfoWindowOfMarker

for more info: https://developers.google.com/maps/documentation/ios/reference/protocol_g_m_s_map_view_delegate-p#ae1614978aef680d671a6a95da8e13bf7 有关详情,请访问: https//developers.google.com/maps/documentation/ios/reference/protocol_g_m_s_map_view_delegate-p#ae1614978aef680d671a6a95da8e13bf7

here's a free course: 这是一个免费的课程:

http://googlemaps.codeschool.com/ http://googlemaps.codeschool.com/

You're exactly right, the info window is rendered as a flattened view. 你说得对,信息窗口呈现一个平面视图。

Please see the grey-boxed note on the developers page regarding Info Windows. 请参阅开发者页面上有关Info Windows的灰色框注释。

  • iOS iOS版

https://developers.google.com/maps/documentation/ios/marker#info_windows https://developers.google.com/maps/documentation/ios/marker#info_windows

  • And for completeness, the same is true for the Android SDK 为了完整起见,Android SDK也是如此

https://developers.google.com/maps/documentation/android/infowindows#custom_info_windows https://developers.google.com/maps/documentation/android/infowindows#custom_info_windows

I've had this problem myself, there is no (sane) way around it. 我自己有这个问题,没有(理智的)方法。 Unfortunately, you'll have to redesign what you're trying to achieve. 不幸的是,你必须重新设计你想要实现的目标。

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

相关问题 IOS谷歌地图sdk中的自定义信息窗口 - Custom info window in IOS google maps sdk 使用Google Maps iOS SDK快速创建自定义信息窗口? - Creating custom info window in swift with the Google maps iOS sdk? 在Google地图上加载标记的自定义信息窗口时,iOS应用程序冻结 - iOS app freezes when loading custom info window for marker on Google Maps 如何在不点击标记的情况下在 iOS 谷歌地图中显示信息窗口? - How to show a Info window in iOS Google maps without tapping on Marker? Google Maps在标记信息窗口iOS中显示语音气泡 - Google Maps Showing speechbubble in marker info window iOS 以编程方式谷歌地图iOS的标记的关闭信息窗口 - Close info window of a marker programmatically google maps iOS Xamarin.iOS上的自定义Google Maps标记信息视图 - Custom Google Maps marker info view on Xamarin.iOS 在实现 mapView:didTapMarker 时在谷歌地图 iOS sdk 中点击标记时显示信息窗口:已实现委托方法 - Displaying info window when tapped marker in google maps iOS sdk while implementing mapView:didTapMarker: delegate method implemented iOS Google Maps SDK自定义标注视图和标记居中 - iOS google maps sdk custom call out view and marker centering 使用适用于 iOS 的 Google Maps SDK 优化自定义标记图像性能 - Optimising custom marker image performance with Google Maps SDK for iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM