private void AxGlobeControlEx_Load(object sender, EventArgs e) { IGlobeDisplayEvents_Event m_GlobeDisplayEvents = axGlobeControl1.Globe.GlobeDisplay as IGlobeDisplayEvents_Event; this.MouseWheel += new MouseEventHandler(GlobleControl_MouseWheel); //将三维视图重绘事件委托给m_GlobeDisplayEvents_AfterDraw方法 m_GlobeDisplayEvents.AfterDraw += new IGlobeDisplayEvents_AfterDrawEventHandler(GlobeControl_DisplayEvents_AfterDraw); axMapControl1.OnMouseDown += new ESRI.ArcGIS.Controls.IMapControlEvents2_Ax_OnMouseDownEventHandler(axMapControl1_OnMouseDown); axMapControl1.Extent = axMapControl1.FullExtent; // 初始化地图框架 MapFrame.Logic.InitMapFrame mapFrame = new MapFrame.Logic.InitMapFrame(MapEngineType.ArcGlobe, axGlobeControl1); mapLogic = mapFrame.GetMapLogic(); mfMap = mapLogic.GetIMFMap(); Load3dFile(); // 加载3d文档 LoadMxdFile(); // 自定义显示鹰眼工具 ShowEagleEyeCmd showEagleEyeCmd = new ShowEagleEyeCmd(this); axToolbarControl1.AddItem(showEagleEyeCmd, -1, 22, false, -1, esriCommandStyles.esriCommandStyleIconOnly); globeBusiness = new ArcGlobeBusiness(mapLogic, trackMgr); eagleEyePanel.Visible = false; InitBookmark(); // 初始化书签 }
/// <summary> /// 初始化地图框架 /// </summary> private void InitMapFrame() { InitMapFrame mapFrame = new InitMapFrame(MapEngineType.GMap, null); mapLogic = mapFrame.GetMapLogic(); map = mapLogic.GetIMFMap(); map.ElementClickEvent += new System.EventHandler <Core.Model.MFElementClickEventArgs>(map_ElementClickEvent); map.MouseMoveEvent += new EventHandler <MFMouseEventArgs>(map_MouseMoveEvent); Control mapControl = (Control)mapLogic.GetMapControl(); mapControl.Dock = DockStyle.Fill; this.panel1.Controls.Add(mapControl); mapLogic.GetToolBox().CommondExecutedEvent += new EventHandler <MessageEventArgs>(Form1_CommondExecutedEvent); System.Diagnostics.Debug.WriteLine("初始化程序线程ID" + Thread.CurrentThread.ManagedThreadId); }
public GMapControlBusiness mapBusiness = null; // 业务类 public GMapControlEx(TrackLineManager trackMgr, ArcGlobeBusiness _globeBusiness) { InitializeComponent(); InitMapFrame mapFrame = new InitMapFrame(MapEngineType.GMap, null); mapLogic = mapFrame.GetMapLogic(); toolBox = mapLogic.GetToolBox(); map = mapLogic.GetIMFMap(); map.ElementClickEvent += Map_ElementClickEvent; map.MouseMoveEvent += new EventHandler <MFMouseEventArgs>(map_MouseMoveEvent); Control mapControl = (Control)mapLogic.GetMapControl(); mapControl.Dock = DockStyle.Fill; this.mapPanel.Controls.Add(mapControl); mapBusiness = new GMapControlBusiness(mapLogic, trackMgr, _globeBusiness); }