Exemple #1
0
 private void Events_MapKeyDown(BIT.AVL.Silver.Map.Map map, KeyEventArgs args)
 {
     if(args.Key == Key.Ctrl && _IsCtrlDown == false)
     {
         _DragModePrior = MapInstance.DragMode;
         _IsCtrlDown = true;
         map.DragMode = BIT.AVL.Silver.Map.Map.DragBehavior.Select;
     }
     else
     {
         switch(args.Key)
         {
             //For convenience, hold Control to zoom when already navigating with the arrows
             case Key.Left: map.Pan(Direction.West); break;
             case Key.Right: map.Pan(Direction.East); break;
             case Key.Up: if(_IsCtrlDown) map.ZoomLevel += 1; else map.Pan(Direction.North); break;
             case Key.Down: if(_IsCtrlDown) map.ZoomLevel -= 1; else map.Pan(Direction.South); break;
         }
     }
 }