[Pkg-javascript-commits] [leaflet-markercluster] 110/219: Modified method names, added new file to build script, build dist files, added license to package.josn, created test spec suite and added it to spec index.

Jonas Smedegaard dr at jones.dk
Sat May 7 09:39:21 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 3fb5565865a6a1f7a62d9a9fb14844d52883d9bd
Author: ghybs <ghybs1 at gmail.com>
Date:   Tue Oct 6 13:52:25 2015 +0400

    Modified method names, added new file to build script, build dist files, added license to package.josn, created test spec suite and added it to spec index.
---
 build/deps.js                     |   6 +
 dist/leaflet.markercluster-src.js | 136 ++++++---
 dist/leaflet.markercluster.js     |   2 +-
 package.json                      |  54 ++--
 spec/index.html                   |   2 +
 spec/suites/RefreshSpec.js        | 572 ++++++++++++++++++++++++++++++++++++++
 src/MarkerClusterGroup.Refresh.js |  32 ++-
 7 files changed, 737 insertions(+), 67 deletions(-)

diff --git a/build/deps.js b/build/deps.js
index 40b8b20..a0e65a2 100644
--- a/build/deps.js
+++ b/build/deps.js
@@ -18,6 +18,12 @@ var deps = {
 		src: ['MarkerCluster.Spiderfier.js'],
 		desc: 'Provides the ability to show all of the child markers of a cluster.',
 		heading: 'Spiderfier'
+	},
+
+	Refresh: {
+		src: ['MarkerClusterGroup.Refresh.js'],
+		desc: 'Method to request refreshing of clusters icon to reflect changes in markers data.',
+		heading: 'Refresh'
 	}
 };
 
diff --git a/dist/leaflet.markercluster-src.js b/dist/leaflet.markercluster-src.js
index 4043316..865b739 100644
--- a/dist/leaflet.markercluster-src.js
+++ b/dist/leaflet.markercluster-src.js
@@ -31,6 +31,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 		//Increase to increase the distance away that spiderfied markers appear from the center
 		spiderfyDistanceMultiplier: 1,
 
+		// Make it possible to specify a polyline options on a spider leg
+		spiderLegPolylineOptions: { weight: 1.5, color: '#222' },
+
 		// When bulk adding layers, adds markers in chunks. Means addLayers may not add all the layers in the call, others will be loaded during setTimeouts
 		chunkedLoading: false,
 		chunkInterval: 200, // process markers for a maximum of ~ n milliseconds (then trigger the chunkProgress callback)
@@ -153,8 +156,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 		if (this._featureGroup.hasLayer(layer)) {
 			this._featureGroup.removeLayer(layer);
-			if (layer.setOpacity) {
-				layer.setOpacity(1);
+			if (layer.clusterShow) {
+				layer.clusterShow();
 			}
 		}
 
@@ -261,10 +264,21 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 				m = layersArray[i];
 				this._arraySplice(this._needsClustering, m);
 				npg.removeLayer(m);
+				if (this.hasLayer(m)) {
+					this._needsRemoving.push(m);
+				}
 			}
 			return this;
 		}
 
+		if (this._unspiderfy) {
+			this._unspiderfy();
+			for (i = 0, l = layersArray.length; i < l; i++) {
+				m = layersArray[i];
+				this._unspiderfyLayer(m);
+			}
+		}
+
 		for (i = 0, l = layersArray.length; i < l; i++) {
 			m = layersArray[i];
 
@@ -277,8 +291,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 			if (fg.hasLayer(m)) {
 				fg.removeLayer(m);
-				if (m.setOpacity) {
-					m.setOpacity(1);
+				if (m.clusterShow) {
+					m.clusterShow();
 				}
 			}
 		}
@@ -660,7 +674,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 	_zoomOrSpiderfy: function (e) {
 		var map = this._map;
-		if (map.getMaxZoom() === map.getZoom()) {
+		if (e.layer._bounds._northEast.equals(e.layer._bounds._southWest)) {
+			if (this.options.spiderfyOnMaxZoom) {
+				e.layer.spiderfy();
+			}
+		} else if (map.getMaxZoom() === map.getZoom()) {
 			if (this.options.spiderfyOnMaxZoom) {
 				e.layer.spiderfy();
 			}
@@ -964,7 +982,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 				c._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);
 			} else {
 				//Fade out old cluster
-				c.setOpacity(0);
+				c.clusterHide();
 				c._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds);
 			}
 
@@ -986,7 +1004,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 		//TODO Maybe? Update markers in _recursivelyBecomeVisible
 		fg.eachLayer(function (n) {
 			if (!(n instanceof L.MarkerCluster) && n._icon) {
-				n.setOpacity(1);
+				n.clusterShow();
 			}
 		});
 
@@ -1000,7 +1018,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 			//update the positions of the just added clusters/markers
 			this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
 				fg.removeLayer(c);
-				c.setOpacity(1);
+				c.clusterShow();
 			});
 
 			this._animationEnd();
@@ -1036,8 +1054,8 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 				var m = cluster._markers[0];
 				//If we were in a cluster animation at the time then the opacity and position of our child could be wrong now, so fix it
 				m.setLatLng(m.getLatLng());
-				if (m.setOpacity) {
-					m.setOpacity(1);
+				if (m.clusterShow) {
+					m.clusterShow();
 				}
 			} else {
 				cluster._recursively(bounds, newZoomLevel, 0, function (c) {
@@ -1060,11 +1078,11 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 				this._animationStart();
 
 				layer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng()));
-				layer.setOpacity(0);
+				layer.clusterHide();
 
 				this._enqueue(function () {
 					fg.removeLayer(layer);
-					layer.setOpacity(1);
+					layer.clusterShow();
 
 					me._animationEnd();
 				});
@@ -1264,7 +1282,7 @@ L.MarkerCluster = L.Marker.extend({
 					//Only do it if the icon is still on the map
 					if (m._icon) {
 						m._setPos(center);
-						m.setOpacity(0);
+						m.clusterHide();
 					}
 				}
 			},
@@ -1275,7 +1293,7 @@ L.MarkerCluster = L.Marker.extend({
 					cm = childClusters[j];
 					if (cm._icon) {
 						cm._setPos(center);
-						cm.setOpacity(0);
+						cm.clusterHide();
 					}
 				}
 			}
@@ -1290,10 +1308,10 @@ L.MarkerCluster = L.Marker.extend({
 				//TODO: depthToAnimateIn affects _isSingleParent, if there is a multizoom we may/may not be.
 				//As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate
 				if (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) {
-					c.setOpacity(1);
+					c.clusterShow();
 					c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds
 				} else {
-					c.setOpacity(0);
+					c.clusterHide();
 				}
 
 				c._addToMap();
@@ -1303,7 +1321,7 @@ L.MarkerCluster = L.Marker.extend({
 
 	_recursivelyBecomeVisible: function (bounds, zoomLevel) {
 		this._recursively(bounds, 0, zoomLevel, null, function (c) {
-			c.setOpacity(1);
+			c.clusterShow();
 		});
 	},
 
@@ -1326,8 +1344,8 @@ L.MarkerCluster = L.Marker.extend({
 						nm._backupLatlng = nm.getLatLng();
 
 						nm.setLatLng(startPos);
-						if (nm.setOpacity) {
-							nm.setOpacity(0);
+						if (nm.clusterHide) {
+							nm.clusterHide();
 						}
 					}
 
@@ -1379,8 +1397,8 @@ L.MarkerCluster = L.Marker.extend({
 					m = c._markers[i];
 					if (!exceptBounds || !exceptBounds.contains(m._latlng)) {
 						c._group._featureGroup.removeLayer(m);
-						if (m.setOpacity) {
-							m.setOpacity(1);
+						if (m.clusterShow) {
+							m.clusterShow();
 						}
 					}
 				}
@@ -1391,8 +1409,8 @@ L.MarkerCluster = L.Marker.extend({
 					m = c._childClusters[i];
 					if (!exceptBounds || !exceptBounds.contains(m._latlng)) {
 						c._group._featureGroup.removeLayer(m);
-						if (m.setOpacity) {
-							m.setOpacity(1);
+						if (m.clusterShow) {
+							m.clusterShow();
 						}
 					}
 				}
@@ -1409,7 +1427,7 @@ L.MarkerCluster = L.Marker.extend({
 	_recursively: function (boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel) {
 		var childClusters = this._childClusters,
 		    zoom = this._zoom,
-			i, c;
+		    i, c;
 
 		if (zoomLevelToStart > zoom) { //Still going down to required depth, just recurse to child clusters
 			for (i = childClusters.length - 1; i >= 0; i--) {
@@ -1465,6 +1483,34 @@ L.MarkerCluster = L.Marker.extend({
 
 
 
+/*
+* Extends L.Marker to include two extra methods: clusterHide and clusterShow.
+* 
+* They work as setOpacity(0) and setOpacity(1) respectively, but
+* they will remember the marker's opacity when hiding and showing it again.
+* 
+*/
+
+
+L.Marker.include({
+	
+	clusterHide: function () {
+		this.options.opacityWhenUnclustered = this.options.opacity || 1;
+		return this.setOpacity(0);
+	},
+	
+	clusterShow: function () {
+		var ret = this.setOpacity(this.options.opacity || this.options.opacityWhenUnclustered);
+		delete this.options.opacityWhenUnclustered;
+		return ret;
+	}
+	
+});
+
+
+
+
+
 L.DistanceGrid = function (cellSize) {
 	this._cellSize = cellSize;
 	this._sqCellSize = cellSize * cellSize;
@@ -1692,20 +1738,40 @@ Retrieved from: http://en.literateprograms.org/Quickhull_(Javascript)?oldid=1843
 		getConvexHull: function (latLngs) {
 			// find first baseline
 			var maxLat = false, minLat = false,
+				maxLng = false, minLng = false,
+				maxLatPt = null, minLatPt = null,
+				maxLngPt = null, minLngPt = null,
 				maxPt = null, minPt = null,
 				i;
 
 			for (i = latLngs.length - 1; i >= 0; i--) {
 				var pt = latLngs[i];
 				if (maxLat === false || pt.lat > maxLat) {
-					maxPt = pt;
+					maxLatPt = pt;
 					maxLat = pt.lat;
 				}
 				if (minLat === false || pt.lat < minLat) {
-					minPt = pt;
+					minLatPt = pt;
 					minLat = pt.lat;
 				}
+				if (maxLng === false || pt.lng > maxLng) {
+					maxLngPt = pt;
+					maxLng = pt.lng;
+				}
+				if (minLng === false || pt.lng < minLng) {
+					minLngPt = pt;
+					minLng = pt.lng;
+				}
 			}
+			
+			if (minLat !== maxLat) {
+				minPt = minLatPt;
+				maxPt = maxLatPt;
+			} else {
+				minPt = minLngPt;
+				maxPt = maxLngPt;
+			}
+
 			var ch = [].concat(this.buildConvexHull([minPt, maxPt], latLngs),
 								this.buildConvexHull([maxPt, minPt], latLngs));
 			return ch;
@@ -1867,8 +1933,8 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
 
 			fg.addLayer(m);
 
-
-			leg = new L.Polyline([this._latlng, newPos], { weight: 1.5, color: '#222' });
+			var legOptions = this._group.options.spiderLegPolylineOptions;
+			leg = new L.Polyline([this._latlng, newPos], legOptions);
 			map.addLayer(leg);
 			m._spiderLeg = leg;
 		}
@@ -1900,7 +1966,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
 			//If it is a marker, add it now and we'll animate it out
 			if (m.setOpacity) {
 				m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
-				m.setOpacity(0);
+				m.clusterHide();
 			
 				fg.addLayer(m);
 
@@ -1927,12 +1993,16 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
 			m.setLatLng(newPos);
 			
 			if (m.setOpacity) {
-				m.setOpacity(1);
+				m.clusterShow();
 			}
 
 
 			//Add Legs.
-			leg = new L.Polyline([me._latlng, newPos], { weight: 1.5, color: '#222', opacity: initialLegOpacity });
+			var legOptions = this._group.options.spiderLegPolylineOptions;
+			if (legOptions.opacity === undefined) {
+				legOptions.opacity = initialLegOpacity;
+			}
+			leg = new L.Polyline([me._latlng, newPos], legOptions);
 			map.addLayer(leg);
 			m._spiderLeg = leg;
 
@@ -2018,7 +2088,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
 			//Hack override the location to be our center
 			if (m.setOpacity) {
 				m._setPos(thisLayerPos);
-				m.setOpacity(0);
+				m.clusterHide();
 			} else {
 				fg.removeLayer(m);
 			}
@@ -2060,7 +2130,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
 
 
 				if (m.setOpacity) {
-					m.setOpacity(1);
+					m.clusterShow();
 					m.setZIndexOffset(0);
 				}
 
diff --git a/dist/leaflet.markercluster.js b/dist/leaflet.markercluster.js
index e753211..2214daf 100644
--- a/dist/leaflet.markercluster.js
+++ b/dist/leaflet.markercluster.js
@@ -3,4 +3,4 @@
  https://github.com/Leaflet/Leaflet.markercluster
  (c) 2012-2013, Dave Leaver, smartrak
 */
-!function(t,e){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(t){L.Util.setOptions(this,t),this.options.iconCreateFunction||(this.optio [...]
\ No newline at end of file
+!function(t,e,i){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222"},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(t){L.Util.setOptions [...]
\ No newline at end of file
diff --git a/package.json b/package.json
index da096ca..4ceb50e 100644
--- a/package.json
+++ b/package.json
@@ -1,22 +1,36 @@
 {
-	"name": "leaflet.markercluster",
-	"repository": "https://github.com/Leaflet/Leaflet.markercluster",
-	"version": "0.4.0",
-	"description": "Provides Beautiful Animated Marker Clustering functionality for Leaflet",
-	"dependencies": {
-		"leaflet": "~0.7.1"
-	},
-	"devDependencies": {
-		"jshint": "~2.1.3",
-		"mocha": "~1.10.0",
-		"karma": "~0.8.5",
-		"uglify-js": "~2.3.6",
-		"jake": "~0.5.16"
-	},
-	"main": "dist/leaflet.markercluster.js",
-	"scripts": {
-		"test": "jake test",
-		"prepublish": "jake"
-	},
-	"keywords": ["gis", "map"]
+  "name": "leaflet.markercluster",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/Leaflet/Leaflet.markercluster"
+  },
+  "version": "0.4.0",
+  "description": "Provides Beautiful Animated Marker Clustering functionality for Leaflet",
+  "dependencies": {
+    "leaflet": "~0.7.1"
+  },
+  "devDependencies": {
+    "jshint": "~2.1.3",
+    "mocha": "~1.10.0",
+    "karma": "~0.8.5",
+    "uglify-js": "~2.3.6",
+    "jake": "~0.5.16"
+  },
+  "main": "dist/leaflet.markercluster.js",
+  "scripts": {
+    "test": "jake test",
+    "prepublish": "jake"
+  },
+  "keywords": [
+    "gis",
+    "map"
+  ],
+  "bugs": {
+    "url": "https://github.com/Leaflet/Leaflet.markercluster/issues"
+  },
+  "directories": {
+    "example": "example"
+  },
+  "author": "Dave Leaver <danzel at localhost.geek.nz>",
+  "license": "MIT"
 }
diff --git a/spec/index.html b/spec/index.html
index ad1549c..4784243 100644
--- a/spec/index.html
+++ b/spec/index.html
@@ -59,6 +59,8 @@
 
 	<script type="text/javascript" src="suites/RememberOpacity.js"></script>
 
+	<script type="text/javascript" src="suites/RefreshSpec.js"></script>
+
 	<script>
 		(window.mochaPhantomJS || window.mocha).run();
 	</script>
diff --git a/spec/suites/RefreshSpec.js b/spec/suites/RefreshSpec.js
new file mode 100644
index 0000000..2475ba8
--- /dev/null
+++ b/spec/suites/RefreshSpec.js
@@ -0,0 +1,572 @@
+describe('refreshClusters', function () {
+	var map, div;
+
+	function getClusterAtZoom(marker, zoom) {
+		var parent = marker.__parent;
+
+		while (parent && parent._zoom !== zoom) {
+			parent = parent.__parent;
+		}
+
+		return parent;
+	}
+
+	function expectClusterIconNeedsUpdate(marker, zoom, needsUpdate) {
+		var cluster = getClusterAtZoom(marker, zoom);
+
+		expect(cluster._iconNeedsUpdate).to.be(needsUpdate);
+	}
+
+
+	beforeEach(function () {
+		clock = sinon.useFakeTimers();
+
+		div = document.createElement('div');
+		div.style.width = '200px';
+		div.style.height = '200px';
+		document.body.appendChild(div);
+
+		map = L.map(div, { maxZoom: 18 });
+
+		// Corresponds to zoom level 8 for the above div dimensions.
+		map.fitBounds(new L.LatLngBounds([
+			[1, 1],
+			[2, 2]
+		]));
+	});
+	afterEach(function () {
+		clock.restore();
+
+		document.body.removeChild(div);
+	});
+
+	it('flags all non-visible parent clusters of a given marker', function () {
+
+		var group = new L.MarkerClusterGroup();
+		var marker1 = new L.Marker([1.5, 1.5]);
+		var marker2 = new L.Marker([1.5, 1.5]);
+
+		group.addLayers([marker1, marker2]);
+		map.addLayer(group);
+
+		var marker1cluster10 = getClusterAtZoom(marker1, 10),
+		    marker1cluster2 = getClusterAtZoom(marker1, 2),
+		    marker1cluster5 = getClusterAtZoom(marker1, 5);
+
+		// First go to some zoom levels so that Leaflet initializes clusters icons.
+		expect(marker1cluster10._iconNeedsUpdate).to.be.ok();
+		map.setZoom(10);
+		expect(marker1cluster10._iconNeedsUpdate).to.not.be.ok();
+
+		expect(marker1cluster2._iconNeedsUpdate).to.be.ok();
+		map.setZoom(2);
+		expect(marker1cluster2._iconNeedsUpdate).to.not.be.ok();
+
+		// Finish on an intermediate zoom level.
+		expect(marker1cluster5._iconNeedsUpdate).to.be.ok();
+		map.setZoom(5);
+		expect(marker1cluster5._iconNeedsUpdate).to.not.be.ok();
+
+		// Run any animation.
+		clock.tick(1000);
+
+		// Then request clusters refresh.
+		// No need to actually modify the marker.
+		group.refreshClusters(marker1);
+
+		// Now check that non-visible clusters are flagged as "dirty".
+		expect(marker1cluster10._iconNeedsUpdate).to.be.ok();
+		expect(marker1cluster2._iconNeedsUpdate).to.be.ok();
+
+		// Also check that visible clusters are "un-flagged" since they should be re-drawn.
+		expect(marker1cluster5._iconNeedsUpdate).to.not.be.ok();
+
+	});
+
+	it('re-draws visible clusters', function () {
+
+		var group = new L.MarkerClusterGroup({
+			iconCreateFunction: function (cluster) {
+				var markers = cluster.getAllChildMarkers();
+
+				for(var i in markers) {
+					if (markers[i].changed) {
+						return new L.DivIcon({
+							className: "changed"
+						});
+					}
+				}
+				return new L.DivIcon({
+					className: "original"
+				});
+			}
+		});
+		var marker1 = new L.Marker([1.5, 1.5]);
+		var marker2 = new L.Marker([1.5, 1.5]);
+
+		group.addLayers([marker1, marker2]);
+		map.addLayer(group);
+
+		var marker1cluster9 = getClusterAtZoom(marker1, 9);
+
+		// First go to some zoom levels so that Leaflet initializes clusters icons.
+		expect(marker1cluster9._iconNeedsUpdate).to.be.ok();
+		map.setZoom(9);
+		expect(marker1cluster9._iconNeedsUpdate).to.not.be.ok();
+
+		expect(marker1cluster9._icon.className).to.contain("original");
+		expect(marker1cluster9._icon.className).to.not.contain("changed");
+
+		// Run any animation.
+		clock.tick(1000);
+
+		// Alter the marker.
+		marker1.changed = true;
+
+		// Then request clusters refresh.
+		group.refreshClusters(marker1);
+
+		// Now check that visible clusters icon is re-drawn.
+		expect(marker1cluster9._icon.className).to.contain("changed");
+		expect(marker1cluster9._icon.className).to.not.contain("original");
+
+	});
+
+	it('does not flag clusters of other markers', function () {
+
+		var group = new L.MarkerClusterGroup({
+			maxClusterRadius: 2 // Make sure we keep distinct clusters.
+		});
+		var marker1 = new L.Marker([1.5, 1.5]);
+		var marker2 = new L.Marker([1.5, 1.5]);
+		var marker3 = new L.Marker([1.1, 1.1]);
+		var marker4 = new L.Marker([1.1, 1.1]);
+		var marker5 = new L.Marker([1.9, 1.9]);
+		var marker6 = new L.Marker([1.9, 1.9]);
+
+		group.addLayers([marker1, marker2, marker3, marker4, marker5, marker6]);
+		map.addLayer(group);
+
+		var marker1cluster8 = getClusterAtZoom(marker1, 8),
+		    marker1cluster3 = getClusterAtZoom(marker1, 3),
+		    marker1cluster5 = getClusterAtZoom(marker1, 5),
+		    marker3cluster8 = getClusterAtZoom(marker3, 8),
+		    marker3cluster3 = getClusterAtZoom(marker3, 3),
+		    marker3cluster5 = getClusterAtZoom(marker3, 5),
+		    marker5cluster8 = getClusterAtZoom(marker5, 8),
+		    marker5cluster3 = getClusterAtZoom(marker5, 3),
+		    marker5cluster5 = getClusterAtZoom(marker5, 5);
+
+		// Make sure we have 3 distinct clusters up to zoom level Z (let's choose Z = 3)
+		expect(marker1cluster3._childCount).to.equal(2);
+		expect(marker3cluster3._childCount).to.equal(2);
+		expect(marker5cluster3._childCount).to.equal(2);
+
+		// First go to some zoom levels so that Leaflet initializes clusters icons.
+		expect(marker1cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster8._iconNeedsUpdate).to.not.be.ok();
+
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.be.ok();
+		map.setZoom(3);
+		expect(marker1cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.not.be.ok();
+
+		// Finish on an intermediate zoom level.
+		expect(marker1cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.be.ok();
+		map.setZoom(5);
+		expect(marker1cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.not.be.ok();
+
+		// Run any animation.
+		clock.tick(1000);
+
+		// Then request clusters refresh.
+		// No need to actually modify the marker.
+		group.refreshClusters(marker1);
+
+		// Now check that non-visible clusters are flagged as "dirty".
+		expect(marker1cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+
+		// Finally check that non-involved clusters are not "dirty".
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+
+		expect(marker5cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.not.be.ok();
+	});
+
+	it('processes itself when no argument is passed', function () {
+
+		var group = new L.MarkerClusterGroup({
+			maxClusterRadius: 2 // Make sure we keep distinct clusters.
+		});
+		var marker1 = new L.Marker([1.5, 1.5]);
+		var marker2 = new L.Marker([1.5, 1.5]);
+		var marker3 = new L.Marker([1.1, 1.1]);
+		var marker4 = new L.Marker([1.1, 1.1]);
+		var marker5 = new L.Marker([1.9, 1.9]);
+		var marker6 = new L.Marker([1.9, 1.9]);
+
+		group.addLayers([marker1, marker2, marker3, marker4, marker5, marker6]);
+		map.addLayer(group);
+
+		var marker1cluster8 = getClusterAtZoom(marker1, 8),
+		    marker1cluster3 = getClusterAtZoom(marker1, 3),
+		    marker1cluster5 = getClusterAtZoom(marker1, 5),
+		    marker3cluster8 = getClusterAtZoom(marker3, 8),
+		    marker3cluster3 = getClusterAtZoom(marker3, 3),
+		    marker3cluster5 = getClusterAtZoom(marker3, 5),
+		    marker5cluster8 = getClusterAtZoom(marker5, 8),
+		    marker5cluster3 = getClusterAtZoom(marker5, 3),
+		    marker5cluster5 = getClusterAtZoom(marker5, 5);
+
+		// Make sure we have 3 distinct clusters up to zoom level Z (let's choose Z = 3)
+		expect(marker1cluster3._childCount).to.equal(2);
+		expect(marker3cluster3._childCount).to.equal(2);
+		expect(marker5cluster3._childCount).to.equal(2);
+
+		// First go to some zoom levels so that Leaflet initializes clusters icons.
+		expect(marker1cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster8._iconNeedsUpdate).to.not.be.ok();
+
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.be.ok();
+		map.setZoom(3);
+		expect(marker1cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.not.be.ok();
+
+		// Finish on an intermediate zoom level.
+		expect(marker1cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.be.ok();
+		map.setZoom(5);
+		expect(marker1cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.not.be.ok();
+
+		// Run any animation.
+		clock.tick(1000);
+
+		// Then request clusters refresh.
+		// No need to actually modify the marker.
+		group.refreshClusters();
+
+		// Now check that non-visible clusters are flagged as "dirty".
+		expect(marker1cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+
+		expect(marker3cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.be.ok();
+
+		expect(marker5cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.be.ok();
+
+	});
+
+	it('accepts an array of markers', function () {
+
+		var group = new L.MarkerClusterGroup({
+			maxClusterRadius: 2 // Make sure we keep distinct clusters.
+		});
+		var marker1 = new L.Marker([1.5, 1.5]);
+		var marker2 = new L.Marker([1.5, 1.5]);
+		var marker3 = new L.Marker([1.1, 1.1]);
+		var marker4 = new L.Marker([1.1, 1.1]);
+		var marker5 = new L.Marker([1.9, 1.9]);
+		var marker6 = new L.Marker([1.9, 1.9]);
+
+		group.addLayers([marker1, marker2, marker3, marker4, marker5, marker6]);
+		map.addLayer(group);
+
+		var marker1cluster8 = getClusterAtZoom(marker1, 8),
+		    marker1cluster3 = getClusterAtZoom(marker1, 3),
+		    marker1cluster5 = getClusterAtZoom(marker1, 5),
+		    marker3cluster8 = getClusterAtZoom(marker3, 8),
+		    marker3cluster3 = getClusterAtZoom(marker3, 3),
+		    marker3cluster5 = getClusterAtZoom(marker3, 5),
+		    marker5cluster8 = getClusterAtZoom(marker5, 8),
+		    marker5cluster3 = getClusterAtZoom(marker5, 3),
+		    marker5cluster5 = getClusterAtZoom(marker5, 5);
+
+		// Make sure we have 3 distinct clusters up to zoom level Z (let's choose Z = 3)
+		expect(marker1cluster3._childCount).to.equal(2);
+		expect(marker3cluster3._childCount).to.equal(2);
+		expect(marker5cluster3._childCount).to.equal(2);
+
+		// First go to some zoom levels so that Leaflet initializes clusters icons.
+		expect(marker1cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster8._iconNeedsUpdate).to.not.be.ok();
+
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.be.ok();
+		map.setZoom(3);
+		expect(marker1cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.not.be.ok();
+
+		// Finish on an intermediate zoom level.
+		expect(marker1cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.be.ok();
+		map.setZoom(5);
+		expect(marker1cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.not.be.ok();
+
+		// Run any animation.
+		clock.tick(1000);
+
+		// Then request clusters refresh.
+		// No need to actually modify the markers.
+		group.refreshClusters([marker1, marker5]);
+		// Clusters of marker3 and 4 shall not be flagged.
+
+		// Now check that non-visible clusters are flagged as "dirty".
+		expect(marker1cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+
+		expect(marker5cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.be.ok();
+
+		// Clusters of marker3 and 4 shall not be flagged.
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+
+	});
+
+	it('accepts a mapping of markers', function () {
+
+		var group = new L.MarkerClusterGroup({
+			maxClusterRadius: 2 // Make sure we keep distinct clusters.
+		});
+		var marker1 = new L.Marker([1.5, 1.5]);
+		var marker2 = new L.Marker([1.5, 1.5]);
+		var marker3 = new L.Marker([1.1, 1.1]);
+		var marker4 = new L.Marker([1.1, 1.1]);
+		var marker5 = new L.Marker([1.9, 1.9]);
+		var marker6 = new L.Marker([1.9, 1.9]);
+
+		group.addLayers([marker1, marker2, marker3, marker4, marker5, marker6]);
+		map.addLayer(group);
+
+		var marker1cluster8 = getClusterAtZoom(marker1, 8),
+		    marker1cluster3 = getClusterAtZoom(marker1, 3),
+		    marker1cluster5 = getClusterAtZoom(marker1, 5),
+		    marker3cluster8 = getClusterAtZoom(marker3, 8),
+		    marker3cluster3 = getClusterAtZoom(marker3, 3),
+		    marker3cluster5 = getClusterAtZoom(marker3, 5),
+		    marker5cluster8 = getClusterAtZoom(marker5, 8),
+		    marker5cluster3 = getClusterAtZoom(marker5, 3),
+		    marker5cluster5 = getClusterAtZoom(marker5, 5);
+
+		// Make sure we have 3 distinct clusters up to zoom level Z (let's choose Z = 3)
+		expect(marker1cluster3._childCount).to.equal(2);
+		expect(marker3cluster3._childCount).to.equal(2);
+		expect(marker5cluster3._childCount).to.equal(2);
+
+		// First go to some zoom levels so that Leaflet initializes clusters icons.
+		expect(marker1cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster8._iconNeedsUpdate).to.not.be.ok();
+
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.be.ok();
+		map.setZoom(3);
+		expect(marker1cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.not.be.ok();
+
+		// Finish on an intermediate zoom level.
+		expect(marker1cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.be.ok();
+		map.setZoom(5);
+		expect(marker1cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.not.be.ok();
+
+		// Run any animation.
+		clock.tick(1000);
+
+		// Then request clusters refresh.
+		// No need to actually modify the markers.
+		group.refreshClusters({
+			id1: marker1,
+			id2: marker5
+		}); // Clusters of marker3 and 4 shall not be flagged.
+
+		// Now check that non-visible clusters are flagged as "dirty".
+		expect(marker1cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+
+		expect(marker5cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.be.ok();
+
+		// Clusters of marker3 and 4 shall not be flagged.
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+
+	});
+
+	it('accepts an L.LayerGroup', function () {
+
+		var group = new L.MarkerClusterGroup({
+			maxClusterRadius: 2 // Make sure we keep distinct clusters.
+		});
+		var marker1 = new L.Marker([1.5, 1.5]);
+		var marker2 = new L.Marker([1.5, 1.5]);
+		var marker3 = new L.Marker([1.1, 1.1]);
+		var marker4 = new L.Marker([1.1, 1.1]);
+		var marker5 = new L.Marker([1.9, 1.9]);
+		var marker6 = new L.Marker([1.9, 1.9]);
+
+		group.addLayers([marker1, marker2, marker3, marker4, marker5, marker6]);
+		map.addLayer(group);
+
+		var marker1cluster8 = getClusterAtZoom(marker1, 8),
+		    marker1cluster3 = getClusterAtZoom(marker1, 3),
+		    marker1cluster5 = getClusterAtZoom(marker1, 5),
+		    marker3cluster8 = getClusterAtZoom(marker3, 8),
+		    marker3cluster3 = getClusterAtZoom(marker3, 3),
+		    marker3cluster5 = getClusterAtZoom(marker3, 5),
+		    marker5cluster8 = getClusterAtZoom(marker5, 8),
+		    marker5cluster3 = getClusterAtZoom(marker5, 3),
+		    marker5cluster5 = getClusterAtZoom(marker5, 5);
+
+		// Make sure we have 3 distinct clusters up to zoom level Z (let's choose Z = 3)
+		expect(marker1cluster3._childCount).to.equal(2);
+		expect(marker3cluster3._childCount).to.equal(2);
+		expect(marker5cluster3._childCount).to.equal(2);
+
+		// First go to some zoom levels so that Leaflet initializes clusters icons.
+		expect(marker1cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster8._iconNeedsUpdate).to.not.be.ok();
+
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.be.ok();
+		map.setZoom(3);
+		expect(marker1cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.not.be.ok();
+
+		// Finish on an intermediate zoom level.
+		expect(marker1cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.be.ok();
+		map.setZoom(5);
+		expect(marker1cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.not.be.ok();
+
+		// Run any animation.
+		clock.tick(1000);
+
+		// Then request clusters refresh.
+		// No need to actually modify the markers.
+		var layerGroup = new L.LayerGroup([marker1, marker5]);
+		group.refreshClusters(layerGroup);
+		// Clusters of marker3 and 4 shall not be flagged.
+
+		// Now check that non-visible clusters are flagged as "dirty".
+		expect(marker1cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+
+		expect(marker5cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.be.ok();
+
+		// Clusters of marker3 and 4 shall not be flagged.
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+
+	});
+
+	it('accepts an L.MarkerCluster', function () {
+
+		var group = new L.MarkerClusterGroup({
+			maxClusterRadius: 2 // Make sure we keep distinct clusters.
+		});
+		var marker1 = new L.Marker([1.5, 1.5]);
+		var marker2 = new L.Marker([1.5, 1.5]);
+		var marker3 = new L.Marker([1.1, 1.1]);
+		var marker4 = new L.Marker([1.1, 1.1]);
+		var marker5 = new L.Marker([1.9, 1.9]);
+		var marker6 = new L.Marker([1.9, 1.9]);
+
+		group.addLayers([marker1, marker2, marker3, marker4, marker5, marker6]);
+		map.addLayer(group);
+
+		var marker1cluster8 = getClusterAtZoom(marker1, 8),
+		    marker1cluster3 = getClusterAtZoom(marker1, 3),
+		    marker1cluster5 = getClusterAtZoom(marker1, 5),
+		    marker3cluster8 = getClusterAtZoom(marker3, 8),
+		    marker3cluster3 = getClusterAtZoom(marker3, 3),
+		    marker3cluster5 = getClusterAtZoom(marker3, 5),
+		    marker5cluster8 = getClusterAtZoom(marker5, 8),
+		    marker5cluster3 = getClusterAtZoom(marker5, 3),
+		    marker5cluster5 = getClusterAtZoom(marker5, 5);
+
+		// Make sure we have 3 distinct clusters up to zoom level Z (let's choose Z = 3)
+		expect(marker1cluster3._childCount).to.equal(2);
+		expect(marker3cluster3._childCount).to.equal(2);
+		expect(marker5cluster3._childCount).to.equal(2);
+
+		// First go to some zoom levels so that Leaflet initializes clusters icons.
+		expect(marker1cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster8._iconNeedsUpdate).to.not.be.ok();
+
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.be.ok();
+		map.setZoom(3);
+		expect(marker1cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.not.be.ok();
+
+		// Finish on an intermediate zoom level.
+		expect(marker1cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.be.ok();
+		map.setZoom(5);
+		expect(marker1cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster5._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster5._iconNeedsUpdate).to.not.be.ok();
+
+		// Run any animation.
+		clock.tick(1000);
+
+		// Then request clusters refresh.
+		// No need to actually modify the markers.
+		group.refreshClusters(marker1cluster8);
+		// Clusters of marker3, 4, 5 and 6 shall not be flagged.
+
+		// Now check that non-visible clusters are flagged as "dirty".
+		expect(marker1cluster8._iconNeedsUpdate).to.be.ok();
+		expect(marker1cluster3._iconNeedsUpdate).to.be.ok();
+
+		// Clusters of marker3 and 4 shall not be flagged.
+		expect(marker3cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker3cluster3._iconNeedsUpdate).to.not.be.ok();
+
+		expect(marker5cluster8._iconNeedsUpdate).to.not.be.ok();
+		expect(marker5cluster3._iconNeedsUpdate).to.not.be.ok();
+
+	});
+
+});
\ No newline at end of file
diff --git a/src/MarkerClusterGroup.Refresh.js b/src/MarkerClusterGroup.Refresh.js
index 382affa..5eb81e1 100644
--- a/src/MarkerClusterGroup.Refresh.js
+++ b/src/MarkerClusterGroup.Refresh.js
@@ -11,11 +11,14 @@ L.MarkerClusterGroup.include({
 	/**
 	 * Updates all clusters (and their icon) which are parents of the given marker(s).
 	 * @param layers L.MarkerClusterGroup|L.LayerGroup|Array(L.Marker)|Map(L.Marker)|
-	 * L.MarkerCluster|L.Marker list of markers (or single marker) whose parent
-	 * clusters need to be updated.
+	 * L.MarkerCluster|L.Marker (optional) list of markers (or single marker) whose parent
+	 * clusters need to be updated. If not provided, retrieves all child markers of this.
+	 * @returns {L.MarkerClusterGroup}
 	 */
-	refreshClustersOf: function (layers) {
-		if (layers instanceof L.MarkerClusterGroup) {
+	refreshClusters: function (layers) {
+		if (!layers) {
+			layers = this._topClusterLevel.getAllChildMarkers();
+		} else if (layers instanceof L.MarkerClusterGroup) {
 			layers = layers._topClusterLevel.getAllChildMarkers();
 		} else if (layers instanceof L.LayerGroup) {
 			layers = layers._layers;
@@ -23,9 +26,11 @@ L.MarkerClusterGroup.include({
 			layers = layers.getAllChildMarkers();
 		} else if (layers instanceof L.Marker) {
 			layers = [layers];
-		}
+		} // else: must be an Array(L.Marker)|Map(L.Marker)
 		this._flagParentsIconsNeedUpdate(layers);
 		this._refreshClustersIcons();
+
+		return this;
 	},
 
 	/**
@@ -37,12 +42,12 @@ L.MarkerClusterGroup.include({
 		var parent;
 
 		// Assumes layers is an Array or an Object whose prototype is non-enumerable.
-		for (id in layers) {
+		for (var id in layers) {
 			// Flag parent clusters' icon as "dirty", all the way up.
-			// Dummy process that flags multiple times upper parents, but still
+			// Dumb process that flags multiple times upper parents, but still
 			// much more efficient than trying to be smart and make short lists,
 			// at least in the case of a hierarchy following a power law:
-			// http://jsperf.com/flag-nodes-in-power-hierarchy
+			// http://jsperf.com/flag-nodes-in-power-hierarchy/2
 			parent = layers[id].__parent;
 			while (parent) {
 				parent._iconNeedsUpdate = true;
@@ -69,10 +74,11 @@ L.Marker.include({
 	/**
 	 * Updates the given options in the marker's icon and refreshes the marker.
 	 * @param options map object of icon options.
-	 * @param directlyRefreshClusters boolean true to trigger MCG.refreshClustersOf()
-	 * right away with this single marker.
+	 * @param directlyRefreshClusters boolean (optional) true to trigger
+	 * MCG.refreshClustersOf() right away with this single marker.
+	 * @returns {L.Marker}
 	 */
-	refreshIconWithOptions: function (options, directlyRefreshClusters) {
+	refreshIconOptions: function (options, directlyRefreshClusters) {
 		var icon = this.options.icon;
 
 		L.setOptions(icon, options);
@@ -81,10 +87,10 @@ L.Marker.include({
 
 		// Shortcut to refresh the associated MCG clusters right away.
 		// To be used when refreshing a single marker.
-		// Otherwise, better use MCG.refreshClustersOf() once at the end with
+		// Otherwise, better use MCG.refreshClusters() once at the end with
 		// the list of modified markers.
 		if (directlyRefreshClusters && this.__parent) {
-			this.__parent._group.refreshClustersOf(this);
+			this.__parent._group.refreshClusters(this);
 		}
 
 		return this;

-- 
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