code: function(layer) {
          var target;
          for(var i=this.targets.length-1; i>=0; --i) {
              target = this.targets[i];
              if(target.layer === layer) {
                  this.removeTarget(target);
              }
          }
      }
docs: Method: removeTargetLayer
  Remove a target layer.
  
  Parameters:
  layer - {<OpenLayers.Layer.Vector>} The target layer to remove.