erik
erik

Reputation: 4958

ClusterManager Google Map Utility V2 iterating through a cluster

I am working with the Google Maps Utility v2 / ClusterManager for Android. There is very little documentation on this, but for the most part I have it all working. I was just about to implement the OnClusterClickListener Which i had assumed would allow me to iterate through the cluster..

ie:

mClusterManager.setOnClusterClickListener(new OnClusterClickListener(){

            @Override
            public boolean onClusterClick(Cluster<mObject> cluster) {
                for(int i =0; i<cluster.size(); i++){
                      Log.v("CLUSTER", "mObject's certain property is:"+ cluster.get(i).mProperty);

                }
                return false;
            }

        });

But apparently that is not the case.. the cluster only has a few public methods as seen in the image below, and with no documentation that i can find, I was hoping someone had experience with this utility and could get me over this stupid hump.

enter image description here

Upvotes: 3

Views: 1260

Answers (1)

MaciejG&#243;rski
MaciejG&#243;rski

Reputation: 22232

It looks like

for (DRPDrop drop : cluster.getItems()) {
    // do things with your object
}

should work to iterate over your implementation of ClusterItem.

Upvotes: 3

Related Questions