From ecf63fd493a1b15ac7708f7fb569ce34cd0210f1 Mon Sep 17 00:00:00 2001 From: Veit Bjarsch Date: Wed, 27 Mar 2024 18:49:23 +0100 Subject: [PATCH 1/2] fix: added support for max cluster radius functions --- CHANGELOG.md | 3 +++ src/functions/markerClusterGroup.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e5bfd0..7622c57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed +- maxClusterRadius now accepts also functions as input value + ## 0.6.0 - 2024-02-13 ### Added - added [iconCreateFunction](https://github.com/Leaflet/Leaflet.markercluster/?tab=readme-ov-file#customising-the-clustered-markers) prop. diff --git a/src/functions/markerClusterGroup.ts b/src/functions/markerClusterGroup.ts index a731785..0ef3535 100644 --- a/src/functions/markerClusterGroup.ts +++ b/src/functions/markerClusterGroup.ts @@ -49,7 +49,7 @@ export const markerClusterGroupProps = { * current map zoom and returns the maximum cluster radius in pixels. **/ maxClusterRadius: { - type: Number, + type: [Number, Function], default: 80 }, /** From 419d6d77cefc8aa4754e9f2d3074a7f8226d5b4b Mon Sep 17 00:00:00 2001 From: Veit Bjarsch Date: Wed, 27 Mar 2024 19:07:47 +0100 Subject: [PATCH 2/2] fix: removed as const declaration --- src/functions/markerClusterGroup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/markerClusterGroup.ts b/src/functions/markerClusterGroup.ts index 0ef3535..afb1e6a 100644 --- a/src/functions/markerClusterGroup.ts +++ b/src/functions/markerClusterGroup.ts @@ -211,7 +211,7 @@ export const markerClusterGroupProps = { type: Function, default: null } -} as const +} export const setupMarkerClusterGroup = ( props: ExtractPropTypes,