Quantcast
Channel: GMap.NET - Great Maps for Windows Forms & Presentation
Viewing all articles
Browse latest Browse all 3384

Created Unassigned: Drag Item [16078]

$
0
0
On mouse move evenhandler when we drag a item over
other one we lost it and often the drag stop:



In the GMapControl.cs I add this boolean

public bool markerAsClick = false;

The caller setup the flag

void MainMap_MouseMove(object sender, MouseEventArgs e)
{
if(e.Button == MouseButtons.Left && isMouseDown)
{
if(CurentRectMarker == null)
{
if(currentMarker.IsVisible)
{
currentMarker.Position = MainMap.FromLocalToLatLng(e.X, e.Y);
}
}
else // move rect marker
{
MainMap.markerAsClick = true;
PointLatLng pnew = MainMap.FromLocalToLatLng(e.X, e.Y);

. ..
......
}

MainMap.Refresh(); // force instant invalidation
}
}

protected override void OnMouseMove(MouseEventArgs e)
{
if(!markerAsClick)
{
.........
..............
}

base.OnMouseMove(e);
}

for me it's work fine
but probably you have a better place to do this

Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>