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

Clustering with custom point annotation and annotation view #12035

Closed
Lavmint opened this issue May 30, 2018 · 3 comments
Closed

Clustering with custom point annotation and annotation view #12035

Lavmint opened this issue May 30, 2018 · 3 comments
Labels
annotations Annotations on iOS and macOS or markers on Android clustering

Comments

@Lavmint
Copy link

Lavmint commented May 30, 2018

Platform: iOS
Mapbox SDK version: 4.0.1

Steps to trigger behavior

  1. Looking at this example and make some research of replacing geoJSON url with my own annotations.
  2. Making StopAnnotation: MGLPointFeature and StopAnnotationView: MGLAnnotationView
  3. Creating source MGLShapeSource with features of type StopAnnotation via initialiser
  4. Creating pins, cluster and numbers layers

Expected behavior

Clustering is working fine. Pins that are not in cluster shown as StopAnnotationView

Actual behavior

Clustering is working fine. Pins that are not in cluster not shown.

Comment

Did I miss smth or this is just not possible? Any suggestions?
For now I ended up with:

  • hiding annotations at zoomLevel > 16
  • displaying cluster source and pins source as circles with different diameters at zoomLevel <=16
    This is workaround that causes many troubles in memory usage.
    I have several hacks in mind to improve memory usage but they are just hacks.
@jmkiley
Copy link
Contributor

jmkiley commented May 30, 2018

Hi @Lavmint -

Thank you for using Mapbox! Clustering for point annotations is being tracked in #5814. For guidance on clustering circle style layers, please see this example.

@jmkiley jmkiley closed this as completed May 30, 2018
@jmkiley jmkiley added annotations Annotations on iOS and macOS or markers on Android clustering labels May 30, 2018
@Lavmint
Copy link
Author

Lavmint commented May 30, 2018

@jmkiley, but I've already mentioned this example in Steps.

@jmkiley
Copy link
Contributor

jmkiley commented May 30, 2018

It looks like you are trying to use annotation views rather than style layers, the latter of which are used in the example. Clustering for view-backed annotations is being tracked in #5815. For more information about the different ways to display points on a map, please check out our adding markers to a map guide.

If you have any further questions about how to cluster point data with our SDK, please reach out to our support team. We'd be happy to help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android clustering
Projects
None yet
Development

No branches or pull requests

2 participants