Merge pull request #9 from mourner/patch-1

Syntax coloring for readme examples :)
This commit is contained in:
Dave Leaver
2012-07-11 14:17:38 -07:00
+5 -4
View File
@@ -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>' });
}
}});
````
```