diff --git a/public_html/script.js b/public_html/script.js index 2977d7a..e954e46 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -366,7 +366,14 @@ function initialize_map() { }) if (!foundType) { - layers[0].setVisible(true); + ol.control.LayerSwitcher.forEachRecursive(layers, function(lyr) { + if (foundType) + return; + if (lyr.get('type') === 'base') { + lyr.setVisible(true); + foundType = true; + } + }); } var iconsLayer = new ol.layer.Vector({