mirror of
https://github.com/walkermatt/ol-layerswitcher.git
synced 2026-02-01 15:56:51 +00:00
Allow styling group layers in the layer list
This commit is contained in:
parent
a345ad5bc8
commit
0be8bae6f2
@ -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;
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user