Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        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);
        }