code: function(source) {
          // check if we already have a selection layer for the source layer
          var selectionLayer;
          if (!this.layerCache[source.id]) {
              selectionLayer = new OpenLayers.Layer.WMS(source.name, 
                  source.url, source.params, 
                  OpenLayers.Util.applyDefaults(
                      this.layerOptions,
                      source.getOptions())
              );
              this.layerCache[source.id] = selectionLayer;
              // make sure the layers are coupled wrt visibility, but only
              // if they are not displayed in the layer switcher, because in
              // that case the user cannot control visibility.
              if (this.layerOptions.displayInLayerSwitcher === false) {
                  source.events.on({
                      "visibilitychanged": this.coupleLayerVisiblity,
                      scope: selectionLayer});
              }
              this.map.addLayer(selectionLayer);
          } else {
              selectionLayer = this.layerCache[source.id];
          }
          return selectionLayer;
      }
docs: Method: createSelectionLayer
  Creates a "clone" from the source layer in which the selection can
  be drawn. This ensures both the source layer and the selection are
  visible and not only the selection.
  
  Parameters:
  source - {<OpenLayers.Layer.WMS>} The source layer on which the selection
  is performed.
  
  Returns:
  {<OpenLayers.Layer.WMS>} A WMS layer with maxGetUrlLength configured to 2048
  since SLD selections can easily get quite long.