[Pkg-javascript-commits] [leaflet-markercluster] 105/479: By default don't show marker cluster outlines while in a zoom animation, in firefox you could end up with random outlines showing during a zoom which looked dumb

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:15 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 9615f5622cdd91d4f8425cc413ee0e145a46b030
Author: danzel <danzel at localhost.geek.nz>
Date:   Wed Jul 25 11:20:31 2012 +1200

    By default don't show marker cluster outlines while in a zoom animation, in firefox you could end up with random outlines showing during a zoom which looked dumb
---
 src/MarkerCluster.Default.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/MarkerCluster.Default.js b/src/MarkerCluster.Default.js
index 15e64de..903bc11 100644
--- a/src/MarkerCluster.Default.js
+++ b/src/MarkerCluster.Default.js
@@ -17,6 +17,11 @@
 
 		bindEvents: function (map, markerClusterGroup) {
 			var me = this;
+			var inZoomAnimation = false;
+
+			map.on('zoomstart', function () { inZoomAnimation = true; });
+			map.on('zoomend', function () { inZoomAnimation = false; });
+
 
 			//Zoom on cluster click or spiderfy if we are at the lowest level
 			markerClusterGroup.on('clusterclick', function (a) {
@@ -29,6 +34,9 @@
 
 			//Show convex hull (boundary) polygon on mouse over
 			markerClusterGroup.on('clustermouseover', function (a) {
+				if (inZoomAnimation) {
+					return;
+				}
 				if (me._shownPolygon) {
 					map.removeLayer(me._shownPolygon);
 				}

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