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

Support for Clustering? #12

Open
The0ldM0nk opened this issue Sep 20, 2017 · 3 comments
Open

Support for Clustering? #12

The0ldM0nk opened this issue Sep 20, 2017 · 3 comments

Comments

@The0ldM0nk
Copy link

So, is clustering supported out-of-the-box?
Looking forward to it :)

@josh-burton
Copy link
Collaborator

Hi, there is no direct support for clustering, although this is something you could achieve by manipulating your data.

Since MapMe adapters support multiple annotation types, you could define a type for a cluster, and organise your data into clusters.

I'd be interested to hear what features you would like to see for clustering?

@dellisd
Copy link

dellisd commented Oct 19, 2017

This may go beyond the scope of this library, but adding a set of classes to automatically create some kind of ClusterAnnotation would be useful. You could run your data points through some sort of function (kind of like running a DiffUtil) which would generate clusters of points which could then be sent to the adapter.

This would probably be best to do on a per-project basis but, the way I see it since clustering markers is such a common need for apps, including it in the library would be quite beneficial.

@trevjonez
Copy link

as a base level setup for the clustering you can use the NonHierarchicalDistanceBasedAlgorithm from com.google.maps.android:android-maps-utils:0.5. The getClusters(zoom) will return a set of Cluster objects. In my case I unwrap any cluster item that is a single item and let my original pin data representation through. In the other cases my pluggable version of the mapme adapter just gets told how to render the StaticCluster type that the cluster algorithm produces for actual clusters. It returns a private class implementation of Cluster called QuadItem when it is a single item.

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

4 participants