Add a layer switcher inside or outside the map.
-
The title or name layer's property is used to named the ol.layer in the switcher.
-
It shows use of the displayInLayerSwitcher layer's property to cause it to not display in the LayerSwitcher
-
The baseLayer layer's property manage exclusive visibility on layers (only one base layer is shown at a time).
-
The allwaysOnTop layer's property make a layer to stay on top of others.
-
Layers in an ol.layer.Group are grouped together and can be managed all together (visibility/opacity/ordering).
-
The openInLayerSwitcher property of an ol.layer.Group is used to code the visibility of the sublayers.
-
The show_progress option display a progress bar on tiled layers (only once per map).
-
You can use the setHeader() function to add a header to the layer list.
-
You can use the drawlist event handle the current line display (add button, change list style, etc.)
-
It trigger a toogle event when shown/hidden
You can customize the LayerSwitcher using CSS