1

I need to show calloutView for all 3 annotations I presently have on the map, and let the user decide which he will interact with based on the info written on those callouts.

I tried calling:

[[SKRoutingService sharedInstance].mapView showCalloutForAnnotation:annotation1 withOffset:CGPointMake(0, 52.0f) animated:YES];
[[SKRoutingService sharedInstance].mapView showCalloutForAnnotation:annotation2 withOffset:CGPointMake(0, 52.0f) animated:YES];
[[SKRoutingService sharedInstance].mapView showCalloutForAnnotation:annotation3 withOffset:CGPointMake(0, 52.0f) animated:YES];

But it results in showing a CalloutView only for the last annotation.

Any solution to this?

SteBra
  • 4,188
  • 6
  • 37
  • 68
  • 1
    It's covered here: http://stackoverflow.com/questions/2417952/multiple-annotation-callouts-displaying-in-mkmapview – lukeswitz Aug 04 '15 at 22:58

1 Answers1

4

Actually, I solved this with making a custom UIView for annotation, adding the Map pin and the UIView that was supposed to be a Callout View. In there, i added a label that will hold the value I need to show to the user

SteBra
  • 4,188
  • 6
  • 37
  • 68
  • Unfortunately no, I don't have a hold of that code any more as I did it long time ago. But the main idea is this: instead of just showing the map pin and then showing the callout view once you click on the pin, make the annotation to look like a combination of the map pin and the callout view above it as a default. That way you can customize it to look whatever you want it. You can put your labels and buttons on that callout view and connect them with the appropriate IBActions of your choosing – SteBra Dec 20 '17 at 11:05
  • 1
    no problem i got the answer https://stackoverflow.com/questions/47887717/how-to-add-a-customview-xib-as-annotation-in-ios – rolling Ztoned Dec 20 '17 at 11:17