MapControl图层删除或添加触发监听事件
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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图层删除或添加触发监听事件的主要内容,如果未能解决你的问题,请参考以下文章
ExtJS 下拉框监听事件日期选择器监听事件实现动态给items添加删除数据