mousebird-consulting-inc / WhirlyGlobe

WhirlyGlobe Development
Other
831 stars 255 forks source link

Marker cluster size depending on how much Makers/Labels it contains #1537

Open nhevaweb opened 2 years ago

nhevaweb commented 2 years ago

I'd like to subclass MaplyClusterGenerator and allow each cluster displayed on screen to have a size depending on much objects it gathers. Each cluster's size would depend on the number of objects it covers versus the minimum number the smaller contains and the maximum number the bigger contains.

How would you do that ?

In the subclass func: func makeClusterGroup(_ clusterInfo: MaplyClusterInfo) -> MaplyClusterGroup We can use clusterInfo.numObjects to get how much objects this MaplyClusterGroup covers But how can I compare this numObjects to all the others clusters (already displayed and to be) ?