You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MarkerViews are not affected by the zIndex property passed in as a style prop. Therefore it does not seem possible to set a desired order to sibling MarkerView components. As a result the MarkerView that appears on top is the Marker that is closest to the closing </MapView>.
Expected behavior
I would expect <MarkerBlue /> to appear on top if it's zIndex is set higher than the zIndex of <MarkerRed />
Notes / preliminary analysis
Because of this behaviour it does not appear to be possible to programmatically set the order of sibling MarkerViews.
For example the coordinate value for one of the markers may depend on an value becoming available which creates a race condition and may result in it getting put on top regardless of its position within a MapView.
E.g. the blue marker here may not have userLocation available immediately. So when it becomes available it will appear on top of the red marker.
This makes it hard to maintain the desired order of overlapping MarkerViews.
Mapbox Implementation
Mapbox
Mapbox Version
10.7.0
React Native Version
0.73.7
Platform
Android
@rnmapbox/maps
version10.1.19
Standalone component to reproduce
Observed behavior and steps to reproduce
MarkerViews are not affected by the
zIndex
property passed in as a style prop. Therefore it does not seem possible to set a desired order to sibling MarkerView components. As a result the MarkerView that appears on top is the Marker that is closest to the closing</MapView>
.Expected behavior
I would expect
<MarkerBlue />
to appear on top if it'szIndex
is set higher than thezIndex
of<MarkerRed />
Notes / preliminary analysis
Because of this behaviour it does not appear to be possible to programmatically set the order of sibling MarkerViews.
For example the coordinate value for one of the markers may depend on an value becoming available which creates a race condition and may result in it getting put on top regardless of its position within a MapView.
E.g. the blue marker here may not have userLocation available immediately. So when it becomes available it will appear on top of the red marker.
This makes it hard to maintain the desired order of overlapping MarkerViews.
Additional links and references
N/a
The text was updated successfully, but these errors were encountered: