Merge pull request #19019 from AsamK/fix_layer_support

Add missing options to Leaflet.MarkerCluster.LayerSupport
This commit is contained in:
Daniel Rosenwasser
2017-08-18 14:08:55 -07:00
committed by GitHub
2 changed files with 12 additions and 3 deletions
+9 -1
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;
}
} }
@@ -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) => {