diff --git a/types/leaflet.markercluster/index.d.ts b/types/leaflet.markercluster/index.d.ts index 4bcf268da6..60247bfdc6 100644 --- a/types/leaflet.markercluster/index.d.ts +++ b/types/leaflet.markercluster/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Leaflet.markercluster 1.0 +// Type definitions for Leaflet.markercluster 1.4 // Project: https://github.com/Leaflet/Leaflet.markercluster // Definitions by: Robert Imig // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -115,6 +115,12 @@ declare module 'leaflet' { * Time delay (in ms) between consecutive periods of processing for addLayers. Default to 50ms. */ chunkDelay?: number; + + /* + * Time interval (in ms) during which addLayers works before pausing to let the rest of the page process. + * In particular, this prevents the page from freezing while adding a lot of markers. Defaults to 200ms. + */ + chunkInterval?: number; } class MarkerClusterGroup extends FeatureGroup { diff --git a/types/leaflet.markercluster/leaflet.markercluster-tests.ts b/types/leaflet.markercluster/leaflet.markercluster-tests.ts index cc54bb1163..acd546e506 100644 --- a/types/leaflet.markercluster/leaflet.markercluster-tests.ts +++ b/types/leaflet.markercluster/leaflet.markercluster-tests.ts @@ -26,7 +26,8 @@ markerClusterGroupOptions = { return icon; }, chunkedLoading: false, - chunkDelay: 100 + chunkDelay: 100, + chunkInterval: 200, }; markerClusterGroupOptions.iconCreateFunction = (cluster: L.MarkerCluster) => {