I was wondering what the correct way of switching layer visibility was.
Currently for switching hillshading on/off I use
function showHillShade(show) {
if (show) {
map.layers = [hillShade, backgroundLayer, dataLayer]
} else {
map.layers = [backgroundLayer, dataLayer]
}
map.redraw()
}
I was wondering what the correct way of switching layer visibility was.
Currently for switching hillshading on/off I use
see testcase 153
https://wahlatlas.net/experimente/testcases/gridviz3_issue_153_mapLayersVisible.html
but I was wondering if
map.layers[0].visible=truecould be used for this as well