Pan map using arrow keys


Purpose
This sample demonstrates how the MapBean can be configured to pan the display using the arrow keys on the keyboard and to zoom in and out of the display using the mouse wheel when the MapBean has focus.

How to use

See How to use ArcGIS samples for help on running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Most container dialogs use the arrow keys to change control focus and do not pass these key values on to the MapBean. Use the setKeyIntercept method to allow these keys to be intercepted before the container dialog processes them.
  2. Use the setAutoKeyboardScrolling method to enable automatic panning of the display when the arrow keys are intercepted and the setAutoMouseWheel property to enable automatic zooming on the display with the mouse wheel.


Download the files for Java
mapbean/PanMapUsingArrowKeys.java Main class




Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView
ArcEditor
ArcInfo