[Pkg-javascript-commits] [leaflet-markercluster] 102/128: Fix an issue when opening a popup inside of zoomToShowLayer. If there was an existing spiderfied marker with a popup on it, the map would scroll back to the location of that marker.

Jonas Smedegaard dr at jones.dk
Sun Apr 16 06:26:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet-markercluster.

commit e65cb900c8a29c1e79e8ea562270411fa86de713
Author: danzel <dave at smartrak.co.nz>
Date:   Thu Jan 26 13:11:58 2017 +1300

    Fix an issue when opening a popup inside of zoomToShowLayer. If there was an existing spiderfied marker with a popup on it, the map would scroll back to the location of that marker.
---
 src/MarkerCluster.Spiderfier.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/MarkerCluster.Spiderfier.js b/src/MarkerCluster.Spiderfier.js
index f1012b7..39ccda1 100644
--- a/src/MarkerCluster.Spiderfier.js
+++ b/src/MarkerCluster.Spiderfier.js
@@ -301,6 +301,9 @@ L.MarkerCluster.include({
 				continue;
 			}
 
+			//Close any popup on the marker first, otherwise setting the location of the marker will make the map scroll
+			m.closePopup();
+
 			//Fix up the location to the real one
 			m.setLatLng(m._preSpiderfyLatlng);
 			delete m._preSpiderfyLatlng;

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