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

[Compose] PointAnnotationGroup not working #2566

Open
k3nda opened this issue Jan 22, 2025 · 0 comments
Open

[Compose] PointAnnotationGroup not working #2566

k3nda opened this issue Jan 22, 2025 · 0 comments
Labels
bug 🪲 Something isn't working

Comments

@k3nda
Copy link

k3nda commented Jan 22, 2025

Environment

  • Android OS version: 14
  • Devices affected: Probably all (tested on Lenovo Tab M10 5G)
  • Maps SDK Version:
    • com.mapbox.maps:android:11.8.0
    • com.mapbox.extension:maps-compose:11.8.0
    • com.mapbox.mapboxsdk:mapbox-sdk-services:7.3.1

Observed behavior and steps to reproduce

  1. Put MapboxMap component with PointAnnotationGroup into composable screen
  2. Add some list of PointAnnotationOptions into annotations
  3. Check map - no points with icon rendered in map

Expected behavior

See icons on map regarding to point list passed to PointAnnotationGroup

Additional links and references

Source code:

@Composable
fun Screen() {
    val context = LocalContext.current

    MapboxMap(
        modifier = Modifier
            .background(MaterialTheme.colorScheme.background)
            .fillMaxSize(),
    ) {
        PointAnnotationGroup(listOf(PointAnnotationOptions().withGeometry(Point.fromLngLat(90.29771225710647, 25.532711543120797)))) {
            iconImage = IconImage(BitmapFactory.decodeResource(context.resources, R.mipmap.red_marker))
        }
    }
}

Icon:
Image

Observations / Debugging

When I use image from your example IconImage("fire-station") then it is working. But I also have in the map PointAnnotation with same image passed into and it is working and shows on map. So there is probably some issue with rendering images like in example above in PointAnnotationGroup.

This is working:

PointAnnotation(Point.fromLngLat(90.29771225710647, 25.532711543120797)) {
    iconImage = IconImage(BitmapFactory.decodeResource(context.resources, R.mipmap.red_marker))
}
@k3nda k3nda added the bug 🪲 Something isn't working label Jan 22, 2025
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