Android-maps-utils: Clearing items and re-adding doesn't always work

Created on 26 May 2015  路  1Comment  路  Source: googlemaps/android-maps-utils

I am having an issue with this library. Whenever I clear the items from the cluster manager and add a new set, some single pins are not redrawn. Here's what I am doing:

private void displayMarkers(List markersToShowOnMap) {
map.clear();
mClusterManager.clearItems();
mClusterManager.addItems(markersToShowOnMap);
mClusterManager.cluster();
}

If I call this method with the same set of markers, while zoomed in such that some clusters are displayed and some single markers are displayed, the single markers disappear! I am using the DefaultClusterRenderer. I have logged the renderer and onBeforeClusterItemRendered is not being called a second time after clearing and re-adding items. If i zoom out and back in, the missing markers re-appear.

>All comments

I seem to have fixed this on my own. I removed the map.clear(); and all is well! It somehow interferes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patriotaSJ picture patriotaSJ  路  7Comments

programmeraditya picture programmeraditya  路  5Comments

lschlessinger1 picture lschlessinger1  路  6Comments

dadino picture dadino  路  7Comments

air89 picture air89  路  6Comments