Skip to content

Expose minClusterSize in ClusterSettings - #173

Open
davidthurman wants to merge 1 commit into
software-mansion:mainfrom
davidthurman:expose-min-cluster-size
Open

davidthurman wants to merge 1 commit into
software-mansion:mainfrom
davidthurman:expose-min-cluster-size

Conversation

@davidthurman

@davidthurman davidthurman commented Aug 6, 2026 •

Copy link
Copy Markdown

Small PR to expose minClusterSize.

Currently the map defaults to a cluster minimum of 4, but offers no way to change that.

For example of the pain point, I have a map here with 2 pins in Denver and 2 pins in Atlanta. Right now the pins are clickable, but you cant select specific ones from either location. With this kind of use case, you'd want to set your clustering to a minimum of 2 so that the user can zone in on a specific city anytime theres at least 2 pins:
Screenshot 2026-08-05 at 10 47 08 PM

Android's DefaultClusterRenderer only draws a cluster once a group reaches
its own minimum of 4, so groups of two or three render as separate markers.
MapKit on iOS and the web clusterer both group from two, which leaves the
same data looking different depending on the platform.

Adds ClusterSettings.minClusterSize, applied on Android through the
onClusterManager hook that maps-compose already provides. Defaults to
Android's existing value, so behaviour is unchanged unless it is set.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@davidthurman
davidthurman marked this pull request as ready for review August 6, 2026 04:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant