How can I Open Multiple Popups in Leaflet Marker at a time

Jameesh Moidunny picture Jameesh Moidunny · Aug 15, 2016 · Viewed 9.7k times · Source

Map` like this:

L.Map = L.Map.extend({
openPopup: function(popup) {
this._popup = popup;
        return this.addLayer(popup).fire('popupopen', {
            popup: this._popup
        });
    }
});

But I am using leaflet. Is there anyway to extent like so that i can prevent closing my marker popup?

L.mapbox.accessToken = constant.accessToken;
var map = L.mapbox.map('map', 'mapbox.streets', {zoomControl: true});

Answer

Bambam picture Bambam · Dec 8, 2017

Update Dec 2017 Leaflet popup options have been extended to include { autoClose: false } which has the required effect :

 var my_marker = L.marker([my_lat, my_lng], {icon: my_icon})
                  .addTo(map)
                  .bindPopup('My Popup HTML', {closeOnClick: false, autoClose: false});