2010-08-27 45 views

回答

0

你必須要連接一個事件處理程序

ESRI.ArcGIS.Carto.IDynamicMapEvents_Event dynamicMapEvents = dynamicMap as ESRI.ArcGIS.Carto.IDynamicMapEvents_Event; 
ESRI.ArcGIS.Carto.IActiveViewEvents_Event avEvents = activeView as ESRI.ArcGIS.Carto.IActiveViewEvents_Event; 
avEvents.AfterDraw += new ESRI.ArcGIS.Carto.IActiveViewEvents_AfterDrawEventHandler(avEvents_AfterDraw); 
dynamicMapEvents.AfterDynamicDraw += new IDynamicMapEvents_AfterDynamicDrawEventHandler(dynamicMapEvents_AfterDynamicDraw); 
1

首先,你需要從地圖對象IDynamicMap :: DynamicMapEnabled屬性設置爲true。

IDynamicMap pDynamicMap = pMap as IDynamicMap; 
pDynamicMap.DynamicMapEnabled = true 

然後,有兩種方法可以獲得DynamicDisplay對象。一個是使用實現IDynamicLayer接口創建自定義層。第二個是鉤住IDynamicMapEvents :: BeforeDynamicDraw事件或IDynamicMapEvents :: AfterDynamicDraw事件。我希望這個最佳實踐可以幫助你。

Best practices for using dynamic display