如何禁用 MGLAnnotation 的用户交互?

How to disable user interaction for MGLAnnotation?

我正在使用 mapbox 并有一个 post 由 2 个注释组成。一个可以,另一个不能(不应该)可选。

如何使特定的 MGLAnnotation 不可选择?

我已经查看 here and here 并没有找到解决方案。

事实证明,class Custom2DotAnnotation: MGLAnnotationView { 内部的解决方案非常简单 只需添加 self.isEnabled = false