Introduction
Controls allow us to navigate around the map, play with layers, zoom in or out, and perform actions, such as editing features, measuring distances, and so on. In essence, controls allow us to interact.
OpenLayers comes with controls that are visually represented on the map through DOM elements and can be styled with CSS. Such controls, such as Attribution
, FullScreen
, and Zoom
, fall under this category. These types of controls are subclasses of ol.control.Control
.
There are also other kinds of controls that are invisible to the user, but they provide just as important interactions. Controls, such as KeyboardPan
, Select
, and PinchZoom
, are of this type. These types of controls are part of the ol.interaction
object.
There are also other helper methods that one could consider a type of control, such as the ol.Geolocation
class that provides HTML5 geolocation capabilities.
Controls can be activated or deactivated as desired. Many controls or interactions are already included on a map...