Map Navigation with the mouse and keyboard
Users can also control map navigation with the mouse and/or keyboard devices. By default, users can do the following:
- Drag the mouse to pan
- Mouse scroll forward to zoom in
- Mouse scroll backward to zoom out
- SHIFT + Drag the mouse to zoom in + drag the mouse to zoom in
- Shift + Ctrl + drag the mouse to zoom out
- Shift + click to recenter
- Double Click to zenter and zoom in
- Shift + double-click to center and zoom out
- Use arrow keys to pan
- Use + key to zoom in a level
- Use - key to zoom out a level
These options can be disabled using one of several Map methods. For example, to disable scroll wheel zooming you would use the Map.disableScrollWheelZoom() method. These navigation features can also be removed after the map has been loaded. This can be very useful. For example, let's say that you have a custom tool that requires the user to double click on the map to select a feature. You'll want to call Map.disableDoubleClickZoom() while your tool is being used, and Map.enableDoubleClickZoom() when your user has finished with it.