diff --git a/app/component/map/Map.js b/app/component/map/Map.js index 2f24744f71..890a7fd11d 100644 --- a/app/component/map/Map.js +++ b/app/component/map/Map.js @@ -187,13 +187,15 @@ export default class Map extends React.Component { // eslint-disable-next-line react/no-unused-class-component-methods setBottomPadding = padding => { - this.boundsOptions.paddingBottomRight = [ - 0, - Math.max( - Math.min(padding, window.innerHeight - 2 * EXTRA_PADDING), - EXTRA_PADDING, - ), - ]; + if (this.boundsOptions) { + this.boundsOptions.paddingBottomRight = [ + 0, + Math.max( + Math.min(padding, window.innerHeight - 2 * EXTRA_PADDING), + EXTRA_PADDING, + ), + ]; + } }; render() { @@ -211,7 +213,7 @@ export default class Map extends React.Component { const { config } = this.context; const naviProps = {}; // these define map center and zoom - if (bottomPadding !== undefined) { + if (bottomPadding !== undefined && this.boundsOptions) { this.boundsOptions.paddingBottomRight = [ 0, Math.min(bottomPadding + EXTRA_PADDING, window.innerHeight - 60),