Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to customize the callout bubble for MKAnnotationView?
    primarykey
    data
    text
    <p>I'm currently working with the mapkit and am stuck.</p> <p>I have a custom annotation view I am using, and I want to use the image property to display the point on the map with my own icon. I have this working fine. But what I would also like to do is to override the default callout view (the bubble that shows up with the title/subtitle when the annotation icon is touched). I want to be able to control the callout itself: the mapkit only provides access to the left and right ancillary callout views, but no way to provide a custom view for the callout bubble, or to give it zero size, or anything else.</p> <p>My idea was to override selectAnnotation/deselectAnnotation in my <code>MKMapViewDelegate</code>, and then draw my own custom view by making a call to my custom annotation view. This works, but only when <code>canShowCallout</code> is set to <code>YES</code> in my custom annotation view class. These methods are NOT called if I have this set to <code>NO</code> (which is what I want, so that the default callout bubble is not drawn). So I have no way of knowing if the user touched on my point on the map (selected it) or touched a point that is not part of my annotation views (delected it) without having the default callout bubble view show up.</p> <p>I tried going down a different path and just handling all touch events myself in the map, and I can't seem to get this working. I read other posts related to catching touch events in the map view, but they aren't exactly what I want. Is there a way to dig into the map view to remove the callout bubble before drawing? I'm at a loss.</p> <p>Any suggestions? Am I missing something obvious?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload