[Pkg-javascript-commits] [leaflet-markercluster] 16/219: Little bit of tidy up, refs #298
Jonas Smedegaard
dr at jones.dk
Sat May 7 09:39:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet-markercluster.
commit e78b61d1ca7e2f017738bffa41cbdba75c7c122f
Author: danzel <danzel at localhost.geek.nz>
Date: Mon Jan 20 10:37:57 2014 +1300
Little bit of tidy up, refs #298
---
src/MarkerClusterGroup.js | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index a1892d2..65a8f2c 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -694,17 +694,15 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
},
_generateInitialClusters: function () {
- var maxZoom = this._map.getMaxZoom(),
+ var maxZoom = this._map.getMaxZoom(),
radius = this.options.maxClusterRadius,
- radiusFunction = null;
+ radiusFn = radius;
//If we just set maxClusterRadius to a single number, we need to create
//a simple function to return that number. Otherwise, we just have to
//use the function we've passed in.
- if (typeof radius === "number") {
- radiusFunction = function () { return radius; };
- } else if (typeof radius === "function") {
- radiusFunction = radius;
+ if (typeof radius !== "function") {
+ radiusFn = function () { return radius; };
}
if (this.options.disableClusteringAtZoom) {
@@ -716,8 +714,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
//Set up DistanceGrids for each zoom
for (var zoom = maxZoom; zoom >= 0; zoom--) {
- this._gridClusters[zoom] = new L.DistanceGrid(radiusFunction(zoom));
- this._gridUnclustered[zoom] = new L.DistanceGrid(radiusFunction(zoom));
+ this._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));
+ this._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));
}
this._topClusterLevel = new L.MarkerCluster(this, -1);
--
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