Recently I worked on an android project in which I managed to add markers to a MapView and cluster those markers if they were too close to each other. Now I have to do the same using the new MapFragment - Google Maps Android API v2.
The markers now are succesfully added to the map, but I can't manage to make the clustering part and I can't find any usuable description about this topic. Do you know a way to implement this using the new API?
Any help would be much appreciated.
Removing all markers You can then clear all the markers using clearMarkers something like this: markerClusterer. clearMarkers(); markers = [];
As it turns out, the Android Maps Util Library https://github.com/googlemaps/android-maps-utils seems to be the number one choice when clustering markers.
For anyone still in need of a clustering solution, also take a look at Clusterkraf. It's an Apache v2 licensed open source clustering library for the Google Maps Android API v2. It clusters points based on pixel proximity, animates transitions between clusters when zooming, handles thousands of markers, and supports Android v2.2 and higher.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With