如何检测地图视图上显示的注释标注? [英] how to detect a callout of an annotation is showing on mapview?

查看:30
本文介绍了如何检测地图视图上显示的注释标注?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个与签到相关的应用程序.当用户点击地图上的一个地点时,标注将弹出并显示其名称和地址.同时,如果场地距离当前位置1000m以内,会显示签到按钮.

I have a checkin related app. When user clicks a venue on map, callout will popup and show its name and address. At the same time, if the venue is within 1000m from current location, a check in button will be displayed.

去一个可以签到的场地,我想要的就是,

To a venue that can checkin, all I want is,

当标注弹出时,签入按钮显示.当标注消失时,该按钮也会消失.

when callout is popup, check in button shows. when callout is disappear, that button disappears too.

现在显示按钮效果很好,但我不知道如何检测标注可见状态.有没有callout show/hide的回调方法?

Now show button works well, but I don't know how to detect callout visible status. Is there any callback method that callout show/hide?

提前致谢!

推荐答案

标注被选中时出现 - 您可以在委托中使用 mapView:didSelectAnnotationView: 方法来跟踪该事件.取消选择注释时标注隐藏 - 使用 mapView:didDeselectAnnotationView: 方法跟踪该事件.

Callout appears when annotation is selected - you can use mapView:didSelectAnnotationView: method in delegate to track that event. Callout hides when annotation is deselected - use mapView:didDeselectAnnotationView: method to track that event.

这篇关于如何检测地图视图上显示的注释标注?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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