Im using openlayers 6, on mounted I use map().getView().fit(extent) for some reason on every refresh the zoom level is higher. any tips how to fix this?
Before using .fit(extent) I have to transformExtent to change projection from 5514 to 3857
this.map().setView(new View({
projection: 'EPSG:3857',
center: fromLonLat([50.075710, 14.472606]),
zoom: 10,
enableRotation: false
}))
extent = transformExtent(extent, 'EPSG:5514', this.map().getView().getProjection().getCode())
this.map().getView().fit(extent)
my problem is with map.getview.fit here is my code and here are the returned values coordinates after view.fit are a bit different
console.log(transformedExtent)
this.map().getView().fit(transformedExtent, this.map().getSize())
console.log(this.map().getView().calculateExtent(this.map().getSize()))
before fit:
- -27186.072153485078
- 6701982.491006854
- -5136.804165771885
- 6724373.669054876
after fit:
- -27186.072153485078
- 6701493.775314425
- -5136.804165771886
- 6724862.384747305

