Popups should emit an event when they are closed.
This is complete!
Hi @mapsam . How can I listen to it?
map.on('popup.close', function(e) {
alert();
});
doesn't work
@nibygro try listen to it this way:
let popup = new mapboxgl.Popup()
popup.on('close', function(e) {
alert()
})
@Luqqk it works, thanx!
Thanks @Luqqk!
It is working but pupup close event fire twice when open and close.
I am seeing the same as @ansarikhurshid786; the popup close event fires for a new popup when it is created, if I removed an existing popup before creating the new popup
I am also seeing popup.on('close', ...) fire on creation, and then twice on close.
@nibygro try listen to it this way:
let popup = new mapboxgl.Popup() popup.on('close', function(e) { alert() })
not working for me
Same thing, this event fires in wrong time ((((
Most helpful comment
@nibygro try listen to it this way: