mirror of
https://github.com/heyarne/berliner-winter.git
synced 2026-05-06 19:23:39 +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],
|
autoPanPadding: [96, 96],
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
maxHeight: 250
|
maxHeight: 250
|
||||||
});
|
})
|
||||||
this.oms.addListener('click', function (marker) {
|
this.oms.addListener('click', function (marker) {
|
||||||
if (map.getZoom() < 10)
|
|
||||||
map.setZoom(9)
|
|
||||||
|
|
||||||
popup.setContent(template(marker.incident))
|
popup.setContent(template(marker.incident))
|
||||||
popup.setLatLng(marker.getLatLng())
|
popup.setLatLng(marker.getLatLng())
|
||||||
map.openPopup(popup)
|
map.openPopup(popup)
|
||||||
|
|
@ -80,6 +77,7 @@ class Visualization {
|
||||||
$(e.target).parent().toggleClass('active')
|
$(e.target).parent().toggleClass('active')
|
||||||
|
|
||||||
var incidents = this.filterAll()
|
var incidents = this.filterAll()
|
||||||
|
this.map.closePopup()
|
||||||
this.displayMarkers(incidents)
|
this.displayMarkers(incidents)
|
||||||
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
@ -131,6 +129,7 @@ class Visualization {
|
||||||
$target.parent().addClass('active')
|
$target.parent().addClass('active')
|
||||||
|
|
||||||
var incidents = this.filterAll()
|
var incidents = this.filterAll()
|
||||||
|
this.map.closePopup()
|
||||||
this.displayMarkers(incidents)
|
this.displayMarkers(incidents)
|
||||||
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue