From f367103d0f77a9cfdd379fec3ef32657bd169b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20Schl=C3=BCter?= Date: Tue, 10 Feb 2015 22:45:10 +0100 Subject: [PATCH] Close popups when spiderifying marker groups --- static/js/visualization.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/js/visualization.js b/static/js/visualization.js index a2a0814..c3cf38d 100644 --- a/static/js/visualization.js +++ b/static/js/visualization.js @@ -37,12 +37,17 @@ class Visualization { closeButton: true, maxHeight: 250 }) + this.oms.addListener('click', function (marker) { popup.setContent(template(marker.incident)) popup.setLatLng(marker.getLatLng()) map.openPopup(popup) }) + this.oms.addListener('spiderfy', function () { + map.closePopup() + }) + // set up markers this._markers = new Map() this.setupMarkers()