Open kai-trone opened 6 months ago
Hi @kai-trone . Thanks for opening an issue. Unfortunately I don't currently have a lot of time to dedicate to this project as I'm busy with work and life commitments.
As you probably know you can use supercluster's radius
and minPoints
to tweak when markers are formed in to clusters but I'm conscious that this is not a full solution. If you have big variations in point density then it might not be possible to find a sweet spot with these values.
I can't see myself having time to work on this for the foreseeable future but I would be more than happy to consider a PR!
The problem: Trying to adjust the cluster radius
The goal: The clustering logic should not remove any markers
Hey! I've ben working with flutter maplibre_gl and supercluster to create a map with markers and clusters. The map is working fine, so are the clusters. The challenge is to fill the map with more markers, because in a highly populated area I have to zoom in really far to see all markers.
Here is a comparison, this is the map and cluster with almost no parameters
https://github.com/rorystephenson/supercluster_dart/assets/142009975/1e18ef6a-49b9-44ed-9dbe-dbc60093c9cc
And here I try to dynamically calculate a radius and extend according to the zoom level (more zoom = lower radius and thus less clustering). As you can see some markers will appear or disappear out of nowhere without any changes in the clusters. I've tried changing only radius or only extent as well. Also tried playing with the other parameters.
https://github.com/rorystephenson/supercluster_dart/assets/142009975/2d696aa8-4107-4cce-9837-47655ad9782d
Replicating might be difficult, since the class has gotten quite big. Here is at least some code for reference Here Is the cluster logic:
And I call this by using
After this computing is done the clusters are also transformed to markers and then added to the map.
If you need more information please let me know.