Map Image ... Center Map during panning on left mouse click

Apr 27, 2010 at 3:38 PM

Ciao

i don't like to center the map when the Pan Action is enabled and a click on the map position is done...   

I've added in my project a Flag... CenterMapOnLeftClick

If it is True the work is done otherwise No!....

                    else if (ActiveTool == Tools.Pan)
                    {
                        if (mousedragging)
                        {
                            System.Drawing.Point pnt = new System.Drawing.Point(Width/2 + (mousedrag.X - e.Location.X),
                                                                                Height/2 + (mousedrag.Y - e.Location.Y));
                            _Map.Center = _Map.ImageToWorld(pnt);
                            if (MapCenterChanged != null)
                                MapCenterChanged(_Map.Center);
                        }
                        else
                        {
                            if (CenterMapOnLeftClick)
                            {
                                _Map.Center = _Map.ImageToWorld(new System.Drawing.Point(e.X, e.Y));
                                if (MapCenterChanged != null)
                                    MapCenterChanged(_Map.Center);
                            }
                        }
                        Refresh();
                    }