                     preferredLocations = [.left, .top]
                 }
             }
-        }
-        
-        let annotationSize = annotationView.frame.size
-        let spacing: CGFloat = 5
-        let annotationCenter = view.convert(annotationView.center, from: mapView)
+        } else if isViewModeOverlay {
+            if UIApplication.shared.wmf_isRTL {
+                if annotationCenter.x >= listAndSearchOverlayContainerView.frame.minX {
+                    preferredLocations = [.bottom, .left, .right, .top]
+                } else {
+                    preferredLocations = [.left, .bottom, .top, .right]
+                }
+            } else {
+                if annotationCenter.x <= listAndSearchOverlayContainerView.frame.maxX {
+                    preferredLocations = [.bottom, .right, .left, .top]
+                } else {
+                    preferredLocations = [.right, .bottom, .top, .left]
+                }
+            }
+            
+        }
+    
         let viewCenter = CGPoint(x: view.bounds.midX, y: view.bounds.midY)
     
         let popoverDistanceFromAnnotationCenterY = 0.5 * annotationSize.height + spacing

        let canFitTopOrBottom = viewSize.width - annotationCenter.x > 0.5*popoverSize.width && annotationCenter.x > 0.5*popoverSize.width
        let fitsTop = top < 0 && canFitTopOrBottom
        let fitsBottom = bottom < 0 && canFitTopOrBottom
        
        
        let canFitLeftOrRight = viewSize.height - annotationCenter.y > 0.5*popoverSize.height && annotationCenter.y > 0.5*popoverSize.width
        let fitsLeft = left < 0 && canFitLeftOrRight

    func adjustLayout(ofPopover articleVC: ArticlePopoverViewController, withSize popoverSize: CGSize, viewSize: CGSize, forAnnotationView annotationView: MKAnnotationView) {
        var preferredLocations = [PopoverLocation]()
        
        
        let annotationSize = annotationView.frame.size
        let spacing: CGFloat = 5
        let annotationCenter = view.convert(annotationView.center, from: mapView)
        
        if let groupAnnotationView = placeGroupAnnotationView {
            let adjustedCenter = view.convert(annotationView.center, from: annotationView.superview)
            let adjustedGroupCenter = view.convert(groupAnnotationView.center, from: groupAnnotationView.superview)
