File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1414#import < React/RCTImageLoader.h>
1515#import < React/RCTUtils.h>
1616#import < React/UIView+React.h>
17+ NSInteger const CALLOUT_OPEN_ZINDEX_BASELINE = 999 ;
1718
1819@implementation AIREmptyCalloutBackgroundView
20+ bool _calloutIsOpen = NO ;
21+ NSInteger _zIndexBeforeOpen = 0 ;
1922@end
2023
2124@implementation AIRMapMarker {
@@ -137,6 +140,9 @@ - (void)fillCalloutView:(SMCalloutView *)calloutView
137140
138141- (void )showCalloutView
139142{
143+ _calloutIsOpen = YES ;
144+ [self setZIndex: _zIndexBeforeOpen];
145+
140146 MKAnnotationView *annotationView = [self getAnnotationView ];
141147
142148 [self setSelected: YES animated: NO ];
@@ -222,6 +228,8 @@ - (void)_handleTap:(UITapGestureRecognizer *)recognizer {
222228
223229- (void )hideCalloutView
224230{
231+ _calloutIsOpen = NO ;
232+ [self setZIndex: _zIndexBeforeOpen];
225233 // hide the callout view
226234 [self .map.calloutView dismissCalloutAnimated: YES ];
227235
@@ -298,8 +306,9 @@ - (void)setPinColor:(UIColor *)pinColor
298306
299307- (void )setZIndex : (NSInteger )zIndex
300308{
301- _zIndex = zIndex;
302- self.layer .zPosition = _zIndex;
309+ _zIndexBeforeOpen = zIndex;
310+ _zIndex = _calloutIsOpen ? zIndex + CALLOUT_OPEN_ZINDEX_BASELINE : zIndex;
311+ self.layer .zPosition = zIndex;
303312}
304313
305314@end
You can’t perform that action at this time.
0 commit comments