1

Has anyone been able to keep multiple popups open at the same time -- Leaflet output -- from the latest version of QGIS2Web?

I have a leaflet map generated from QGIS2Web that has several different point layers and keeping multiple popups would be highly beneficial.

In the pre-Leaflet 1.0 version of the QGIS2Web plugin I was able to keep multiple popups open by inserting this code in the HTML sheet:

L.Map = L.Map.extend({
openPopup: function(popup) {
            this._popup = popup;

    return this.addLayer(popup).fire('popupopen', {
        popup: this._popup
    });
}

});

I tried slotting this into the leaflet 1.0 version output and I can't say that it worked. I've been poking through the HTML file to try and find a solution but I'm coming up short (can't say I'm the greatest with HTML/JavaScript). Has anyone had success with this?

  • Have you seen the option autoClose in the Leaflet API docs for popups? That looks like it should do what you need. I'll try it out tomorrow and do a full answer here if it works. – Tom Chadwin May 24 '17 at 23:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.