I want to add popup on cluster group made using Leaflet.markercluster just like the popups that come on hovering over the leaflet markers.
I was able to find the answer with the help of issues present in the github page of leaflet.markercluster
cluster.on('clustermouseover', function(c) {
var popup = L.popup()
.setLatLng(c.layer.getLatLng())
.setContent(c.layer._childCount +' Locations(click to Zoom)')
.openOn(map);
}).on('clustermouseout',function(c){
map.closePopup();
}).on('clusterclick',function(c){
map.closePopup();
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With