From 47691c80ac954c43bdeb6f05d9938c6aabdbf4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20Schl=C3=BCter?= Date: Tue, 10 Feb 2015 17:48:08 +0100 Subject: [PATCH] Close popup when filtereing incidents --- static/js/visualization.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/static/js/visualization.js b/static/js/visualization.js index b57dcda..a2a0814 100644 --- a/static/js/visualization.js +++ b/static/js/visualization.js @@ -36,11 +36,8 @@ class Visualization { autoPanPadding: [96, 96], closeButton: true, maxHeight: 250 - }); + }) this.oms.addListener('click', function (marker) { - if (map.getZoom() < 10) - map.setZoom(9) - popup.setContent(template(marker.incident)) popup.setLatLng(marker.getLatLng()) map.openPopup(popup) @@ -80,6 +77,7 @@ class Visualization { $(e.target).parent().toggleClass('active') var incidents = this.filterAll() + this.map.closePopup() this.displayMarkers(incidents) e.preventDefault() @@ -131,6 +129,7 @@ class Visualization { $target.parent().addClass('active') var incidents = this.filterAll() + this.map.closePopup() this.displayMarkers(incidents) e.preventDefault()