From db7c380326393dead667ddebb944faee30e07973 Mon Sep 17 00:00:00 2001 From: Xiaoji Chen Date: Wed, 24 Oct 2018 11:01:01 -0700 Subject: [PATCH] Fix render error when using `viewState` instead of flat props (#632) --- src/components/static-map.js | 2 +- src/index.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/static-map.js b/src/components/static-map.js index 726aa9c2..4a49f861 100644 --- a/src/components/static-map.js +++ b/src/components/static-map.js @@ -216,7 +216,7 @@ export default class StaticMap extends PureComponent { this._updateMapSize(width, height); const staticContext = { - viewport: new WebMercatorViewport(Object.assign({}, this.props, { + viewport: new WebMercatorViewport(Object.assign({}, this.props, this.props.viewState, { width, height })), diff --git a/src/index.js b/src/index.js index 19e808c3..1e94b9d2 100644 --- a/src/index.js +++ b/src/index.js @@ -45,7 +45,9 @@ export { // Experimental Features (May change in minor version bumps, use at your own risk) import MapControls from './utils/map-controls'; +import {StaticContext} from './components/static-map'; export const experimental = { - MapControls + MapControls, + MapContext: StaticContext };