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.

Point annotation clustering #5814

Open
Open

Description

@1ec5

The longstanding “GL point annotation” API (exposed as MGLPointAnnotation on iOS and macOS, Marker on Android, and PointAnnotation on Qt) should support options for marker clustering. The GeoJSON point clustering implemented in #5724 is important for parity with Mapbox GL JS, but its use will be somewhat limited until this functionality is extended to point annotations, which have a few important advantages over GeoJSON points:

  • Point annotations can display images that are loaded or even generated at runtime. GeoJSON points can only display images that come with the style (for example, images that are managed in Mapbox Studio). Therefore, it isn’t possible to use a GeoJSON point to represent the current user’s avatar on the map or to draw text into an image and use that image in a GeoJSON point.
  • An application may need to add, remove, and modify annotations very frequently during the course of a map’s lifetime. With a GeoJSON layer, to add, remove, or modify an annotation, you have to blow away the entire layer and reconstruct it. Therefore, it isn’t feasible to animate GeoJSON points smoothly, and it’s very tedious to implement a “long press to drop pin” UI using GeoJSON points exclusively.
  • MGLPointAnnotation and Marker have built-in support for interactivity, opening a popup when tapped. GeoJSON points require the developer to handle gesture recognition, selection, and spatial querying with custom code.

Based on its unique behaviors, mbgl::SymbolAnnotation could not be reimplemented using GeoJSON layers. However, as long as Supercluster is extended to support dynamically changing markers, SymbolAnnotation could use Supercluster much the way GeoJSON layers do now.

We’ll need to add public APIs to the SDKs for configuring marker clustering.

/cc @mourner @jfirebaugh @mapbox/mobile

Activity

  1. added
    Core
    annotations
    on Jul 28, 2016
  2. danetch commented on Aug 12, 2016

    @danetch

    Hi,
    any eta for this ?
    thanks !

  3. 1ec5 commented on Aug 12, 2016

    @1ec5
    ContributorAuthor

    This work is currently blocked by mapbox/supercluster#19.

  4. ShaunBaker commented on Sep 14, 2016

    @ShaunBaker

    Hello

    Any updates on this?

  5. jfirebaugh commented on Sep 14, 2016

    @jfirebaugh
    Contributor

    Thanks for your interest folks. If there is nothing posted here or in the ticket linked above, you can assume there are no updates. We will post when there is.

  6. 1ec5 commented on Sep 27, 2016

    @1ec5
    ContributorAuthor

    If the performance and memory considerations in mapbox/supercluster#19 (comment) would require a painful tradeoff for the usual case of a static point layer, I wonder if it might be possible to stick to the KDBush algorithm: we could “dirty” the clustering index on each annotation addition, modification, or removal and lazily rebuild the index when the zoom level changes.

  7. tonnyavery commented on Oct 7, 2016

    @tonnyavery

    Any workaround, except GeoJSON, I could apply to have clustering in Android application with MapBox SDK?

  8. ttoni commented on Oct 21, 2016

    @ttoni

    First we had to completely rebuild our maps from image to vector (mapbox studio), then we had to wait for customized marker icons, now we have to wait for marker clustering. It was all possible with the old mapbox sdks and an important factor why we switched to mapbox.
    the transition from the old to the new sdk really is a huge tradeoff for our company. Better visual representation through vector, but missing some very basic features that were already there in old mapbox sdk.

    So is there any chance, that we might see clustering again in ios/js/android in the next months?

  9. nitrag commented on Oct 25, 2016

    @nitrag
    Contributor

    +1 in same boat. Crucial features for my application if I'm going to switch
    to Mapbox SDK.

    On Oct 21, 2016 9:44 AM, "ttoni" [email protected] wrote:

    First we had to completely rebuild our maps from image to vector (mapbox
    studio), then we had to wait for customized marker icons, now we have to
    wait for marker clustering. It was all possible with the old mapbox sdks
    and an important factor why we switched to mapbox.
    the transition from the old to the new sdk really is a huge tradeoff for
    our company. Better visual representation through vector, but missing some
    very basic features that were already there in old mapbox sdk.

    So is there any chance, that we might see clustering again in
    ios/js/android in the next months?

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #5814 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AAMBkkg_fshiFe6ZBGHReOi5MWqPSWc2ks5q2MGtgaJpZM4JW21O
    .

  10. danetch commented on Nov 14, 2016

    @danetch

    Hi,
    Can you guys please give us an eta ? I need to know whether I must implement it myself, or if that work is likely to surface in the coming weeks. More to the point, will it see the light before beginning of Feb 2017? thanks !

  11. cammace commented on Nov 14, 2016

    @cammace
    Contributor

    You can do point clustering already using the latest SDK betas and runtime styling. Checkout this example in the Android demo app (the same can be done on iOS).

  12. danetch commented on Nov 14, 2016

    @danetch

    Thanks, that looks like good news :) Stupid follow up question: You are using a GeoJsonSource in this example. Are you implying that the proper way of creating clusterable annotations is through GeoJson, and that we have to format the markers we want clustered as a geojsonstring to be fed as geojsonsource to the mapboxmap ? is it how it is intended to work ? Thanks for your help !

  13. cammace commented on Nov 14, 2016

    @cammace
    Contributor

    This is currently the only way to cluster icons at this point. This ticket is specifically for exposing clustering through GL markers which we are looking to add in the future. Feel free to reach out through our contact page if you have any additional questions.

  14. 20 remaining items

  15. tobrun commented on Jun 22, 2017

    @tobrun
    Member

    Adding here that until the core implementation for this has landed. You can workaround this on Android using the following plugin. Note this is still a WIP, no release out on maven.

    ezgif com-video-to-gif 52

  16. jaltin commented on Oct 19, 2017

    @jaltin

    +1

  17. friedbunny commented on Oct 19, 2017

    @friedbunny
    Contributor

    Thanks for everyone’s interest, but GitHub issues are not a voting platform and “+1” is not a useful contribution — if you wish to follow the progress of this issue, hit the “Subscribe” button and you’ll be notified when something actually happens.

  18. o15a3d4l11s2 commented on Oct 19, 2017

    @o15a3d4l11s2

    @friedbunny I believe there a a lot of people interested in clustering support. Could you please suggest an alternative way for us to express our interest or "vote" for new features?

  19. friedbunny commented on Oct 19, 2017

    @friedbunny
    Contributor

    @o15a3d4l11s2 Allow me to humbly suggest GitHub’s emoji “reactions”, which are a positive and unobtrusive way to express interest without cluttering an issue or notifying all of its participants.

  20. Belzik commented on Feb 9, 2018

    @Belzik

    Hi, can you please tell me how can I cluster the points with different pictures (icons)? (ios)

  21. stale commented on Oct 28, 2018

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  22. added
    archived
    on Oct 28, 2018
  23. removed
    archived
    on Oct 29, 2018
  24. mourner commented on Oct 29, 2018

    @mourner
    Member

    Keeping this open since it's a highly requested feature and we still intend to address this at some point.

  25. magnuspaaske commented on Dec 25, 2018

    @magnuspaaske

    Is there any news on this? It would be highly beneficial to be able to cluster annotations without resorting to geojson.

  26. aquabay commented on Jan 24, 2019

    @aquabay

    After 2.5 years since this issue was raised. Any progress/alternatives?

  27. vegidio commented on Jan 24, 2019

    @vegidio

    Wow, 2.5 years indeed. I've completely forgotten that this still existed.

    @aquabay Anyway, I moved away from Mapbox long ago and I found an easy way to do clustering using the good-old Google Maps:

    Good luck!

  28. aquabay commented on Jan 24, 2019

    @aquabay

    Wow, 2.5 years indeed. I've completely forgotten that this still existed.

    @aquabay Anyway, I moved away from Mapbox long ago and I found an easy way to do clustering using the good-old Google Maps:

    Good luck!

    That's fine if your app is making a bucket load of profit or has minimal traffic (no pun intended). Google Maps now have their hand well and truly in your pocket. I'm not sure their pricing schedule has anything to do with luck ;)

    https://cloud.google.com/maps-platform/pricing/sheet

  29. locked and limited conversation to collaborators on Jan 24, 2019
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

    CoreGoogle Maps parityMapKit parityannotationsclustering

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions