mirror of
https://github.com/heyarne/berliner-winter.git
synced 2026-05-06 11:13:40 +02:00
Close popup when filtereing incidents
This commit is contained in:
parent
17c2176526
commit
47691c80ac
1 changed files with 3 additions and 4 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue