[iOS][Apple Maps] setZIndex: assigns the raw parameter to layer.zPosition, so the callout-open +999 boost never applies

Author: isaacrowntreeCreated Sep 17, 2026Updated Sep 17, 2026

Summary

AIRMapMarker.setZIndex: computes _zIndex with the callout-open boost (AIR_CALLOUT_OPEN_ZINDEX_BASELINE, 999) but then assigns self.layer.zPosition = zIndex, the raw parameter. So the +999 boost is stored but never applied to the layer, and a marker with an open callout does not rise above its neighbours when its zIndex prop is updated while the callout is open.

ios/AirMaps/AIRMapMarker.m, master:

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

Steps to reproduce

  1. Apple Maps provider, two overlapping custom markers A (zIndex 1) and B (zIndex 2).
  2. Open A's callout, then set A's zIndex prop (to any value below B's) while the callout is open.

Expected result

A stays drawn above B while its callout is open, as the +999 boost intends.

Actual result

A drops beneath B; the boost is computed but not applied.

Fix

diff
--- a/ios/AirMaps/AIRMapMarker.m
+++ b/ios/AirMaps/AIRMapMarker.m
@@ -402,7 +402,7 @@
     _zIndexBeforeOpen = zIndex;
     _zIndex = _calloutIsOpen ? zIndex + AIR_CALLOUT_OPEN_ZINDEX_BASELINE : zIndex;
-    self.layer.zPosition = zIndex;
+    self.layer.zPosition = _zIndex;
 }

React Native Maps Version

1.29.0 (present on master, v1.29.2)

What platforms are you seeing the problem on?

iOS (Apple Maps)

React Native Version

0.86, New Architecture

Additional information

Found while auditing z-ordering for a JS-side marker hit test. Note also that zIndex is an NSInteger here, so a fractional zIndex prop (which we had used as a tie-break) is silently truncated; that is arguably by design but worth a line in the docs. A full write-up will be at https://zackdesign.biz/which-pin-did-you-tap/ shortly.

Source: react-native-maps/react-native-maps