qgis2web / qgis2web

QGIS plugin to export your project to an OpenLayers or Leaflet webmap. No server-side software required.
https://plugins.qgis.org/plugins/qgis2web/
GNU General Public License v2.0
568 stars 147 forks source link

XYZ tiles exporting to overlaysTree not baseMaps #1077

Open dgplacenames opened 4 weeks ago

dgplacenames commented 4 weeks ago

Base layers are exporting to overlaysTree, resulting in checkboxes rather than radio buttons: qgis2web_screenshot

    var baseMaps = {};
    var overlaysTree = [
        {label: '<img src="legend/southron_2.png" /> south ron', layer: layer_southron_2},
        {label: "OS 1st ed", layer: layer_OS1sted_1},
        {label: "OpenStreetMap", layer: layer_OpenStreetMap_0},]
    var lay = L.control.layers.tree(null, overlaysTree,{

Workaround: Move base layers to baseMaps with var lay = L.control.layers.tree(baseMaps, overlaysTree,{ This results in some odd radio button behaviour.

andreaordonselli commented 4 weeks ago

Hi, thanks for using qgis2web and thanks for your advice. Checkboxes instead of radio buttons are desired. Even if you selected two, only one base map would be visible, the upper one. Furthermore, by deactivating them all it is possible to have a white background, useful in many cases.

dgplacenames commented 4 weeks ago

Thanks for the quick response. Worth noting that the WIKI still shows radio buttons which is one of the reasons I thought there might be a bug. image

dgplacenames commented 4 weeks ago

Radio buttons are desirable in some situations. Perhaps there could be an option to select them or checkboxes when exporting.

andreaordonselli commented 4 weeks ago

Thanks for the reports. I put the creation of the "radio button" choice for the xyz and wms levels on the development list. Greetings.