I have upgrade openlayers in IONIC V3 app from 4.6.5 to 6.1.0. Now map.getView().fit(extent, {duration:1000}) stop working, when i remove the options object it works fine.
Am i doing something wrong or anything else is needed.?
var extent;
extent = s_layer.getSource().getFeatures()[0].getGeometry().getExtent();
map.getView().fit(extent);
//this works fine.
map.getView().fit(extent, {duration: 1000});
//Doesn't fit the extent,just a slight movement on map.
I want to achieve a slight animation on map, when fit the extent of feature. Also tried animate() method of view class but not able to get the desired results.
Best Answer
I was having the same problem. I ended up using
.animate()
and had to removesetZoom()
because that is one of the functions that will stop the animation.OpenLayers animate()