Пример #1
0
        private void gmap_MouseUp(object sender, MouseEventArgs e)
        {
            switch (e.Button)
            {
            case MouseButtons.Left:
                if (map3d == null || map3d.IsDisposed)
                {
                    map3d = new SharpGLForm();
                }
                map3d.Show();
                var    bbox   = this.polyOverlay.Polygons.First();
                double left   = Math.Min(bbox.Points[1].Lng, bbox.Points[3].Lng);
                double bottom = Math.Min(bbox.Points[0].Lat, bbox.Points[2].Lat);
                double right  = Math.Max(bbox.Points[1].Lng, bbox.Points[3].Lng);
                double top    = Math.Max(bbox.Points[0].Lat, bbox.Points[2].Lat);
                map3d.LoadMap(left, bottom, right, top);
                break;

            case MouseButtons.Right:
                break;

            case MouseButtons.Middle:
                break;

            default:
                break;
            }
        }
Пример #2
0
 private void gmap_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode >= Keys.D1 && e.KeyCode <= Keys.D9)
     {
         if (map3d == null || map3d.IsDisposed)
         {
             map3d = new SharpGLForm();
         }
         map3d.Show();
         map3d.LoadMap(SharpGLForm.SamplesPath + SharpGLForm.Samples[e.KeyCode - Keys.D1]);
     }
 }