Summary
We covered a good deal in this chapter. We talked about the idea behind controls and how they are used in OpenLayers. We then demonstrated how to add controls to a map. We covered the Control class and its various subclasses in depth. We also went over how to set up panels and how to add controls to them. To finish the chapter, we provided an introduction to events and learned how to create our own custom controls.
Even though we've been pretty thorough in this chapter, there's still more to learn about controls—such as how to style them. In Chapter 9, on the Vector layer class, we'll go over some Vector layer specific controls we neglected. This chapter was likely a lot to take in, but the next chapter will be a bit shorter. We'll discuss styling controls using CSS, and we'll make controls that actually look like they should be clicked, not just big green and blue squares.