maplibre / maplibre/maplibre-plugins-android
[Android][Annotation] Incorrect rendering order: symbols with lower symbolSortKey drawn above higher ones
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 50
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
In my application, I am using:
- org.maplibre.gl:android-sdk:11.7.1
- org.maplibre.gl:android-plugin-annotation-v9:3.0.2
I add markers to the map via the SymbolManager API. I have a scenario where I group multiple markers with different symbolSortKey values and place them densely in a small region (sometimes 100–200 symbols in one area). Occasionally, when updating an existing marker or adding a new one, symbols with lower symbolSortKey values briefly render on top of symbols that should be above them (i.e., those with higher symbolSortKey). In some cases, the lower-key symbols completely overlap the higher-key ones.
The issue I had was reproduced on the real device.
Could you advise how to fix this issue so that symbolSortKey is always respected?
I managed to reproduce this behavior in the sample app:
https://github.com/maplibre/maplibre-plugins-android/blob/5688fd779560e9eac0d314f8587f4468d5938a80/app/src/main/java/org/maplibre/android/plugins/testapp/activity/annotation/BulkSymbolActivity.java#L41
Specifically, I added support for symbolSortKey to the uploaded symbols and increment it by 1 for every new symbol. After loading a batch of symbols, I manually add new symbols to the map, and the problem reproduces consistently.
1. The video demonstrating the issue:
https://github.com/user-attachments/assets/ca9c666b-f10a-457d-8169-a6d1464e2daa
https://github.com/user-attachments/assets/436dc850-0477-4578-be1e-d072fb588923
2. Patch with my changes to reproduce the bug:
[reproducing_symbolSortKey_problem.patch](https://github.com/user-attachments/files/20595062/reproducing_symbolSortKey_problem.patch)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with BulkSymbolActivity.java in the annotation sample and apply the linked reproducing patch to run the reported scenario. Add and update densely grouped symbols with differing symbolSortKey values, then verify that lower-key symbols never render above higher-key symbols and that updates do not cause overlap.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100