openlayers/ol3 — pull request #542 by twpayne (2013-04-12 15:56:20+00:00)
Title: Create and remove layer renderers in renderFrame

Previously, the map renderer would listen for layers being added and
removed from the layers collection, and would create and remove layer
renderers in response to these events.

With this change, layer renderers are only created or removed when
renderFrame is called, which leads to somewhat simpler code.

We still need to listen to changes to the layers collection, but now
these only trigger a new render.

This new approach also has an advantage when layers change order.
Swapping the order of two layers involves removing one and re-inserting
it elsewhere. With the old approach, this would cause the deletion and
re-creation of the layer renderer. With this new approach, the layer
renderer is preserved.