不用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;
}
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;
}
相关文章推荐
- arcmap以及arcgis server中mapcontrol里图层加载顺序与空间参考之间的关系
- mapcontrol加载注记图层
- AE学习日记之MapControl与PageLayoutControl图层变化同步
- arcengine中按照图层名查询axMapControl和axPageLayoutControl中图层
- 将图层坐标系转化为当前MapControl中的现有图层坐标系
- Here's a C# example thats adds the circle as a graphic element on the mapcontrol.
- ArcEngine选择要素闪烁,Mapcontrol刷新并取消闪烁
- 使用OpenStreetMap下载kml格式矢量图层数据
- 使用反射机制 来把一个具体的bean 处理成一个map。并且获得其中的field和值
- 制作使用百度map获得经纬度的gem
- (73)Map公共方法演示、Map集合获得键值对的两种方法:entrySet和keySet。Map中元素唯一性练习
- Axcontrols与controls的区别、axmapcontrol与maptcontrol的区别
- ArcGIS Engine MapControl和GlobeControl同步
- WPF版 BingMap Control(Beta)紹介
- 【原】getInputStream()与getParameterMap()获得Post请求的数据区别
- 显示当前Map的所有图层名称(VBA)
- Google Maps API 2.0解析(17-GSmallMapControl和GSmallZoomControl两个简单的控件)
- 不用任何位操作,获得一个int变量的第九位
- ASP.NET 2.0 Virtual Earth Map Control
- 【转】ArcGIS客户端API中另一种图层类型的探讨:DynamicTileMapServiceLayer