Posts: 29
Joined: Tue Nov 13, 2007 12:38 pm
Location: Pakistan

how to drag Objects on the Map with mouse

Sun Apr 26, 2009 1:55 pm

I need an idea how to drag objects like LINE, ELLIPSE,CIRCLE,ICON on the map through mouse using GPS tool with VB.net

Posts: 16
Joined: Wed Sep 13, 2006 3:32 pm
Location: New Caledonia

RE: how to drag Objects on the Map with mouse

Mon May 25, 2009 12:06 am


I didn't find a solution to do this with standard drag and drop.

The only one solution I found is : when I click on a ellipse in the right panel (like a menu of icons), I associate this ellipse to the event mousemove.

And so, I can move ellipe, circle, icon and other form. With the next clic, I consider ellipse on X,Y and cursor become back standard.

Did you find a real drag and drop solution ?

Thank you

New Caledonia

Posts: 282
Joined: Fri Jun 17, 2005 12:13 am
Location: Canada

RE: how to drag Objects on the Map with mouse

Mon May 25, 2009 10:37 pm

This is how I do this when I have the entire map object filled with many shapefiles.

1. using MouseDown: click on the map and store the XY position of the click
2. using MouseMove: move the mouse and calculate the change in X and Y of new mouse position; refresh the map
3. using MouseUp: finish and clear all the various position objects used in #1 and #2

It's not totally smooth, but it works good enough. On a PPC it is best to skip refreshing the map, and just redraw the map using MouseUp and the final pointer position.


Return to “GpsTools”