code: function() {
          // erase any drawn features
          this.erase();
  
          this.map = null;
  
          this.events.destroy();
          this.events = null;
  
          if (this.icon != null) {
              this.icon.destroy();
              this.icon = null;
          }
      }
docs: APIMethod: destroy
  Destroy the marker. You must first remove the marker from any
  layer which it has been added to, or you will get buggy behavior.
  (This can not be done within the marker since the marker does not
  know which layer it is attached to.)