Make events for clusters start with cluster, clusterclick etc.

This commit is contained in:
danzel
2012-07-24 13:26:47 +12:00
parent a8dc5f315b
commit 602a5ae1d2
5 changed files with 34 additions and 37 deletions
+4 -8
View File
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<title>Leaflet debug page</title>
@@ -52,13 +52,9 @@
southWest.lng + lngSpan * Math.random());
}
markers.on('click', function (a) {
if (a.layer instanceof L.MarkerCluster) {
console.log('cluster ' + a.layer.getAllChildMarkers().length);
a.layer.spiderfy();
} else {
console.log('marker ' + a.layer);
}
markers.on('clusterclick', function (a) {
console.log('cluster ' + a.layer.getAllChildMarkers().length);
a.layer.spiderfy();
});
populate();