
OpenLayers Cookbook

When developing a web mapping application, the use of OpenLayers is only a piece among the set of tools that we need to use. Adding other components, such as buttons, images, lists, and so on, and interacting with them are other tasks that we must work on.
Interacting with a OpenLayers.Map
instance or OpenLayers.Layer
subclass is easy because they trigger specific events, but what if we want to listen for events on a button or any DOM
element?
For this purpose, OpenLayers offers us the OpenLayers.Event
class (do not get confused with the plural OpenLayers.Events
class). This is a helper class, which, among other things, allows us to listen for events in non-OpenLayers elements in a browser-independent way.
Unfortunately the way to register event listeners in JavaScript is not the same in all browsers. Also, Microsoft differs from W3C (the WWW Consortium) in the way to register listeners. You can find more information at http://www.quirksmode.org/js/events_advanced...
Change the font size
Change margin width
Change background colour