简体   繁体   English

为多个标记定制信息窗口

[英]customizing info window for multiple markers

I have seen the google developers video on custom info window for google maps ios sdk and got it. 我已经在Google Maps iOS SDK的自定义信息窗口上看到了Google开发人员视频,并掌握了它。 But how to use it when we have multiple markers. 但是当我们有多个标记时如何使用它。 In my application i have to point 10 place and have to use that custom infowindow 在我的应用程序中,我必须指出10个位置并必须使用该自定义信息窗口

我知道了,我们只需要用新的参数集调用customInfoWindow类多少次即可。

Not sure exactly if this is what the question was - but you can attach a piece of your own data to the marker using marker.userData. 不确定是否是问题所在-但是您可以使用marker.userData将自己的数据附加到标记。 You can make this anything you want - an NSDictionary for example. 您可以将其设为任何所需的内容-例如NSDictionary。 In -markerInfoWindow:(GMSMarker *marker) you can retrieve the userData and based on that, you can decide what view you want to return. 在-markerInfoWindow:(GMSMarker * marker)中,您可以检索userData并根据该数据来确定要返回的视图。 Make sure the userData contains sufficient data to decide what your view should contain and you are good to go. 确保userData包含足够的数据来决定您的视图应包含什么并且您可以使用。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM