[dashboard][maps] fix 'by value' map does not fill dashboard panel on initial page load (#155554)

Fixes https://github.com/elastic/kibana/issues/155553

Following steps in issue now renders map as expected
<img width="600" alt="Screen Shot 2023-04-21 at 1 18 54 PM"
src="https://user-images.githubusercontent.com/373691/233717520-7e25b4a9-1639-4b5e-9dfc-3816f4f35153.png">
This commit is contained in:
Nathan Reese 2023-04-21 14:51:12 -06:00 committed by GitHub
parent 4eeec1865f
commit f0106b1817
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -283,11 +283,10 @@ export class MbMap extends Component<Props, State> {
}
_initResizerChecker() {
this.state.mbMap?.resize(); // ensure map is sized for container prior to monitoring
this._checker = new ResizeChecker(this._containerRef!);
this._checker.on('resize', () => {
if (this.state.mbMap) {
this.state.mbMap.resize();
}
this.state.mbMap?.resize();
});
}