Hey Dheeraj,

You can build a layer toggle function that checks and sets your layer
visibility- and call this function from an input onClick event handler.


var myLayer;
myLayer= new OpenLayers.Layer.WMS(...);

function toggle_myLayer()
{
if (myLayer.getVisibility() == true)
{
myLayer.setVisibility(false);
}
else
{
myLayer.setVisibility(true);
}
}


-----
Bryan R. McBride, GISP
http://www.bryanmcbride.com bryanmcbride.com 
http://geoserving.net/ geoserving.net 
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Checkboxes-to-turn-overlays-on-and-off-tp5610158p5611282.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to