code: function(id, type) {
          var node = OpenLayers.Util.getElement(id);
          if (node) {
              if (!this.nodeTypeCompare(node, type)) {
                  node.parentNode.removeChild(node);
                  node = this.nodeFactory(id, type);
              }
          } else {
              node = this.createNode(type, id);
          }
          return node;
      }
docs: Method: nodeFactory
  Create new node of the specified type, with the (optional) specified id.
  
  If node already exists with same ID and a different type, we remove it
  and then call ourselves again to recreate it.
  
  Parameters:
  id - {String}
  type - {String} type Kind of node to draw.
  
  Returns:
  {DOMElement} A new node of the given type and id.