mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.34k stars 1.33k forks source link

queryRenderedFeatures does not respect the vertical order of layers #16675

Closed JonasVautherin closed 11 months ago

JonasVautherin commented 11 months ago

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):

https://github.com/mapbox/mapbox-gl-native/assets/2606672/150af11c-1591-4965-b1b4-63c445f802d5

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?

JonasVautherin commented 11 months ago

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.