Move the map with left click.

Topics: Feature Requests
Sep 14, 2010 at 4:52 PM


First of all, thanks for the awesome application you've posted here!! It works perfectly and it saved me a lot of work.

Second, can you tell me where is the code that makes the map moves?? or a way to move the map when we maintain clicked the left button of the mouse???

Thank you VERY MUCH!!!

Sep 14, 2010 at 7:15 PM

map.DragButton = MouseButtons.Right

Sep 15, 2010 at 8:10 AM

Thank you very much!!!

I couldn't find that property!! Awesome! 

Thanks once again!

Sep 16, 2010 at 9:28 PM

You can implement it by mouse down & mouse move events



add this variables as public variable

int move_x;
        int move_y;

then add this commands in the correct place. these are events of GMAP component



 if (e.Button.ToString().Equals(MouseButtons.Left.ToString()))
                flag_move = true;
                MainMap.Cursor = Cursors.Hand;
                move_x = e.X;
                move_y = e.Y;


 int this_x = 0;
            int this_y = 0;
            if (flag_move)
                this_x = e.X - move_x;
                this_y = e.Y - move_y;
                MainMap.Offset(this_x, this_y);
                move_x = e.X;
                move_y = e.Y;



flag_move = false;
            MainMap.Cursor = Cursors.Arrow;