mapbox / mapbox/mapbox-maps-android

Offset Map Elements flickering during zoom

Open
#2,609 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Kotlin
Stars
578
Forks
161
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Android OS version: At least 13-15, probably any version
- Devices affected: /
- Maps SDK Version: 11.7.0 - latest(11.11.0), also affects v11.12.0-beta.1

## Observed behavior and steps to reproduce

I have a map in compose on which several elements are shown or offset depending on the zoom level. Since version 11.7.0 the elements seem to flicker while zooming. It seems as if the offset is recalculated and the element is shown at the original position.

## Expected behavior

My expectation would be that the elements would not flicker at all and behave comparable to the previous versions.

## Notes / preliminary analysis

I have tested this in a sample project and could not reproduce it in versions <11.7.0. Nevertheless, the error is contained in all versions up to today (11.11.0).

## Additional links and references

https://github.com/user-attachments/assets/844b1807-4e52-4c43-9dd8-00129e1c8fb8

Here is the code that i used for the example project in the video:

```kotlin
style.addImage(
imageId = "image",
image = bitmap
)
style.addImage(
imageId = "image2",
image = bitmap2
)
val source = geoJsonSource("pointSource").feature(featurePoint)
style.addSource(source)
style.addLayer(
symbolLayer("layer-test-symbol1", source.sourceId) {
minZoom(14.0)
iconImage("image")
iconAllowOverlap(true)
iconIgnorePlacement(true)
}
)
style.addLayer(
symbolLayer("layer-test-symbol2", source.sourceId) {
iconImage("image2")
iconAllowOverlap(true)
iconIgnorePlacement(true)
iconOffset(
step {
zoom()
literal(listOf(0.0, 0.0))
literal(14)
literal(listOf(0.0, -20.0))
},
)
}
)
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Compose sample using the shown Kotlin style, source, and symbol-layer setup, and reproduce the flicker while zooming on Android 13–15 with Maps SDK 11.7.0 or later. Compare behavior with a version before 11.7.0 and inspect when the zoom-based iconOffset and minZoom changes are applied. Done means the offset elements remain stable while zooming without reverting to their original position.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.