[Pkg-javascript-commits] [leaflet-markercluster] 241/479: Build update and JSHint fixes.

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:35 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 c0871d7cb7558b319fff1a0cfabda5d8d9b74199
Author: danzel <danzel at localhost.geek.nz>
Date:   Fri Sep 14 10:43:17 2012 +1200

    Build update and JSHint fixes.
---
 dist/leaflet.markercluster-src.js | 11 +++++++++++
 dist/leaflet.markercluster.js     |  2 +-
 src/MarkerClusterGroup.js         |  2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dist/leaflet.markercluster-src.js b/dist/leaflet.markercluster-src.js
index fe2c1f5..534d175 100644
--- a/dist/leaflet.markercluster-src.js
+++ b/dist/leaflet.markercluster-src.js
@@ -115,6 +115,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 		if (layer._icon) {
 			L.FeatureGroup.prototype.removeLayer.call(this, layer);
+			layer.setOpacity(1);
 		}
 		return this;
 	},
@@ -653,6 +654,16 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 		//When the animations are done, tidy up
 		setTimeout(function () {
 
+			//This cluster stopped being a cluster before the timeout fired
+			if (cluster._childCount === 1) {
+				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());
+				m.setOpacity(1);
+
+				return;
+			}
+
 			cluster._recursively(bounds, newZoomLevel, 0, function (c) {
 				c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel + 1);
 			});
diff --git a/dist/leaflet.markercluster.js b/dist/leaflet.markercluster.js
index 215a041..dce9252 100644
--- a/dist/leaflet.markercluster.js
+++ b/dist/leaflet.markercluster.js
@@ -3,4 +3,4 @@
  Leaflet.markercluster is an open-source JavaScript library for Marker Clustering on leaflet powered maps.
  https://github.com/danzel/Leaflet.markercluster
 */
-(function(e,t){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,skipDuplicateAddTesting:!1,animateAddingMarkers:!1},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),L.FeatureGroup.prototype.initialize.call(this,[]),this._inZoomAn [...]
\ No newline at end of file
+(function(e,t){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,skipDuplicateAddTesting:!1,animateAddingMarkers:!1},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),L.FeatureGroup.prototype.initialize.call(this,[]),this._inZoomAn [...]
\ No newline at end of file
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 26aecea..1715665 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -648,7 +648,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 		setTimeout(function () {
 
 			//This cluster stopped being a cluster before the timeout fired
-			if (cluster._childCount == 1) {
+			if (cluster._childCount === 1) {
 				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());

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