title: How to zoom to any feature of Openlayers3 (v3.17.1) map
body: <p>I know this question was discussed at many other topics. But I still not able to find a solution for my issue. None of receipts are works for me.</p>
  
  <p>An issue is very simple. I have a features at my Openlayers3 (v3.17.1) map. I should be able to zoom to any of feature I want.</p>
  
  <p>Before zoom:</p>
  
  <p><a href="https://i.stack.imgur.com/mEbpA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mEbpA.png" alt="enter image description here"></a></p>
  
  <p>After zoom:</p>
  
  <p><a href="https://i.stack.imgur.com/g1a0H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g1a0H.png" alt="enter image description here"></a></p>
  
  <p>As I mentioned I use version v3.17.1.</p>
  
  <pre><code>var features = myLayer.getSource().getFeatures();
  var myFirstFeature = features[0];
  </code></pre>
  
  <p>Option 1:</p>
  
  <pre><code>map.zoomToExtent(feature.geometry.getBounds());
  </code></pre>
  
  <p>Option 2:</p>
  
  <pre><code>    var bounds = f.geometry.getBounds().clone();
      this._map.zoomToExtent(bounds,false);
  </code></pre>