title: Openlayers 3: how to select a feature programmatically using ol.interaction.Select?
body: <p>I'm using <b>OpenLayers v3.6</b> (this is important, because most of solutions that I found and would potentialy work are for OpenLayers 2).</p>
  
  <p>I have a table and when I select a row in that table, I would like to highlight/select a corresponding feature on the OpenLayers map. All features are simple polygons (<i>ol.geom.Polygon</i>) in the same vector layer (<i>ol.layer.Vector</i>).</p>
  
  <p>I set up select interaction like this:</p>
  
  <pre><code>// there is a lot of other code here
  ...
  addSelectListener: function() {
      this.SelectInteraction = new ol.interaction.Select({
          condition: ol.events.condition.singleClick,
          layers: function (layer) {
              // defines layer from which features are selectable
              return layer.get('id') == 'polygons_layer';
          },
          style: this.Style.Selected
      });
  
      // Map = ol.Map
      Map.addInteraction(this.SelectInteraction);
      this.SelectInteraction.on('select', this.selectPolygon, this);
  }
  
  ...
  
  selectPolygon: function(event) {
      var selectSrc = this.getSelectInfo(event);
  
      // some code that relies on selectSrc data
  }
  
  ...
  
  getSelectInfo: function (event) {
      var selectSrc = {
          deselected: null,
          selected: null,
          type: null                
      };
  
      if (event.selected.length == 0 &amp;&amp; event.deselected.length == 1) {
          // click outside of polygon with previously selected
          selectSrc.type = 'deselect';
          selectSrc.deselected = {
              feature: event.deselected[0],
              id: event.deselected[0].getId()
          };
  
      } else if (event.deselected.length == 0 &amp;&amp; event.selected.length == 1) {
          // click on polygon without previously selected
          selectSrc.type = 'select';
          selectSrc.selected = {
              feature: event.selected[0],
              id: event.selected[0].getId()
          }
  
      } else if (event.deselected.length == 0 &amp;&amp; event.selected.length == 1) {
          // click on polygon with previously selected
          selectSrc.type = 'switch';
          selectSrc.deselected = {
              feature: event.deselected[0],
              id: event.deselected[0].getId()
          };
          selectSrc.selected = {
              feature: event.selected[0],
              id: event.selected[0].getId()
          }
      } else {
          selectSrc.type = 'out';
      }
  
      return selectSrc;
  }
  </code></pre>
  
  <p>This functions well when I want to select polygon by clicking on it on the map. But what I want is to achieve the same, not by clicking on map but rather click on some element outside the map (table row in my example, but it could be anything really).</p>
  
  <p>I would like to use select interaction because of event that is emitted and because of the styling it applies to selected features. However, if by any chance I can just manipulate the selected features in select interaction without having the same event it would be ok.</p>
  
  <p>I'm aware of this question &amp; answer - <a href="https://stackoverflow.com/questions/26422598/openlayers-3-select-a-feature-programmatically">Openlayers 3: Select a feature programmatically</a> - but the problem is that I cannot ask in comments for clarification (for example, what exactly is <i>mySelectControl</i>), because I don't have any reputation :)</p>