[GIS] How to customize the background-image of LayerSwitcher in OpenLayers

openlayers-2

How can I override the image used (sign '+' with a blue half circle) for the LayerSwitcher Control in OpenLayers?
Is it possible to do so with background-image in css? I see nothing related to this image in the default style.css…

Best Answer

The LayerSwitcher control does not have an image. It is a Div with a particular background color. You can override it using CSS.

I can use the following CSS to make it red

.layersDiv {
    background-color: red !important;
}

The plus icon that you see when the control is minimized, is an image. You can replace it, if required.

The normal icon is at ../img/layer-switcher-maximize.png You will need to replace it, if you want to style it.