By default, OpenLayers draws, or renders, the map in the browser using an HTML 5 canvas element and its associated 2D drawing context. This is known as the Canvas renderer. However, OpenLayers actually comes with three renderers. The ability to choose a different renderer for the map can be very powerful but it should also be used with care. Each renderer has some specific capabilities and limitations. In particular, only the Canvas renderer is considered stable at the time of writing this book.
The Canvas renderer draws the map's contents onto an HTML 5 canvas element (http://en.wikipedia.org/wiki/Canvas_element). The canvas element is a high-performance 2D drawing surface supported by all modern web browsers (on Internet Explorer, Canvas support starts with version 9). The canvas renderer is the most fully supported renderer in OpenLayers. It does not support some of the advanced features of the WebGL renderer, including 3D, controlling the contrast, brightness, hue and saturation of a layer, and other advanced capabilities requiring the power of WebGL.
You will most likely want to use this renderer until WebGL is more broadly supported, unless you are building an application that can target browsers that specifically support WebGL.
WebGL (http://en.wikipedia.org/wiki/WebGL) is a powerful technology that gives the web browser access to hardware-accelerated 2D and 3D graphics rendering, normally available only to desktop software, typically games. With this renderer, OpenLayers will be able to efficiently render a lot of vector and raster data simultaneously. At the time of this writing, rendering of vector data with WebGL was still in development and not yet available.
It even provides the ability to render data in 3D and give full 3D navigation. Given how fantastic all this sounds, why wouldn't you use it all the time? Unfortunately, WebGL support in a browser is dependent on two things. First, the user's computer must have a graphics card and software drivers that are capable of supporting it. Second, the web browser itself must support it. Since WebGL is a relatively new specification, only the newest versions of Google Chrome, Safari, and Firefox will enable WebGL on systems with capable hardware. Internet Explorer up to version 10 does not provide WebGL support at all, although there are third-party plugins that can be added by users to provide it. Finally, mobile browser support is very limited and varies widely at this time.
In summary, the WebGL renderer can give your application amazing performance and some cutting edge capabilities if your intended users can be relied on to have the latest web browser versions and capable hardware. It isn't suitable if you need to support older web browsers, Internet Explorer, or mobile users.
The DOM renderer draws the map's contents using HTML elements (<img> and <div> tags) and uses CSS to position them. This renderer is supported by older versions of most browsers, including Internet Explorer 8. However, it does not provide many of the capabilities enjoyed by the Canvas renderer. Of the features that it does not support, the most important is vector support covered in Chapter 6, Styling Vector Layers. The DOM renderer will also generally exhibit poorer performance.
There is some effort being undertaken by community members to provide some vector capabilities for the DOM renderer, including support for Internet Explorer 8, but in general, you will probably not want to use the DOM renderer unless you need to support older browsers that do not provide Canvas support.