mapbox-maps-android
                                
                                 mapbox-maps-android copied to clipboard
                                
                                    mapbox-maps-android copied to clipboard
                            
                            
                            
                        [Compose] - AnnotatedLayerFeature not working in ViewAnnotation
Environment
- Android OS version: 14
- Devices affected: All devices
- Maps SDK Version: 11.3.0
Observed behavior and steps to reproduce
I'm currently displaying a ViewAnnotation for a PointAnnotation. In order to hide the ViewAnnotation when that PointAnnotation is clustered, I'm using the annotatedLayerFeature to set the layer and feature id.
As seen from sample apps and other documentations, setting annotatedLayerFeature should ideally result in a behaviour where ViewAnnotation will be displayed only when that marker is visible. This is working as expected in iOS, but in Android it's not working properly. ViewAnnotation is not at all displayed when using annotatedLayerFeature.
MapboxMap {
    // Rendering markers (Point Annotations)
    PointAnnotationGroup(
        annotations = markers.invoke().map { marker ->
            (PointAnnotationOptions.fromFeature(
                Feature.fromGeometry(
                    marker.point,
                    null,
                    marker.id
                )
            ) ?: PointAnnotationOptions().withPoint(marker.point.toPoint()))
                .withIconImage(marker.icon)
        },
        annotationConfig = AnnotationConfig(
            layerId = "PointAnnotationLayer",
            annotationSourceOptions = AnnotationSourceOptions(
                clusterOptions = ClusterOptions(
                    textColor = Color.WHITE,
                    textSize = 16.0,
                    colorLevels = listOf(
                        Pair(0, Color.BLACK)
                    )
                )
            )
        )
    )
    // Rendering tool windows (View Annotations)
    markers.invoke().forEach { marker ->
        ViewAnnotation(
            options = viewAnnotationOptions {
                geometry(marker.point.toPoint())
                // This has no effect
                annotatedLayerFeature(
                    layerId = "PointAnnotationLayer"
                ) {
                    featureId(marker.id)
                }
                annotationAnchor {
                    anchor(ViewAnnotationAnchor.TOP)
                    offsetY(160.0)
                }
                allowOverlap(false)
            },
            content = marker.toolWindow
        )
    }
}
Expected behavior
When using annotatedLayerFeature option in ViewAnnotation, that ViewAnnotation should be displayed when that marker is visible and it should be hidden when the marker is clustered. This is working properly in iOS.
Notes / preliminary analysis
This feature is working properly in iOS. Also noticed that there is an option to send id for PointAnnotation in iOS. There is no such option in Android to set the id in composable side as well as in PointerAnnotationOption. I tried creating PointAnnotationOption using the fromFeature method, while checking this method I noticed that we are not at all using the id value from the feature.