mapbox-maps-android icon indicating copy to clipboard operation
mapbox-maps-android copied to clipboard

Multiple PointAnnotationManagers with clustering interfere with each other.

Open tukez opened this issue 2 years ago • 3 comments

Environment

  • Android OS version: 10
  • Devices affected: DJI RC Pro
  • Maps SDK Version: 11.0.0-beta.5

Observed behavior and steps to reproduce

labelAnnotations: PointAnnotationManager =
        annotations.createPointAnnotationManager(AnnotationConfig(layerId = labelAnnotationLayerId,
                                                                  annotationSourceOptions = AnnotationSourceOptions(clusterOptions = ClusterOptions(
                                                                      clusterRadius = 20,
                                                                      circleRadius = 0.0,
                                                                      textSize = 0.0,
                                                                      clusterMaxZoom = 100))))
pointAnnotations: PointAnnotationManager =
        annotations.createPointAnnotationManager(AnnotationConfig(layerId = pointAnnotationLayerId,
                                                                  annotationSourceOptions = AnnotationSourceOptions(clusterOptions = ClusterOptions(
                                                                      clusterRadius = 20,
                                                                      circleRadius = 12.0,
                                                                      clusterMaxZoom = 16))))

In the above code, both annotation managers seem to share the same clusterer. Point annotations are clustered between managers and I think the settings come from the first created annotation manager.

Expected behavior

Both annotations managers cluster annotations separately with their respective configurations.

tukez avatar Oct 31 '23 12:10 tukez

This might be caused by the fact that AnnotationManagerImpl generates non unique cluster layer ids.

tukez avatar Nov 01 '23 12:11 tukez

Hey! Could this also cause the issue I am having where if I have multiple PointAnnotationManagers, I cannot have unique PointAnnotationListeners?

blakecsharp avatar Jan 06 '24 00:01 blakecsharp

I also have this problem... I want to use two PointAnnotationManager with two clusters...

ssss1108 avatar Mar 28 '24 02:03 ssss1108