Use BaseIcon class in leaflet MarkerClusterGroupOptions

This commit is contained in:
Christopher Currens
2017-02-18 16:18:37 -08:00
parent 968eacf484
commit 33cfb60ab2
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ declare namespace L {
/*
* Function used to create the cluster icon
*/
iconCreateFunction?: ((cluster: L.MarkerCluster) => L.Icon);
iconCreateFunction?: ((cluster: L.MarkerCluster) => L.BaseIcon);
/*
* Boolean to split the addLayers processing in to small intervals so that the page does not freeze.
@@ -28,6 +28,10 @@ markerClusterGroupOptions = {
chunkDelay: 100
}
markerClusterGroupOptions.iconCreateFunction = (cluster: L.MarkerCluster) => {
return L.divIcon();
};
let markerClusterGroup: L.MarkerClusterGroup;
markerClusterGroup = L.markerClusterGroup();
markerClusterGroup = L.markerClusterGroup(markerClusterGroupOptions);