Можно ли управлять z-индексом MGLAnnotationView в iOs? Желтые и зеленые аннотации должны быть над синими на прикрепленном скриншоте . Я добавляю аннотацию следующим образом:
var annotationView = mapView2.dequeueReusableAnnotationView(withIdentifier: reuseIdentifier) if annotationView == nil { annotationView = CustomAnnotationView(reuseIdentifier: reuseIdentifier) switch reuseIdentifier { case "NP" : let animageView = UIImageView(image: imageGreen) annotationView?.addSubview(animageView) //annotationView?.bringSubview(toFront: annotationView!) break (...)
Большое спасибо!
Z-индекс может быть установлен с помощью следующей строки кода:
annotationView?.layer.zPosition = 3
чем выше число, тем ближе к пользователю