diff --git a/types/leaflet.markercluster.layersupport/index.d.ts b/types/leaflet.markercluster.layersupport/index.d.ts index aec703c67f..023142e752 100644 --- a/types/leaflet.markercluster.layersupport/index.d.ts +++ b/types/leaflet.markercluster.layersupport/index.d.ts @@ -24,10 +24,18 @@ declare global { namespace L { checkOut(layers: Layer | Layer[]): this; } } + + interface MarkerClusterGroupLayerSupportOptions extends MarkerClusterGroupOptions { + /** + * Buffer single addLayer and removeLayer requests for efficiency. + */ + singleAddRemoveBufferDuration: number; + } + namespace markerClusterGroup { /** * Create a layer support marker cluster group, optionally given marker cluster group options. */ - function layerSupport(options?: MarkerClusterGroupOptions): MarkerClusterGroup.LayerSupport; + function layerSupport(options?: MarkerClusterGroupLayerSupportOptions): MarkerClusterGroup.LayerSupport; } } } diff --git a/types/leaflet.markercluster.layersupport/leaflet.markercluster.layersupport-tests.ts b/types/leaflet.markercluster.layersupport/leaflet.markercluster.layersupport-tests.ts index 1c9682bd77..7b7faf3222 100644 --- a/types/leaflet.markercluster.layersupport/leaflet.markercluster.layersupport-tests.ts +++ b/types/leaflet.markercluster.layersupport/leaflet.markercluster.layersupport-tests.ts @@ -3,7 +3,7 @@ import L = require("leaflet.markercluster.layersupport"); const polylineOptions: L.PolylineOptions = {}; const icon: L.Icon = L.icon({ iconUrl: 'foo' }); -let markerClusterGroupOptions: L.MarkerClusterGroupOptions = {}; +let markerClusterGroupOptions: L.MarkerClusterGroupLayerSupportOptions; markerClusterGroupOptions = { showCoverageOnHover: true, zoomToBoundsOnClick: false, @@ -25,7 +25,8 @@ markerClusterGroupOptions = { return icon; }, chunkedLoading: false, - chunkDelay: 100 + chunkDelay: 100, + singleAddRemoveBufferDuration: 200, }; markerClusterGroupOptions.iconCreateFunction = (cluster: L.MarkerCluster) => {