you can do this with some programmatic way as registering map with zoomend
:
eventListeners
{Object} If set as an option at construction, the
eventListeners object will be registered with .
EVENT_TYPES
{Array(String)} Supported application event types. Register a
listener for a particular event with the following syntax:
map.events.register(type, obj, listener);
Listeners will be called with a reference to an event object. The
properties of this event depends on exactly what happened.
Solution Code:
var layer1 = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{layers: 'basic'}, {'displayInLayerSwitcher':false} );
var layer2 = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"}, {'isBaseLayer': false});
var layer3 = new OpenLayers.Layer.WMS( "DM Solutions Demo",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
"prov_bound,fedlimit,rail,road,popplace",
transparent: "true", format: "image/png" });
layer2.setVisibility(false);
layer3.setVisibility(false);
map.addLayers([layer1, layer2, layer3]);
map.events.register('zoomend', this, function (event) {
var zLevel = map.getZoom();
if( zLevel == 13 || zLevel == 14 || zLevel == 15 )
{
layer2.setVisibility(true);
}
if( zLevel == 16 || zLevel == 17 || zLevel == 18)
{
layer2.setVisibility(false);
layer3.setVisibility(true);
}
});
i hope it helps you...
In that example you'll see some code like:
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://demo.opengeo.org/geoserver/wms',
title: 'Identify features by clicking',
layers: [water],
queryVisible: true
}),
hover: new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://demo.opengeo.org/geoserver/wms',
title: 'Identify features by clicking',
layers: [water],
hover: true,
// defining a custom format options here
formatOptions: {
typeName: 'water_bodies',
featureNS: 'http://www.openplans.org/topp'
},
queryVisible: true
})
};
This sets up the getFeatureInfo request on the water layer - you need to modify your code to have just the layer names that you want to query in those spaces. That is don't include your raster layer in that array if you want to exclude it from the request.
Best Answer
check out openlayers dark theme here.
it has customization about layer switcher too..
UPDATE:
oh sorry due to not reading your que. completely i give only thematic solution...I noticed that newly.
new solution is that change the following style (top):
i hope it helps you...