//地图控件加载完成事件 private void axMapControl_eventInitFinish(object sender, _DHOSOFTMapControlEvents_eventInitFinishEvent e) { if (!Utils.bPublishEvent) { return; } MFMapInitFinishEventArgs args = new MFMapInitFinishEventArgs(); if (InitFinishEvent != null) { InitFinishEvent.Invoke(this, args); } }
/// <summary> /// 构造函数 /// </summary> /// <param name="_mapObject">地图控件对象</param> public FactoryGMap(object _mapObject) { lastTime = DateTime.Now; if (_mapObject != null) { mapControl = _mapObject as GMapControl; } else { InitMapControl(); // 初始化地图控件 if (InitFinishEvent != null) { InitFinishEvent.Invoke(this, EventArgs.Empty); } } mapControl.MouseClick += new MouseEventHandler(mapControl_MouseClick); mapControl.MouseMove += new MouseEventHandler(mapControl_MouseMove); mapControl.MouseDown += new MouseEventHandler(mapControl_MouseDown); mapControl.MouseUp += new MouseEventHandler(mapControl_MouseUp); mapControl.MouseDoubleClick += new MouseEventHandler(mapControl_MouseDoubleClick); mapControl.OnMarkerClick += new MarkerClick(mapControl_OnMarkerClick); mapControl.OnPolygonClick += new PolygonClick(mapControl_OnPolygonClick); mapControl.OnRouteClick += new RouteClick(mapControl_OnRouteClick); mapControl.OnMarkerEnter += new MarkerEnter(mapControl_OnMarkerEnter); mapControl.OnMarkerLeave += new MarkerLeave(mapControl_OnMarkerLeave); mapControl.OnRouteEnter += new RouteEnter(mapControl_OnRouteEnter); mapControl.OnRouteLeave += new RouteLeave(mapControl_OnRouteLeave); mapControl.OnPolygonEnter += new PolygonEnter(mapControl_OnPolygonEnter); mapControl.OnPolygonLeave += new PolygonLeave(mapControl_OnPolygonLeave); mapControl.KeyDown += new KeyEventHandler(mapControl_KeyDown); mapControl.KeyPress += new KeyPressEventHandler(mapControl_KeyPress); mapControl.KeyUp += new KeyEventHandler(mapControl_KeyUp); mapControl.OnMapZoomChanged += new MapZoomChanged(mapControl_OnMapZoomChanged); lyMgr = new LayerManger(mapControl, this); pointFac = new PointFactory(); pictureFac = new PictureFactory(); lineFac = new LineFactory(); polygonFac = new PolygonFactory(); textFac = new TextFactory(); circleFac = new CircleFactory(); refreshTimer = new System.Timers.Timer(); refreshTimer.Interval = 500; refreshTimer.Elapsed += refreshTimer_Elapsed; }