Close popups when spiderifying marker groups

This commit is contained in:
Arne Schlüter 2015-02-10 22:45:10 +01:00
commit f367103d0f

View file

@ -37,12 +37,17 @@ class Visualization {
closeButton: true, closeButton: true,
maxHeight: 250 maxHeight: 250
}) })
this.oms.addListener('click', function (marker) { this.oms.addListener('click', function (marker) {
popup.setContent(template(marker.incident)) popup.setContent(template(marker.incident))
popup.setLatLng(marker.getLatLng()) popup.setLatLng(marker.getLatLng())
map.openPopup(popup) map.openPopup(popup)
}) })
this.oms.addListener('spiderfy', function () {
map.closePopup()
})
// set up markers // set up markers
this._markers = new Map() this._markers = new Map()
this.setupMarkers() this.setupMarkers()