OpenLayers Toolbar UI Design
Instant Actions
In response to clicking a button or hitting a keyboard shortcut:
| Icon | Keyboard shortcut | Comment |
| zoom in | "=" or "+" | with or without shift |
| zoom out | "-" or "_" | with or without shift |
| pan smoothly | left/right/up/down arrows | ... |
| pan jump | pageup/pagedown/home/end | do we need an icon for this? |
| zoom to world | 0 | if we have the zoombar, do we need an icon for this? |
Toolbar Modes
Mouse driven actions that result from putting the toolbar into a particular mode and then doing something with the mouse. Pan/Select will be the default toolbar mode. If a particular mouse action is not defined in a given mode, the Pan/Select mode behavior for that mouse combo should be used.
| Mode | Map action | Mouse action |
| Pan/Select | Select | left-click |
| Pan/Select | Pan | drag |
| Pan/Select | Recenter | double-click |
| Zoom box | Zoom box | drag |
| Zoom box | Zoom in here | left-click |
| Zoom box | Zoom out here | right-click |
| Path ruler | Path ruler | left-click |
The select map action should be reserved for whatever the application needs it to mean (and should be left undefined otherwise).
Modal Shortcuts
Keyboard shortcuts can be used to temporarily modify the toolbar mode (or potentially switch it altogether). When the toolbar mode is temporarily modified by a key press, the corresponding toolbar icon should be highlighted until the modifier key is released and the previous mode is restored.
- Holding down shift temporarily puts the toolbar into zoom box mode, until the key is released.
- Holding down control temporarily puts the toolbar into path ruler mode, until the key is released.
- Other keys can be defined in a similar fashion. The left side of the home row ('a', 's', 'd', 'f', 'g') is ideal for this. Alternately, these keys could be used to switch modes entirely, if such a thing turned out to be necessary. As yet another option, these keys (or the rows above or below) could be used to toggle the top five layers in the LayerSwitcher.
