Add missing options to MarkerCluster.LayerSupport

This commit is contained in:
AsamK
2017-08-16 11:09:49 +02:00
parent 5002dcc843
commit e4fc9b5e61
2 changed files with 12 additions and 3 deletions

View File

@@ -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;
}
} }

View File

@@ -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) => {