Resize map on changing browser size (#47084)

This commit is contained in:
Adela Almasan
2022-03-30 17:39:28 -05:00
committed by GitHub
parent 85286a5182
commit dea9b51a0f

View File

@ -120,6 +120,12 @@ export class GeomapPanel extends Component<Props, State> {
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;