2013-02-03 72 views

回答

3

http://jsfiddle.net/WUXXz/

var label = null; 

markers.on('clustermouseover', function (a) { 
    label = new L.Label().setLatLng(a.layer.getLatLng()) 
     .setContent('<p>Hello world!<br />This is a nice popup.</p>') 
     .openOn(map); 
}); 

markers.on('clustermouseout', function() { 
    if (label) { 
     label.close(); 
     label = null; 
    } 
});