AE框架中MapControl图层增加和图层删除事件
程序员文章站
2022-06-12 16:48:41
...
MapControl图层增加和图层删除事件
1.获取框架时,首先绑定MapControl的OnMapReplaced事件
((IMapControlEvents2_Event)MapControl).OnMapReplaced += new IMapControlEvents2_OnMapReplacedEventHandler(OnMapReplaced);
2.绑定图层增加和图层删除事件
public void LoadLayerEvent(object item)
{
IActiveViewEvents_Event pActiveViewEvent = (IActiveViewEvents_Event)MapControl.ActiveView;
pActiveViewEvent.ItemDeleted += new IActiveViewEvents_ItemDeletedEventHandler(ItemChanged);
pActiveViewEvent.ItemAdded += new IActiveViewEvents_ItemAddedEventHandler(ItemChanged);
}
3.具体操作
public void ItemChanged(object item)
{}
上一篇: 用函数实现模块化程序设计
下一篇: 14.用蓝图实现模块化的应用