开发者

How to Make A Callout Appear for MKOverlay Region?

开发者 https://www.devze.com 2023-02-08 11:46 出处:网络
I have used a gesture recognizer and the boundingRect for a given overlay to determine when a user taps on it. However I would now like to make a callout appear over开发者_Go百科 the overlay region th

I have used a gesture recognizer and the boundingRect for a given overlay to determine when a user taps on it. However I would now like to make a callout appear over开发者_Go百科 the overlay region that the user taps, just like how it is done for annotations. Must I create the overlays as annotations in order to accomplish this? Thanks.


Overlays are also annotation objects if you wish.

From the Location Awareness Programming Guide:

The MKOverlay protocol conforms to the MKAnnotation protocol. As a result, all overlay objects are also annotation objects and can be treated as one or both in your code. If you opt to treat an overlay object as both, you are responsible for managing that object in two places. If you want to display both an overlay view and annotation view for it, you must implement both the mapView:viewForOverlay: and mapView:viewForAnnotation: methods in your application delegate. It also means that you must add and remove the object from both the overlays and annotations arrays of your map.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号