Panels
So far, we've covered the most common controls, ones that we'll be using throughout the book. There is another type of control that we have not yet discussed—the panel control. It is a container, a control that allows us to add and group together other controls inside of a (you guessed it) panel. We have, in fact, encountered the panel control to some degree with a few of the controls we've discussed. The PanPanel and ZoomPanel controls are actually panels which contain other controls.
Control types
With a panel, each control is represented by an icon (which can be styled anyway you wish). When the icon is clicked, the activateControl
method of that control is called. Remembering to call activateControl
is very important—most controls will not activate by themselves (we'll cover this in more detail soon). Some of the controls we've encountered can be placed inside a panel, as we'll see in a moment.
Each control in a panel has one of the three 'types':
OpenLayers.Control.TYPE_BUTTON
: This...