Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when annotation is displayed dynamically #2590

Open
bartek977 opened this issue Mar 11, 2025 · 1 comment
Open

Errors when annotation is displayed dynamically #2590

bartek977 opened this issue Mar 11, 2025 · 1 comment
Labels
bug 🪲 Something isn't working

Comments

@bartek977
Copy link

bartek977 commented Mar 11, 2025

Environment

  • Android OS version: 14
  • Devices affected: Galaxy Tab A8
  • Maps SDK Version: compose 11.10.2

Observed behavior and steps to reproduce

I display annotations dynamically, and when I hide them I can see in logs the following error: [maps-android\Mbgl-StyleObserver]: OnMapLoadError: Source, message: Source mapbox-android-polylineAnnotation-source-1 is not in style, sourceID: null, tileID: null

Expected behavior

The map shouldn't use the removed annotation source.

Notes / preliminary analysis

the problem is easy to reproduce:

Column {
                    var showAnnotation by remember { mutableStateOf(false) }
                    Button(onClick = { showAnnotation = !showAnnotation }) {
                        Text(if (showAnnotation) "hide" else "show")
                    }
                    MapboxMap(Modifier.fillMaxSize()) {
                        if (showAnnotation) {
                            PolylineAnnotation(
                                points = listOf(Point.fromLngLat(-180.0, 0.0), Point.fromLngLat(180.0, 0.0))
                            )
                        }
                    }
                }

Click the button to show the annotation, then click again, and you will see the error in the logs.

@bartek977 bartek977 added the bug 🪲 Something isn't working label Mar 11, 2025
@bartek977
Copy link
Author

Could someone look at this, please? Is my implementation wrong? Or will it be fixed on your side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant