1. 程式人生 > >封裝的函數ClearAllData() 清空地圖文檔並新建mainMapControl中Map以及新建EagleEyeMapControl中Map

封裝的函數ClearAllData() 清空地圖文檔並新建mainMapControl中Map以及新建EagleEyeMapControl中Map

lda null ring lee con 以及 pri style !=

 

private void ClearAllData() { if (mainMapControl.Map != null && mainMapControl.Map.LayerCount > 0) { //新建mainMapControl中Map IMap dataMap = new MapClass(); dataMap.Name = "Map"; mainMapControl.DocumentFilename
= string.Empty;//DocumentFilename為The filename of the last map document loaded into the control mainMapControl.Map = dataMap; //新建EagleEyeMapControl中Map IMap eagleEyeMap = new MapClass(); eagleEyeMap.Name = "eagleEyeMap"; EagleEyeMapControl.DocumentFilename
= string.Empty; EagleEyeMapControl.Map = eagleEyeMap; } }

封裝的函數ClearAllData() 清空地圖文檔並新建mainMapControl中Map以及新建EagleEyeMapControl中Map