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.
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.
Before zoom:
After zoom:
As I mentioned I use version v3.17.1.
var features = myLayer.getSource().getFeatures();
var myFirstFeature = features[0];
Option 1:
map.zoomToExtent(feature.geometry.getBounds());
Option 2:
var bounds = f.geometry.getBounds().clone();
this._map.zoomToExtent(bounds,false);