问题
I want to add popup on cluster group made using Leaflet.markercluster just like the popups that come on hovering over the leaflet markers.
回答1:
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();
});
来源:https://stackoverflow.com/questions/32067832/popup-on-hovering-over-cluster-group