The OpenLayers' Map
class is the core component of OpenLayers. We use it to manage the layers, controls, interactions, and overlays. We've worked with it already by creating a map object, adding layers to it, then using its view to modify its extent. We are yet to discuss the functionality behind the Map
class, the core component of our applications.
In OpenLayers, everything belongs to the Map
class. The Layer
, Control
, and Interaction
classes must be hooked up to a map if we want them to do anything. So, we need a map object to actually create a useful map—and as you might imagine, we'll see later in this chapter that it is possible to make an application that uses multiple map objects.