How it works..

You have seen how to create a web map viewer with the OpenLayers JavaScript library. This library lets the developer define the various map components, using JavaScript in an HTML page. The core object is a map that is composed of controls and layers.

OpenLayers comes with a great number of controls (http://dev.openlayers.org/docs/files/OpenLayers/Control-js.html), and it is even possible to create custom ones.

Another great OpenLayers feature is the ability to add a good number of geographic data sources as layers in the map (you added just a couple of its types to the map, such as OpenStreetMap and WMS) and you could add sources, such as WFS, GML, KML, GeoRSS, OSM data, ArcGIS Rest, TMS, WMTS, and WorldWind, just to name a few.