/// <summary>
/// 设置图层组的显隐
/// </summary>
/// <param name="pLayer"></param>
/// <param name="visible"></param>
public static void GroupLayerVisible(ILayer pLayer, bool visible)
{
ICompositeLayer pCompositeLayer = pLayer as ICompositeLayer;
for (int i = 0; i < pCompositeLayer.Count; i++)
{
ILayer pSubLayer = pCompositeLayer.Layer[i]; //递归
if (pSubLayer is GroupLayer || pSubLayer is ICompositeLayer)
{
GroupLayerVisible(pSubLayer, visible);
} else{
pSubLayer.Visible = visible;
}
}
pLayer.Visible = visible;
}