ol-layerswitcher
Version:
Layer switcher control for OpenLayers v3/v4
20 lines (12 loc) • 738 B
Markdown
Make exclusive layers more generic
Currently layers shown in the LayerSwitcher are either overlay or base layers. Overlays are represented as checkboxes and can be shown and hidden independently while base layers (those with `type: 'base'`) belong to a single exclusive radio button group which enforces the rule that only one base layer can be visible at a time.
I'm proposing a change to allow other non-base layers to be exclusive and removing the `type: 'base'` property in favour of this more generic approach.
new ol.layer.Tile({
title: 'Water color',
group: 'group-name'
visible: false,
source: new ol.source.Stamen({
layer: 'watercolor'
})
}),