'click':function(node){
//checkbox怎么获取到
if(node.attributes["tagName"]=="slayer"){
showDir(node);
if (activeTheme == null){
activeTheme = node.parentNode;
}
if(activeTheme != node.parentNode){
for(var ii=0; ii<activeTheme.childNodes.length; ii++){
var chld = activeTheme.childNodes[ii];
chld.attributes.checked = false;
chld.ui.toggleCheck(false);
visibleLayers.deleted(chld.attributes["layerid"]);
}
//clearEye(activeTheme);
//记录当前活动类别
activeTheme = node.parentNode;
visibleLayers.add(node.attributes["layerid"]);
}
//显示矢量图层
init(visibleLayers);
return;
}
}
选中checkbox的时候,把值传到 init(visibleLayers)方法,显示地图.
wmsLayer=new OpenLayers.Layer.WMS("wmsLayer","http://192.16.1.76/service/GovEMap/wms",
{
LAYERS:visibleLayers,//获取checkbox传过来的值
version:'1.0.0',
request:'GetMap',
ServiceName:'FZ_VECTMAP_WMS',
bbox:'424765,2882137,434662,2889527',
format:'image/png',
srs:'EPSG:NONE',
TRANSPARENT:'false',
service:'WMS'
},
{
maxExtent:bounds,