[Pkg-javascript-commits] [leaflet-markercluster] 169/479: Add options.disableClusteringAtZoom. Only implemented for initial clustering currently
Jonas Smedegaard
dr at jones.dk
Thu Oct 16 16:00:26 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 0b6b7ed560a376741969d4929e6095cacac69434
Author: danzel <danzel at localhost.geek.nz>
Date: Mon Aug 20 10:00:31 2012 +1200
Add options.disableClusteringAtZoom. Only implemented for initial clustering currently
---
README.md | 4 ++++
src/MarkerClusterGroup.js | 8 +++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 8c17cc9..474f049 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,10 @@ var markers = new L.MarkerClusterGroup({ options: {
```
Check out the [custom example](http://danzel.github.com/Leaflet.markercluster/example/marker-clustering-custom.html) for an example of this.
+### Other Options
+disableClusteringAtZoom: If set, at this zoom level and below markers will not be clustered. This defaults to disabled
+
+
### Events
If you register for click, mouseover, etc events just related to Markers in the cluster.
To recieve events for clusters listen to 'cluster' + 'eventIWant', ex: 'clusterclick', 'clustermouseover'.
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 7a1db92..50687c8 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -11,7 +11,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
spiderfyOnMaxZoom: true,
showCoverageOnHover: true,
- zoomToBoundsOnClick: true
+ zoomToBoundsOnClick: true,
+
+ disableClusteringAtZoom: null
},
initialize: function (options) {
@@ -221,6 +223,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
maxZoom = this._map.getMaxZoom(),
currentZoom = this._map.getZoom();
+ if (this.options.disableClusteringAtZoom) {
+ maxZoom = this.options.disableClusteringAtZoom - 1;
+ }
+
//console.time('cluster');
this._topClusterLevel = this._clusterToMarkerCluster(this._needsClustering, maxZoom);
this._needsClustering = [];
--
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