一般的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中显示,然后进行符号化等。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有