【问题标题】:GMap.NET Windows Forms move the map with the mouseGMap.NET Windows 窗体用鼠标移动地图
【发布时间】:2017-06-09 16:15:25
【问题描述】:

在 GMapControl 中如何正确处理使用鼠标按下和移动 Google 地图?

GMapControl gMap = new GMapControl();
gMap.MouseDown += GMap_MouseDown;

private void GMap_MouseDown(object sender, MouseEventArgs e)
{
    gMap.MouseMove += GMap_MouseMove;
}

private void GMap_MouseMove(object sender, MouseEventArgs e)
{
     base.OnMouseMove(e);
     //gMap.Position = new PointLatLng(X, Y);
}

【问题讨论】:

    标签: winforms mousemove mousedown gmap.net


    【解决方案1】:

    您不需要任何代码来移动地图。默认是用鼠标右键移动地图,我觉得这很尴尬。要更改为 LEFT 鼠标,请在 Form 的 Load() 事件中使用如下代码:

    gMap.DragButton = MouseButtons.Left;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多