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

Wrong count #27

Closed
cesarferreira opened this issue Oct 14, 2013 · 5 comments
Closed

Wrong count #27

cesarferreira opened this issue Oct 14, 2013 · 5 comments

Comments

@cesarferreira
Copy link

Hi,
first of all thanks for the lib, it's awesome!
I run into a little issue, when I add markers dynamically the Sum of the markers goes nuts. For example, I have 5 markers, I have a button that adds a new marker, when I do it and zoom out the "5" now says "10" and when I zoom in it shows the 6 markers on the map, is this an issue or am I missing some objet.redraw() method call?

@broady
Copy link
Contributor

broady commented Oct 14, 2013

Thanks! Glad the library is helpful.

You can call ClusterManager.cluster() to force a re-cluster and a re-draw. You should probably make that call if you're adding a marker after the user presses a button.

Let me know if that fixes your problem.

@cesarferreira
Copy link
Author

Many thanks! 👍

ClusterManager.clear();
ClusterManager.addItems(items);
ClusterManager.cluster();

This fixed it! :)

@LunevNF
Copy link

LunevNF commented Jan 19, 2017

Hi!
I have the same issue, but after *.clearItems() >> *.addItem() >> *.cluster() I not see cluster markers, only a lot of simple markers. Please, help me =(

@LunevNF
Copy link

LunevNF commented Jan 19, 2017

ThisApp.getGlobals().mClusterManager.clearItems();
for (final ArrayList thisPoint : ThisApp.getGlobals().listOfVisiblePoints) {
final LatLng latLng = new LatLng(
Double.parseDouble(thisPoint.get(8)),
Double.parseDouble(thisPoint.get(9)));
MyItem offsetItem = new MyItem(latLng.latitude, latLng.longitude);
ThisApp.getGlobals().mClusterManager.addItem(offsetItem);
}
ThisApp.getGlobals().mClusterManager.cluster();

This code runs after load points data.

@LunevNF
Copy link

LunevNF commented Jan 20, 2017

I was try all the ways, but this bug exist. Now I use "clusterer" by nlopez and all works good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants