From e4fc9b5e61750ecbef81951a2afe3c33f979835f Mon Sep 17 00:00:00 2001 From: AsamK Date: Wed, 16 Aug 2017 11:09:49 +0200 Subject: [PATCH] Add missing options to MarkerCluster.LayerSupport --- types/leaflet.markercluster.layersupport/index.d.ts | 10 +++++++++- .../leaflet.markercluster.layersupport-tests.ts | 5 +++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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) => {