dianlixunjian
徐景良 2024-08-10 17:46:16 +08:00
parent 0b22db2f73
commit 309dc4f561
1 changed files with 13 additions and 9 deletions

View File

@ -432,15 +432,19 @@
"uiType": "ImgTxtBtn",
layers:baseLayers
};
//
switchLayerControler = new SwitchLayerControl({
name:"图层管理" ,
position:"top-left",
showToTop:true,
layerGroups:configlayers
});
if(props?.mapConfig?.baseLayers?.length>0 || props?.mapConfig?.layers?.length>0){
map.addControl(switchLayerControler,"top-left");
if(props?.mapConfig){
if(props?.mapConfig?.baseLayers?.length > 0 && props?.mapConfig?.layers?.length > 0){
//
switchLayerControler = new SwitchLayerControl({
name:"图层管理" ,
position:"top-left",
showToTop:true,
layerGroups:configlayers
});
map.addControl(switchLayerControler,"top-left");
}
}
handlerLayerChange()