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

Android Point Clustering Implementation #4693

Closed

Description

@bleege

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

Activity

  1. added
    Android
    on Apr 13, 2016
  2. tobrun commented on Apr 13, 2016

    @tobrun
    Member

    Linking #320

  3. shfishburn commented on Apr 13, 2016

    @shfishburn

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

  4. twbell commented on Apr 13, 2016

    @twbell

    @shfishburn working on timing now; forthcoming.

  5. 1ec5 commented on Apr 13, 2016

    @1ec5
    Contributor

    @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.

  6. shfishburn commented on Apr 13, 2016

    @shfishburn

    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.

  7. 1ec5 commented on Apr 13, 2016

    @1ec5
    Contributor

    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.

  8. shfishburn commented on Apr 13, 2016

    @shfishburn

    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 :)

  9. subashsn commented on Apr 24, 2016

    @subashsn

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

  10. tonnyavery commented on Apr 28, 2016

    @tonnyavery

    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.

  11. abhinav-adtechs commented on May 16, 2016

    @abhinav-adtechs

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

  12. shfishburn commented on May 16, 2016

    @shfishburn

    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)

  13. twbell commented on May 16, 2016

    @twbell

    @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.

  14. 2ndGAB commented on Aug 4, 2016

    @2ndGAB

    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.

  15. added this to the android-v4.2.0 milestone on Sep 19, 2016
  16. zugaldia commented on Sep 20, 2016

    @zugaldia
    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.

  17. 1ec5 commented on Sep 20, 2016

    @1ec5
    Contributor

    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.

  18. vikoo commented on Nov 28, 2017

    @vikoo

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

  19. 1ec5 commented on Nov 30, 2017

    @1ec5
    Contributor

    @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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions