amirpiri / android-maps-extensions

Automatically exported from code.google.com/p/android-maps-extensions
0 stars 0 forks source link

min_cluster_size parameter #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
it would be great to have a variable that you could set for the minimum amount 
of markers possible in a cluster - sometimes you end up with the screen full of 
clusters of 2 or 3 which adds alot of clicking. 

I worked around it by setting a camera changed listener on the map and 
unclustering when the zoom level got above 16 (which seems reasonable) but 
there is probably a smarter way to do this.

thanks again for the awesome library, by the way.

Original issue reported on code.google.com by lvid...@gmail.com on 6 Jun 2013 at 4:04

GoogleCodeExporter commented 8 years ago
As a workaround you may change few lines of code in ClusterMarker:

    void refresh() {
        int count = markers.size();
        if (count == 0) {
            cacheVirtual();
        } else if (count == 1) {
            cacheVirtual();
            markers.get(0).changeVisible(true);

into:

        } else if (count < 4) {
                        cacheVirtual();
                        // loop over markers, changing them to visible

Original comment by maciek.g...@gmail.com on 6 Jun 2013 at 9:25

GoogleCodeExporter commented 8 years ago
cool. thanks!

Original comment by lvid...@gmail.com on 7 Jun 2013 at 7:41

GoogleCodeExporter commented 8 years ago
Added ClusteringSettings.minMarkersCount(int)
This will be available in version 2.2

Original comment by maciek.g...@gmail.com on 23 Feb 2014 at 12:00