title: Updating feature styles in OpenLayers 3
body: <p>I am pulling data from a 3rd party API that gives me lat/lon coords as well as a status for the point. I am currently able to successfully plot the points and give them the correct style for their status on the first iteration. However, every 3 seconds I need to be able to update their style if the status changed. I have tried using <code>mySource.changed()</code> but it did not work. I looked all over and cannot find the solution, even though this does not seem like it should be a difficult thing to accomplish? </p>
  
  <p>I also tried to <code>clear()</code> my source every 3 seconds, but then the vector layer 'flashes' and I need it to update seamlessly. I also tried removing/re-adding the entire vector layer. Do I need to use a style function? Or a feature overlay? Why can I not just overwrite styles like I can in google maps or leaflet?</p>
  
  <p><strong>My Styles</strong></p>
  
  <pre><code>var takenStyle = new ol.style.Style({
      image: new ol.style.Icon({
          src: '../_images/redMark.png',
          scale: .2
      })
  });
  var openStyle = new ol.style.Style({
      image: new ol.style.Icon({
          src: '../_images/greenMark.png',
          scale: .2
      })
  });
  var unsureStyle = new ol.style.Style({
      image: new ol.style.Icon({
          src: '../_images/yellowMark.png',
          scale: .2
      })
  });
  </code></pre>
  
  <p><strong>How I am assigning the styles/features</strong></p>
  
  <pre><code>if ((data.scopes[i].parking_spot.status === true)) {
  var feature = new ol.Feature({
    geometry: new ol.geom.Point(ol.proj.transform(pointCoords, 'EPSG:4326', 'EPSG:3857'))
  });
  feature.setStyle(takenStyle);
  feature.setId(i);
  pointSource.addFeature(feature);
  </code></pre>
  
  <p><strong>UPDATE:</strong> Using Navageer Gowda's suggestion, I was able to finally figure this out. I Created a second function, and had that iterate through the features to update the styles.</p>
  
  <pre><code>if ((data.scopes[i].parking_spot.occupied === true &amp;&amp; data.scopes[i].parking_spot.occupied === lastCheck[i].occupied)) {
       theFeatures[i].setStyle(takenStyle);
  }
  </code></pre>