mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-17 00:14:54 +02:00
4df7bdc9c2f6b67386403b4a3b42dbc3d6f70004
Leaflet.markercluster
Provides Marker Clustering functionality for Leaflet
##Using the plugin See the included example for usage.
Create a new MarkerClusterGroup, add your markers to it, then add it to the map
var markers = new L.MarkerClusterGroup();
markers.addLayer(new L.Marker(getRandomLatLng(map)));
map.addLayer(markers);
For a more complete example see example/marker-clustering.html
###Customising the Clustered Marker As an option to MarkerClusterGroup you can provide your own function for creating the Icon for the clustered markers. The default implementation changes color at bounds of 10 and 100, but more advanced uses may require customising this.
var markers = new L.MarkerClusterGroup({ options: {
iconCreateFunction: function(childCount) {
return new L.DivIcon({ html: '<b>' + childCount + '</b>' });
}
}});
Languages
PHP
37.2%
JavaScript
33.6%
HTML
24.5%
CSS
3%
Less
0.7%
Other
0.8%