您的位置:首页 > 其它

不用mapcontrol获得一个mxd的图层

2009-12-25 09:40 267 查看
//不用mapcontrol获得一个mxd的图层
private static int getLayercount(string mxdFileName)
{
IMapDocument pMapDocument = new MapDocumentClass();
pMapDocument.Open(mxdFileName, "");
INetworkDataset networkDataset = null;
int num = 0;
//iterate all the maps
for (int cMap = 0; cMap < pMapDocument.MapCount; cMap++)
{
for (int cLayer = 0; cLayer < pMapDocument.get_Map(cMap).LayerCount; cLayer++)
{
ILayer pLayer = pMapDocument.get_Map(cMap).get_Layer(cLayer);
MessageBox.Show(pLayer.Name);
num++;
}
}
return num;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: