Fix initial baselayer selection if no type was stored.

This commit is contained in:
Oliver Jowett 2016-07-03 14:54:14 +01:00
parent 2bbc117528
commit abab5f5440

View file

@ -366,7 +366,14 @@ function initialize_map() {
}) })
if (!foundType) { 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({ var iconsLayer = new ol.layer.Vector({