mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #9 from mourner/patch-1
Syntax coloring for readme examples :)
This commit is contained in:
@@ -7,11 +7,12 @@ Provides Marker Clustering functionality for Leaflet
|
||||
See the included example for usage.
|
||||
|
||||
Create a new MarkerClusterGroup, add your markers to it, then add it to the map
|
||||
````
|
||||
|
||||
```javascript
|
||||
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
|
||||
|
||||
@@ -19,10 +20,10 @@ For a more complete example see example/marker-clustering.html
|
||||
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.
|
||||
|
||||
````
|
||||
```javascript
|
||||
var markers = new L.MarkerClusterGroup({ options: {
|
||||
iconCreateFunction: function(childCount) {
|
||||
return new L.DivIcon({ html: '<b>' + childCount + '</b>' });
|
||||
}
|
||||
}});
|
||||
````
|
||||
```
|
||||
Reference in New Issue
Block a user