From dea9b51a0f487a00b038b8fa40b73c91f8762eb7 Mon Sep 17 00:00:00 2001 From: Adela Almasan <88068998+adela-almasan@users.noreply.github.com> Date: Wed, 30 Mar 2022 17:39:28 -0500 Subject: [PATCH] Resize map on changing browser size (#47084) --- public/app/plugins/panel/geomap/GeomapPanel.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/app/plugins/panel/geomap/GeomapPanel.tsx b/public/app/plugins/panel/geomap/GeomapPanel.tsx index 105531839e9..c49c6a37b73 100644 --- a/public/app/plugins/panel/geomap/GeomapPanel.tsx +++ b/public/app/plugins/panel/geomap/GeomapPanel.tsx @@ -120,6 +120,12 @@ export class GeomapPanel extends Component { return true; // always? } + componentDidUpdate(prevProps: Props) { + if (this.map && (this.props.height !== prevProps.height || this.props.width !== prevProps.width)) { + this.map.updateSize(); + } + } + /** This function will actually update the JSON model */ private doOptionsUpdate(selected: number) { const { options, onOptionsChange } = this.props;