mapbox/mapbox-gl-native

queryRenderedFeatures does not respect the vertical order of layers

JonasVautherin opened this issue · 1 comments

I have this issue (on Android) where sometimes, if two annotations are rendered on top of each other, the one rendered below is the one getting the drag event. Which is wrong: the visible annotation should obviously be the one receiving the drag.

I made a video showing the issue here, together with a code snippet (for Android):

mapbox-zindex-bug.mp4

I believe I tracked the issue down to the render_orchestrator.cpp, in queryRenderedFeatures. To me it seems that somehow, this does not return the right layer, or it does not return the layers in the right order (taking into account the vertical order as defined with aboveLayer and belowLayer, or something along those lines.

Unfortunately I am not super familiar with that code. Could it be that I am right, and there is a bug there regarding the vertical order of the layers?

Hmm I'm starting to think that the C++ part is per layer, and my problem is between layers. Which would be on the Android side, after all.