首页 > 代码库 > MapControl图层删除或添加触发监听事件
MapControl图层删除或添加触发监听事件
监听MapControl中对于图层添加和删除的事件
IActiveViewEvents_Event m_MapActiveViewEvents = m_mapControl.Map as IActiveViewEvents_Event;
//添加图层事件
m_MapActiveViewEvents.ItemAdded += new IActiveViewEvents_ItemAddedEventHandler(m_MapActiveViewEvents_ItemAdded);
//删除图层事件
m_MapActiveViewEvents.ItemDeleted += new IActiveViewEvents_ItemDeletedEventHandler(m_MapActiveViewEvents_ItemDeleted);
//事件处理
void m_MapActiveViewEvents_ItemDeleted(object item)
{
ILayer pLayer = item as ILayer;
//...
}
void m_MapActiveViewEvents_ItemAdded(object item)
{
ILayer pLayer = item as ILayer;
//...
}
MapControl图层删除或添加触发监听事件
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。