code: function(renderer) {
          var layer = this.map.getLayer(renderer.container.id);
          if(layer instanceof OpenLayers.Layer.Vector.RootContainer) {
              layer = this.map.getLayer(this.container.id);
          }
          layer && layer.renderer.clear();
          OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this, arguments);
          layer && layer.redraw();
      }
docs: Method: moveRoot
  moves this renderer's root to a different renderer.
  
  Parameters:
  renderer - {<OpenLayers.Renderer>} target renderer for the moved root
  root - {DOMElement} optional root node. To be used when this renderer
  holds roots from multiple layers to tell this method which one to
  detach
  
  Returns:
  {Boolean} true if successful, false otherwise