title: How to select a feature on WMS or Vector layer
body: <p>I have a Vector layer set up on a WMS layer, on which I need to select features and highlight those on map, not by clicking on map but by clicking a button or something external to the map. Here is the code: </p>
  
  <pre><code>regioni = new OpenLayers.Layer.WMS(
              "regioni",
              "http://localhost:8080/geoserver/mmasgis/wms",
              {layers: 'mmasgis:reg2011_g', format: 'image/gif'}
  );
  
  select = new OpenLayers.Layer.Vector("Selection", {styleMap:
              new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])
  });
  
  map.addLayers([regioni, select]);
  
  selectionControl = new OpenLayers.Control.GetFeature({
              protocol: OpenLayers.Protocol.WFS.fromWMSLayer(regioni),
              box: true,
              hover: true,
              multipleKey: "shiftKey",
              toggleKey: "ctrlKey"
          });
          selectionControl.events.register("featureselected", this, function(e) {
              select.addFeatures([e.feature]);
          });
          selectionControl.events.register("featureunselected", this, function(e) {
              select.removeFeatures([e.feature]);
          });
  map.addControl(selectionControl);
  selectionControl.activate(); 
  </code></pre>
  
  <p>With this code I can select features by clicking on map with no problems, but I need to select features by clicking on something external to my map. The main issue is that I have to pass a <code>OpenLayers.Feature</code> object to the selectionControl.addFeatures method, but I don't have that Object, but just the <code>fid</code> or some information contained in the WMS layer.</p>
  
  <p>I'm working with Geoserver &amp; Openlayers on tomcat7. Any ideas?</p>