Chapter 6. Taking Control of Controls
So far, we've taken for granted that the map will move when we drag it. Or that we can just click a layer in the layer switcher and it will turn on or off. Or that we can zoom in and out. We haven't yet talked much about what actually is behind the map interaction or how it works.
Simply put, the OpenLayers Control class is what makes our maps interactive. There are many built in controls, each with their own unique functions. But, not only do you have a large number of pre-made controls at your disposal, you also have the ability to easily create your own controls.
In this chapter, we'll cover:
What controls are
Adding controls to a map
The Control class and its subclasses
Using panels to add controls outside of the map
Creating custom controls