Skip to content

Expose all Leaflet.markerCluster() options to datasette-cluster-map config#54

Open
etjones wants to merge 1 commit into
simonw:mainfrom
etjones:configurable_cluster_options
Open

Expose all Leaflet.markerCluster() options to datasette-cluster-map config#54
etjones wants to merge 1 commit into
simonw:mainfrom
etjones:configurable_cluster_options

Conversation

@etjones

@etjones etjones commented May 29, 2025

Copy link
Copy Markdown

Added support for a cluster_map_options configuration, which allow full customization of the Leaflet markerClusterGroup().

Default datasette-cluster-map settings don't allow user control over how different points get clustered ("maxClusterRadius"), combined ("spiderfying"), or whether they get clustered at a given depth ("disableClusteringAtZoom") as well as several other options.

This PR adds an optional dictionary, cluster_map_options to the plugin config:

{
    "plugins": { 
        "datasette-cluster-map": { 
            "cluster_map_options": {
                "spiderfyOnMaxZoom": false,
                "disableClusteringAtZoom": 17
            }
        }
    }
}
         

For complete docs on available settings, see:
https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options

… full customization of the Leaflet `markerClusterGroup()`.

This allows finer control of clustering behavior and when close markers will be combined ("spiderfying")

See: https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options
@etjones etjones changed the title Expose all [Leaflet.markerCluster()](https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options) options to datasette-cluster-map config Expose all Leaflet.markerCluster() options to datasette-cluster-map config May 29, 2025
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