[Pkg-javascript-commits] [leaflet-markercluster] 115/479: Update readme for .default changes. Fixes #14
Jonas Smedegaard
dr at jones.dk
Thu Oct 16 16:00:17 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet-markercluster.
commit 505bc20187a1f750de043c3cefb9ba34a18b4e26
Author: danzel <danzel at localhost.geek.nz>
Date: Thu Jul 26 11:22:10 2012 +1200
Update readme for .default changes. Fixes #14
---
README.md | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 2aa91a2..074d8a8 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ Provides Beautiful Animated Marker Clustering functionality for Leaflet
## Using the plugin
See the included examples for usage.
-The [realworld example](http://danzel.github.com/Leaflet.markercluster/example/marker-clustering-realworld.388.html) is a good place to start, it utilises the MarkerCluster.Default class to provide all of the default functionality.
+The [realworld example](http://danzel.github.com/Leaflet.markercluster/example/marker-clustering-realworld.388.html) is a good place to start, it uses all of the defaults of the clusterer.
Or check out the [custom example](http://danzel.github.com/Leaflet.markercluster/example/marker-clustering-custom.html) for how to customise the behaviour and appearance of the clusterer
### Usage
@@ -19,20 +19,20 @@ map.addLayer(markers);
```
### Defaults
-As a safe default you can use the included MarkerCluster.Default.(css/js) to provide default behaviour and appearance of the clusters.
+By default the Clusterer enables some nice defaults for you:
+zoomToBoundsOnClick: When you mouse over a cluster it shows the bounds of its markers.
+showCoverageOnHover: When you click a cluster we zoom to its bounds.
+spiderfyOnMaxZoom: When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers.
-Include the .Default files (or use the prebuilt version) and create a MarkerClusterGroup as follows:
+You can disable any of these as you want in the options when you create the MarkerClusterGroup:
```javascript
-var markers = new L.MarkerClusterGroup();
-L.MarkerClusterDefault.bindEvents(map, markers);
-... Add markers to the MarkerClusterGroup ...
-map.addLayer(markers);
+var markers = new L.MarkerClusterGroup({ spiderfyOnMaxZoom: false, showCoverageOnHover: false, zoomToBoundsOnClick: false });
```
### Customising the Clustered Markers
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.
-You do not need to include the .Default files if you go this way.
+You do not need to include the .Default css if you go this way.
```javascript
var markers = new L.MarkerClusterGroup({ options: {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet-markercluster.git
More information about the Pkg-javascript-commits
mailing list