0

I'm trying to add the little bubble callout things similar to how Apple Maps does it in the attached screenshot. I know there was a post (Custom "Callouts" for MKPolyline) where someone asked a similar question, but the answer pointed to an article that no longer exists. And it didn't seem to be related to the bubbles.

I can't seem to figure out how to make this happen exactly. I know where I want them to be and I need the bubbles to always be visible as well. Anyone have any suggestions?

Edit: I also have seen (Annotation along route in MapKit), but the answers deviated into where to put the annotations along the route, which I already know how to do. It's specifically the route callout bubbles that are giving me lots of trouble.

callouts on multiple routes

Community
  • 1
  • 1
gplocke
  • 701
  • 7
  • 14
  • > I know where I want them to be and I need the bubbles to always be visible as well. What are you trying and what is not working about it? – incanus Jan 27 '15 at 19:00
  • I've tried with MKPinAnnotations and a custom MKAnnotationView implementation. However, these solutions don't really work because you can only have a single annotation selected. If you try and select another one, then the MapView will close the previously selected one(s). – gplocke Jan 27 '15 at 19:05
  • I haven't gotten any code that's even come close to being able to display something like this, so I don't really have much code to show that's relevant or not just an implementation of an MKAnnotationView. – gplocke Jan 27 '15 at 19:07
  • 1
    @gplocke: If using annotations, don't rely on the callout since only one can be selected at a time as you saw. Instead, you can add a UILabel to the annotation view. Alternative to annotations is to add the bubbles as overlays and draw them and their text manually. Examples: http://stackoverflow.com/questions/22723449/render-title-of-mkpolygon, http://stackoverflow.com/questions/9822756/replace-icon-pin-by-text-label-in-annotation. First example contains links with ideas about how to go with the custom overlay approach. –  Jan 27 '15 at 20:50
  • Thanks @Anna, those links definitely help shed some light on my issue and I understand how this thing operates now. Thanks! – gplocke Jan 28 '15 at 14:35

0 Answers0