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.35k stars 1.33k forks source link

Symbol order not consistent when zooming in/out #16577

Open florianPOLARSTEPS opened 3 years ago

florianPOLARSTEPS commented 3 years ago

Platform: IOS, Android Mapbox SDK version:, android-v9.6.0, ios-v6.3.0

Description

It seems that for some reason when zooming in/out symbols that are almost on top of another change drawing order.

no_sort_key

Steps to trigger behavior

I am not totally sure what produces this issue, but I can see it happening with the following steps in some cases. ( see attached videos )

  1. Create layer with a circle of symbols (all the same size) with a couple of them almost on top of another. (allow-overlap:true, ignore-placement:true)
  2. Zoom in and out and see the symbols that are at some point glitching and not behaving consistently.

Expected behavior

The order and drawing of symbols is deterministic (in cases where they do not collide with anything on the map) and not based on zoom level or any other logic.

Actual behavior

It seems that some logic hides and shows symbols that should not be affected by any collision logic or changes the drawing order when zooming.

Workaround

A workaround I found is to use the sort_key layout property to forcefully assign a drawing order. But in my view that should not be necessary.

sort_key