在实现mapView:didTapMarker时,在Google Maps iOS sdk中点击标记时显示信息窗口:已实现委托方法 [英] Displaying info window when tapped marker in google maps iOS sdk while implementing mapView:didTapMarker: delegate method implemented

查看:120
本文介绍了在实现mapView:didTapMarker时,在Google Maps iOS sdk中点击标记时显示信息窗口:已实现委托方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,这是一个长标题.我在使用Google Maps iOS SDK时遇到麻烦.我想显示一个有关用户点击的标记的信息窗口.根据文档,如果同时选择了GMSMarker的代码段和标题属性,则在用户点击该标记时将显示信息窗口.但是我还从GMSMapViewDelegate协议实现了mapView:didTapMarker:方法.如果我注释掉该方法的信息窗口是可见的,否则信息窗口是不可见的.那么,实现该方法后如何显示信息窗口?

Ok it is a long title. I am having trouble when i use google maps iOS sdk. I want to show an info window about a marker which user tapped. According the documentation if snippet and title properties of GMSMarker are both selected info window will be shown when user tapped that marker. But I also implement mapView:didTapMarker: method from GMSMapViewDelegate protocol. If I comment out that method info window is visible otherwise info window is not visible. So how can I show info window when that method implemented?

推荐答案

实施GMSMapViewDelegatemapView:didTapMarker:方法,并使其返回false.

Implement GMSMapViewDelegate's mapView:didTapMarker: method and make it return false.

快速实施:

func mapView(mapView: GMSMapView!, didTapMarker marker: GMSMarker!) -> Bool {
    return false
}

这篇关于在实现mapView:didTapMarker时,在Google Maps iOS sdk中点击标记时显示信息窗口:已实现委托方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆