Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
radioman committed May 11, 2015
2 parents 8f3b90f + ea29b52 commit 5dfb8d7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions GMap.NET.Core/GMap.NET.Internals/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ internal class Core : IDisposable
public GPoint mouseLastZoom;

public MouseWheelZoomType MouseWheelZoomType = MouseWheelZoomType.MousePositionAndCenter;
public bool MouseWheelZoomEnabled = true;

public PointLatLng? LastLocationInBounds = null;
public bool VirtualSizeEnabled = false;
Expand Down
20 changes: 20 additions & 0 deletions GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,23 @@ public MouseWheelZoomType MouseWheelZoomType
}

/// <summary>
/// enable map zoom on mouse wheel
/// </summary>
[Category("GMap.NET")]
[Description("enable map zoom on mouse wheel")]
public bool MouseWheelZoomEnabled
{
get
{
return Core.MouseWheelZoomEnabled;
}
set
{
Core.MouseWheelZoomEnabled = value;
}
}

/// <summary>
/// text on empty tiles
/// </summary>
public string EmptyTileText = "We are sorry, but we don't\nhave imagery at this zoom\nlevel for this region.";
Expand Down Expand Up @@ -2266,6 +2283,8 @@ protected override void OnMouseWheel(MouseEventArgs e)
{
base.OnMouseWheel(e);

if (MouseWheelZoomEnabled)
{
if (mouseIn && (!IsMouseOverMarker || IgnoreMarkerOnMouseWheel) && !Core.IsDragging)
{
if (Core.mouseLastZoom.X != e.X && Core.mouseLastZoom.Y != e.Y)
Expand Down Expand Up @@ -2323,6 +2342,7 @@ protected override void OnMouseWheel(MouseEventArgs e)
}

Core.MouseWheelZooming = false;
}
}
}
#endif
Expand Down

0 comments on commit 5dfb8d7

Please sign in to comment.