.SelectedArea problem, map drag

Topics: Bugs
Aug 21, 2011 at 6:31 AM

I've found a bug but hard to fix it myself.
In WPF, Drag runs wrong after select an area with shift key.

To reproduce it:

1. Select an area with shift key + drag.
2. Click right mouse button. (no drag just click once)
3. Move a mouse pointer. Then map will be dragging.
4. Click right mouse button once again. It will be turn to right.

Please inspect this problem.

Sep 5, 2011 at 6:38 PM

..still inspecting, haven't much time for this

May 10, 2012 at 10:28 PM

I replicated this problem on the Windows Forms version too.

It seems that the problem can be related to the drag button not being verified when the mouse move event is fired.

I changed the following line adding the green text condition in GMapControl.cs class on the GMap.NET.WidowsForms namespace:


protected override void OnMouseMove(MouseEventArgs e)

	if (!Core.IsDragging && !Core.mouseDown.IsEmpty && (e.Button == DragButton)) 

This change was tested using the GMap.NET Build ba256a1bcb (May 3 2012) and it works ok now. Hope this helps.

I guess that the WPF OnMouseMove event should also be changed.


Best regards.


May 11, 2012 at 10:21 AM

fixed, thanks for reminder ;}

Jul 9, 2012 at 2:56 PM

sergiorincon, radioman thank you so much.

Nov 14, 2013 at 4:01 PM
I am seeing this problem with Windows Forms runtime version 2.0.50727 when I select an area (Alt-Right Click) and then left click anywhere. If I right click to clear the selected area, the problem goes away. I tried to handle this in the Mouse Up handler by checking to see if SelectedArea was not empty, and if so drawing my own polygon in place of the selected area and setting map.SelectedArea = RectLatLng.Empty. This did not solve the issue. Any help would be greatly appreciated.

Steve Kirchner