private void ChangeTool(SharpMap.Forms.MapImage.Tools tool) { _mapImage.ActiveTool = tool; _view.SelectChecked = false; _view.ZoomInChecked = false; _view.ZoomOutChecked = false; _view.PanChecked = false; switch (tool) { case SharpMap.Forms.MapImage.Tools.Pan: _view.PanChecked = true; break; case SharpMap.Forms.MapImage.Tools.ZoomIn: _view.ZoomInChecked = true; break; case SharpMap.Forms.MapImage.Tools.ZoomOut: _view.ZoomOutChecked = true; break; case SharpMap.Forms.MapImage.Tools.Query: _view.SelectChecked = true; break; } }
/// <summary> /// Initializes a new map /// </summary> public MapImage() { _Map = new SharpMap.Map(base.Size); _Activetool = Tools.None; base.MouseMove += new System.Windows.Forms.MouseEventHandler(this.MapImage_MouseMove); base.MouseUp += new System.Windows.Forms.MouseEventHandler(this.MapImage_MouseUp); base.MouseDown += new System.Windows.Forms.MouseEventHandler(this.MapImage_MouseDown); base.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.MapImage_Wheel); this.Cursor = Cursors.Cross; this.DoubleBuffered = true; }