Search code examples
iosswiftannotationsmapboxmglmapview

How to disable user interaction for MGLAnnotation?


I am using mapbox and have a post made up of 2 annotations. One can and another cannot (should not) be selectable.

How can I make a specific MGLAnnotation unselectable?

I have looked here and here and did not find a solution.


Solution

  • Turns out the solution is very simple inside of the class Custom2DotAnnotation: MGLAnnotationView { just add self.isEnabled = false