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

SetInfoWindowAdapter with multiple clusterManager #1365

Open
MrJJOn opened this issue Jun 10, 2024 · 0 comments
Open

SetInfoWindowAdapter with multiple clusterManager #1365

MrJJOn opened this issue Jun 10, 2024 · 0 comments
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@MrJJOn
Copy link

MrJJOn commented Jun 10, 2024

Hello,
thanks for your incredible work. I am using the clustering markers but I'm encountering unexpected behavior.
This is the code:

ArrayList<ClusterManager<ClusterMarkerMeter>> clusterManagers = new ArrayList<>();
for (int i = 0; i < routes.size(); i++) {
    Route route = routes.get(i);
    ClusterManager<ClusterMarkerMeter> clusterManager = new ClusterManager<>(ctx, map);
    clusterManager.setRenderer(new MarkerMeterIconRender(ctx, map, clusterManager, customColors[i % customColors.length]));
    clusterManagers.add(clusterManager);

    for (Reading reading : route.readings) {
        ClusterMarkerMeter item = routes.size() == 1 ? getMarkerColorByStatus(reading) : getClusterMarker(reading, i);
        clusterManager.addItem(item);
    }
    clusterManager.getMarkerCollection().setInfoWindowAdapter(new InfoWindowAdapter(ctx));
    clusterManager.cluster();
}

The setInfoWindowAdapter function works only on the latest clusterManager and not for the previous one. How can i fix this?

@MrJJOn MrJJOn added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant