I used Grid-based Clustering technique and i tried to port markerclusterer.js code that is from google-maps-utility-library-v3 project.
We have two classes for marker cluster operation.
public class MarkerClusterand
public class MarkerClusterer
MarkerCluster class is the object that is container for clustered markers, and MarkerClusterer class has methods to create MarkerCluster objects.
How to use them?
- Add
MarkerCluster,MarkerClustererandMapUtilsclasses to your project. You can find them in the sample project.MapUtilsclass has mathematical calculations for our classes. - Create your markers.
- Call
createMarkerClustersmethod ofMarkerClustererclass. It returns list ofMarkerClusterobject list. - Loop on
MarkerClusterobject list and create your markers to add map.
You can find source code and sample usage on
Don't forget to set your "API_KEY" in manifest file to run sample project.
3 comments:
Hi,
nice Class ;)
Is there a method to uncluster a selected cluster by onclick?
Regards,
Bernd
The application close before start... I dont know why. I have my "API_KEY" but I dont know if I need to do something esle to use the google play services on my application. Any help will be appreciated.
Regards!
Marcelo.
Hey can you provide code. i can't find link for code in your post.
thanks.
Post a Comment