z-index MGLAnnotationView mapbox IOS

z-index MGLAnnotationView mapbox IOS

是否可以在 iOs 中管理 MGLAnnotationView 的 z-index? The yellow and green annotations are supposed to be over blue ones in the attached screenshot。我以这种方式添加注释视图:

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-index:

annotationView?.layer.zPosition = 3

数字越大越接近用户