一般的GIS开发者都知道arcengine开发中如何遍历MapControl中的图层,代码如下:
for (int i = 0; i < axMapControl1.Map.LayerCount; i++)
{
String layerName = axMapControl1.Map.get_Layer(i).Name;
ComboBox.Items.Add(layerName);
}那么如何遍历PageLaoutControl中的图层呢?稍微有一点区别: for (int i = 0; i < axPageLayoutControl1.ActiveView.FocusMap.LayerCount; i++)
{
String layerName = axPageLayoutControl1.ActiveView.FocusMap.get_Layer(i).Name;
ComboBox.Items.Add(layerName);
}区别在于制图控件PageLaoutControl的图层是存在于焦点地图FocusMap对象中的,这里的图层并不是真正的数据,只是在视图ActiveView上面的显示而已。
可以想一想在ArcMap制图过程中也是将图层加载到PageLaoutControl中显示,然后进行符号化等。
本文介绍了在ArcEngine开发中如何遍历PageLaoutControl中的图层,并对比了其与MapControl中图层遍历的区别。PageLaoutControl中的图层存在于FocusMap对象中,仅用于视图显示。
3440

被折叠的 条评论
为什么被折叠?



