0

How to determine which triggered the popup close? Is it mouse click or auto close or zoom event, etc.

(The quest is simple so no need to provide codes and stuff.)

1
  • 2
    Simple or complicated, coding question on GIS SE site should include relevant existing code, otherwise it's most likely to be closed as not compliant with the site policy. Please edit your question and add relevant existing code.
    – TomazicM
    Aug 11 at 7:49

1 Answer 1

1

I don't think this is possible with what leaflet supports out of the box. You can only listen on the popupclose event. Unfortunately the data from the event doesn't give you a hint why it was closed. A hack could be to listen on the other events at the same time (like zooming, clicking etc.) and try to determine why the popup was closed.

Not the answer you're looking for? Browse other questions tagged or ask your own question.