My leaflet map has two WMS layers with different scales; one of them is a 4cm topographic map. I would like to have both WMS on the map but showing only the topographic map when the zoom of the map is sufficient to read something. Currently I use the minZoom / maxZoom attributes in order to switch when zoom 8 is reached:
var topo4cm =L.tileLayer.wms(topoaddress, {
service: "WMS", transparent: !1, minZoom: 8, maxZoom: 18
});
var carto=L.tileLayer(cartoaddress, {
minZoom: 0, maxZoom: 7, zoom:function() {
var e=map.getZoom();
return 10>e?"L0"+e: "L"+e
}
});
This does what I want: when zoom = 8, the topo map is shown. However the other layer (carto) cannot be manually switched in the panel control. Would there be a way to allow the user to manually switch back to carto?