judero01col / GMap.NET

GMap.NET Windows Forms & Presentation is an excellent open source, powerful, free and cross-platform .NET control. Allows the use of routing, geocoding, directions and maps from Google, Yahoo!, Bing, OpenStreetMap, ArcGIS, Pergo, SigPac, Yendux, Mapy.cz, Maps.lt, iKarte.lv, NearMap, HereMap, CloudMade, WikiMapia, MapQuest and many more.
Other
456 stars 199 forks source link

[improvement] Add CenterMouseWhenMouseWheelZoom-ish property #140

Open itschrono opened 3 years ago

itschrono commented 3 years ago

Hello,

I think that for the mouse wheel zoom options (MouseWheelZoomType). Only 2 would be enough:

itschrono commented 3 years ago

Easy bypass:

       internal void Init(GMapControl gMapControl)
        {
            var c = gMapControl;
            c.MouseWheel += GMap_MouseWheel;
            c.MouseWheelZoomEnabled = false;
        }
        private void GMap_MouseWheel(object sender, MouseWheelEventArgs e)
        {
            if (e.Delta < 0) GMapControl.Zoom--;
            else GMapControl.Zoom++;
            e.Handled = true;
        }