Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.WritableNativeMap;
import com.facebook.react.uimanager.NativeViewHierarchyManager;
import com.facebook.react.uimanager.UIBlock;
Expand Down
13 changes: 11 additions & 2 deletions lib/ios/AirMaps/AIRMapMarker.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
#import <React/RCTImageLoader.h>
#import <React/RCTUtils.h>
#import <React/UIView+React.h>
NSInteger const CALLOUT_OPEN_ZINDEX_BASELINE = 999;

@implementation AIREmptyCalloutBackgroundView
bool _calloutIsOpen = NO;
NSInteger _zIndexBeforeOpen = 0;
@end

@implementation AIRMapMarker {
Expand Down Expand Up @@ -137,6 +140,9 @@ - (void)fillCalloutView:(SMCalloutView *)calloutView

- (void)showCalloutView
{
_calloutIsOpen = YES;
[self setZIndex:_zIndexBeforeOpen];

MKAnnotationView *annotationView = [self getAnnotationView];

[self setSelected:YES animated:NO];
Expand Down Expand Up @@ -222,6 +228,8 @@ - (void)_handleTap:(UITapGestureRecognizer *)recognizer {

- (void)hideCalloutView
{
_calloutIsOpen = NO;
[self setZIndex:_zIndexBeforeOpen];
// hide the callout view
[self.map.calloutView dismissCalloutAnimated:YES];

Expand Down Expand Up @@ -298,8 +306,9 @@ - (void)setPinColor:(UIColor *)pinColor

- (void)setZIndex:(NSInteger)zIndex
{
_zIndex = zIndex;
self.layer.zPosition = _zIndex;
_zIndexBeforeOpen = zIndex;
_zIndex = _calloutIsOpen ? zIndex + CALLOUT_OPEN_ZINDEX_BASELINE : zIndex;
self.layer.zPosition = zIndex;
}

@end