code: function(geometry, featureId) {
          if ((geometry.CLASS_NAME == "OpenLayers.Geometry.MultiPoint") ||
              (geometry.CLASS_NAME == "OpenLayers.Geometry.MultiLineString") ||
              (geometry.CLASS_NAME == "OpenLayers.Geometry.MultiPolygon") ||
              (geometry.CLASS_NAME == "OpenLayers.Geometry.Collection")) {
              for (var i=0, len=geometry.components.length; i<len; i++) {
                  this.eraseGeometry(geometry.components[i], featureId);
              }
          } else {    
              var element = OpenLayers.Util.getElement(geometry.id);
              if (element && element.parentNode) {
                  if (element.geometry) {
                      element.geometry.destroy();
                      element.geometry = null;
                  }
                  element.parentNode.removeChild(element);
  
                  if (this.indexer) {
                      this.indexer.remove(element);
                  }
                  
                  if (element._style.backgroundGraphic) {
                      var backgroundId = geometry.id + this.BACKGROUND_ID_SUFFIX;
                      var bElem = OpenLayers.Util.getElement(backgroundId);
                      if (bElem && bElem.parentNode) {
                          // No need to destroy the geometry since the element and the background
                          // node share the same geometry.
                          bElem.parentNode.removeChild(bElem);
                      }
                  }
              }
          }
      }
docs: Method: eraseGeometry
  Erase a geometry from the renderer. In the case of a multi-geometry,
  we cycle through and recurse on ourselves. Otherwise, we look for a
  node with the geometry.id, destroy its geometry, and remove it from
  the DOM.
  
  Parameters:
  geometry - {<OpenLayers.Geometry>}
  featureId - {String}