Allow styling group layers in the layer list

This commit is contained in:
Matt Walker 2014-10-15 18:35:16 +01:00
parent a345ad5bc8
commit 0be8bae6f2
2 changed files with 10 additions and 1 deletions

View File

@ -37,3 +37,11 @@
padding-left: 1em;
list-style: none;
}
.layer-switcher li.group {
padding-top: 5px;
}
.layer-switcher li.group > label {
font-weight: bold;
}

View File

@ -87,6 +87,7 @@ ol.control.LayerSwitcher.prototype.renderLayer = function(lyr, idx) {
if (lyr.getLayers) {
li.className = 'group';
var label = document.createElement('label');
label.innerHTML = lyr.get('title');
li.appendChild(label);
@ -104,7 +105,7 @@ ol.control.LayerSwitcher.prototype.renderLayer = function(lyr, idx) {
} else {
var input = document.createElement('input');
if (lyr.get('type') == 'base') {
if (lyr.get('type') === 'base') {
input.type = 'radio';
input.name = 'base';
} else {