Swift/MapKit - Annotations overlapping one another

760 views Asked by At

I'm using MapKit in my project and everything works perfectly.

However, I've noticed an issue, annotations may appear over one another, if the longitude and latitude are the same which is understandable. However, as a result, this renders some annotations unaccessible to the user to tap and read more information, as they overlap one another, so my question is - is there a way I can ensure that even if the long & lat are the exact same annotations can be spaced out or avoid the overlapping?

I've even zoomed in and they're directly above one another.

1

There are 1 answers

2
matt On

Annotations cannot be spaced out if they are indeed the same location. Your options are:

  • You can cluster multiple proximate annotations into a single annotation by giving the annotation views a clusteringIdentifier

  • You can hide annotations if they would otherwise overlap another annotation by giving the annotations views a lowered displayPriority

But you cannot make them appear in a false location, no.