I have angular application that uses https://www.npmjs.com/package/angular-split. 1 split area has open layers map. If only map split area is visible, following method:
private zoomToExtent(extent: IExtent, view: ol.View) {
const mapSize = this.map.getSize();
this.map.getView().fit(extent, { size: mapSize });
}
works just fine. However when the window has multiple splits open it does not work because mapSize is still the same even though the map is smaller.
The map works otherwise ok because map buttons and scale line on the right bottom adapts to opening other split areas.
So how this should be done i.e. how to get real map size?