Android-maps-utils: New ClusterItems not drawn, unless the map is zoomed

Created on 13 Jan 2016  路  7Comments  路  Source: googlemaps/android-maps-utils

This is what happens:

  1. Map is loaded.
  2. First batch of ClusterItems is added.
  3. mClusterManager.cluster()
  4. First batch of ClusterItems is drawn on map.
  5. Second batch of ClusterItems is added.
  6. mClusterManager.cluster()
  7. Second batch of ClusterItems is NOT drawn on map.
  8. Map is zoomed (in or out).
  9. Second batch of ClusterItems is drawn on map.

Is there a workaround to this?

stale

Most helpful comment

I'm having the same issue when updating markers. I'm trying to update marker icons by clearing them and re-adding them but this issue occurs after doing so. This occurs even when clearing the map and item list before adding more items.

All 7 comments

I'm having the same issue when updating markers. I'm trying to update marker icons by clearing them and re-adding them but this issue occurs after doing so. This occurs even when clearing the map and item list before adding more items.

same issue here.

I experience the same problem. The only solution I have to solve this is reset your marker renderer every time you (re)add items. In my scenario:

clusterManager.clearItems();
clusterManager.addItems(cars);
clusterManager.cluster();
clusterManager.setRenderer(new DefaultClusterRenderer<Car>(this, map, clusterManager) {

    @Override
    protected void onBeforeClusterRendered(Cluster<Car> cluster, MarkerOptions markerOptions) {
        ClusterHelper.initCluster(cluster, markerOptions);
    }

    @Override
    protected void onBeforeClusterItemRendered(Car car, MarkerOptions markerOptions) {
        ClusterHelper.initClusterItem(car, markerOptions);
    }
});

Try this method:
mClusterManager.cluster();
worked for me 馃憤

this is still not working on my side.. I tried everything that I found on google and it's still not working

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!

Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Slake07 picture Slake07  路  3Comments

WeiLinJoe picture WeiLinJoe  路  4Comments

harold-hernandez30 picture harold-hernandez30  路  3Comments

leicht-io picture leicht-io  路  6Comments

mengoni picture mengoni  路  4Comments