I have a marker that has a popup associated with it. The behaviour I wanted was that on clicking the marker, you could toggle the visibility of the associated popup.
So, using the "click" event, I tried using the "togglePopup" method so that if the popup was not visible, it would be made visible, and if it was visible, it would be made invisible.
However, I can see from debug I've added, that when I click on the marker, both the popupopen and popupclose events are getting fired as soon as I make a single click on the marker, the net result is my popup is never shown.
If I use other means of showing/hiding the popup, e.g. mouseover makes it visible, mouseout hides it, it works perfectly, but toggle does not seem to work as I expected.
Is there something obvious I am missing?
Thanks!