Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Android Point Clustering Implementation #4693

Closed
bleege opened this issue Apr 13, 2016 · 17 comments
Closed

Android Point Clustering Implementation #4693

bleege opened this issue Apr 13, 2016 · 17 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@bleege
Copy link
Contributor

bleege commented Apr 13, 2016

Point Clustering in the native SDKs is going to make use of @mourner's Supercluster work from GL JS. The Supercluster library will be first ported to Core GL in C++ and then the Android bindings will be written on top to expose it for use in the Mapbox Android API. An example activity will also be created in the Android TestApp for development and general demonstration purposes.

@mapbox/mobile @twbell

@bleege bleege added the Android Mapbox Maps SDK for Android label Apr 13, 2016
@tobrun
Copy link
Member

tobrun commented Apr 13, 2016

Linking #320

@1ec5 1ec5 mentioned this issue Apr 13, 2016
@shfishburn
Copy link

When is this going to be implemented for the iOS SDK and released?

@twbell
Copy link

twbell commented Apr 13, 2016

@shfishburn working on timing now; forthcoming.

@1ec5
Copy link
Contributor

1ec5 commented Apr 13, 2016

@shfishburn, we’re planning to tackle this on both platforms roughly in tandem. Both SDKs are blocked on support at the core, cross-platform level, however. We’re tracking that work in #320.

@shfishburn
Copy link

Assuming the architect of an iOS or Android client implements a lazy loading pattern for POIs to be displayed in a list or map view, then the need to cluster markers at the scope of (say) North America is a bit of overkill (IMHO). Don't think a bit circle with a massive integer is necessary over the United States to inform a user "there be dragons here." That's not a great user experience. I understand doing this work in the core and in tandem, but "forthcoming" and "soon" are variables that contribute to difficult decision on allocating resources and just doing something outside the MapBox SDK.

@1ec5
Copy link
Contributor

1ec5 commented Apr 13, 2016

This is a little off-topic for this issue, but lazily loading annotations is somewhat orthogonal to clustering. The Android and iOS SDKs already allow you to add and remove annotations/markers relatively efficiently. #4694 would make it easier for you to know when to add or remove an annotation. Or is #320 (comment) still representative of what you’re hoping to accomplish? As demonstrated in this blog post, Supercluster can also be useful for heat map–style visualizations in addition to traditional, numbered clustering.

@shfishburn
Copy link

Lazy loading is appropriate even with clustering in very high density, ubran areas. Think of Manhattan where it takes almost a street level zoom on the map to de-cluster and present discrete markers that represent the POIs. Smart, lazy loading based on certain conditions along with clustering is generally our approach because of density. Yes, #320 is what we're trying to accomplish.

By the by numbered clustering is not our fave. We've implemented something in a prior version of our platform called dots and markers. It works well but the port from Google Maps to Mapbox is quite an effort. Perhaps we should get started :)

@subashsn
Copy link

Please add this feature soon! Faced too many issues with legacy sdk, so using googleMaps for now :/

@AAverin
Copy link

AAverin commented Apr 28, 2016

Just started developing a new app and was surprised to find out that clusters are not yet supported.
Will be definitively waiting for this feature to appear.

@abhinav-adtechs
Copy link

Waiting desperately for this feature to be added ASAP!
Please give an ETA.

@shfishburn
Copy link

Mapbox has gone dark on a date.

On Mon, May 16, 2016 at 11:34 AM, Abhinav Das [email protected]
wrote:

Waiting desperately for this feature to be added ASAP!
Please give an ETA.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#4693 (comment)

@twbell
Copy link

twbell commented May 16, 2016

@shfishburn, @abhinav-adtechs, @AAverin:

@bleege's notes in his OP are still valid. In absolute terms we are working on the Core GL work for this feature now, and you'll see the capability expose in the Next +1 Release: iOS 3.4/Android 4.2. We are targeting Q3 for this feature, so somewhere in the July/August timeframe.

A broader note on timing and release dates: we do not post a Release Date until we can be fairly confident of hitting it; this usually means that the release is fully scoped and the necessary research is completed. We've all been on the receiving end of delayed releases, so we're trying to avoid being overly optimistic. I appreciate that the other end of the spectrum is opacity, which is equally unhelpful, so I'll work more to give what guidance we can as soon as we can give it.

@2ndGAB
Copy link

2ndGAB commented Aug 4, 2016

Hello,
Just to give my 2 cents because I'm using clustering on Android and I'm very interesting to get it on iOS, clustering goal is not to hide markers/annotations but to reduce their number in high annotations density areas.

I mean, as Google Map API does, it's necessary to define a minimal number of annotations to cluster (by default 5 for example) to prevent to have to deeply zoom an area to see just 2 annotations close together.

And I hope that as we do on Android, we will be able to customize annotation icon and cluster icon.

@jfirebaugh jfirebaugh added this to the android-v4.2.0 milestone Sep 19, 2016
@zugaldia
Copy link
Member

Support for clustering via a GeoJson source has been brought to Android in #5852. The equivalent iOS approach (via a MGLGeoJSONSource) was done in #5962.

We've also published a sample CreateHeatmapPointsActivity that shows how to use this new API:

ezgif com-video-to-gif 3

Closing this now as all tasks listed in OP have been completed.

@1ec5
Copy link
Contributor

1ec5 commented Sep 20, 2016

If you need interactivity with clustered GeoJSON points, you’ll need to install your own click handler that queries for nearby rendered features and displays their information in the UI. The SDK does all this for you if you use a Marker; #5814 and #5815 tracks implementing clustering for Marker too.

@vikoo
Copy link

vikoo commented Nov 28, 2017

@1ec5 How to get the geo points from cluster click? Do you have any example for this?

@1ec5
Copy link
Contributor

1ec5 commented Nov 30, 2017

@vikoo, the Android demo repository would be the place to look for examples. mapbox/mapbox-android-demo#560 might be of interest to you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests