Fix render error when using viewState instead of flat props (#632)

This commit is contained in:
Xiaoji Chen 2018-10-24 11:01:01 -07:00 committed by GitHub
parent 90f61ac231
commit db7c380326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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
})),

View File

@ -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
};