mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
383d961cf7df2914addd1ed2d3069d86ec701d1f
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>' });
}
}});
Description
Languages
PHP
37.2%
JavaScript
33.6%
HTML
24.5%
CSS
3%
Less
0.7%
Other
0.8%