Documentation says this:
autoClose:
Set it to false if you want to override the default behavior of the popup closing when another popup is opened.
so i'm expecting to click on another marker and the first popup not closing, but it closes.
I figured it out.
The first popup is not closing because the second one opens, it is closing because the map is being clicked.
To fix, you need to set additional option to false:
{
autoClose:false,
closeOnClick:false
}
https://jsfiddle.net/6d5c26u3/9/
I'm clicking on both markers and the popups are closing.
I don't know what
closing when another popup is opened.
has to do with clicking on map.
https://jsfiddle.net/6d5c26u3/11/
It's BECAUSE you're clicking on the map when you click the marker.
So there's no way to have that behaviour when clicking on marker, but when you really click on the map close all markers (default behaviour) ?
Edit: how's that if by default bubblingMouseEvents
When true, a mouse event on this marker will trigger the same event on the map (unless L.DomEvent.stopPropagation is used).
is false ?!?
Can you re-open the issue? Or at least tell me how i can have that behavior on markers ( popup don't close when clicking on another marker ) and still close them when clicking on map.
@rogeriocsilva you can set the map's closePopupOnClick: false. https://jsfiddle.net/85a3frb3/
Most helpful comment
I figured it out.
The first popup is not closing because the second one opens, it is closing because the map is being clicked.
To fix, you need to set additional option to false: