[@types/leaflet.markercluster] add missing chunkInterval option (#34030)

* leaflet.markercluster: add missing chunkInterval option

* leaflet.markercluster: bump version number to 1.4
This commit is contained in:
Alejandro Sánchez
2019-03-25 10:43:12 -06:00
committed by timolinn
parent ea79c6c204
commit 6f7df5ecb9
2 changed files with 9 additions and 2 deletions

View File

@@ -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 <https://github.com/rimig>
// 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 {

View File

@@ -26,7 +26,8 @@ markerClusterGroupOptions = {
return icon;
},
chunkedLoading: false,
chunkDelay: 100
chunkDelay: 100,
chunkInterval: 200,
};
markerClusterGroupOptions.iconCreateFunction = (cluster: L.MarkerCluster) => {