I have created a custom icon for clustering my data, using leaflet markercluster. As default markercluster have the "childcount" in the icon. How can i put that number in my divicon?
var markers = L.markerClusterGroup({
iconCreateFunction: function(cluster) {
return L.divIcon({className: 'mydivicon', html: 'childcount'});
}
});
of course it just puts the text "childicon" in the circle. The child icon is a 'var' in the leaflet.markercluster-src.js
var childCount = cluster.getChildCount();
How can i write it in my L.divicon?