mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-25 16:02:50 +00:00
fix breakage on node (#292)
This commit is contained in:
parent
f6e75c71e3
commit
5e65c18ee5
@ -102,7 +102,9 @@ export default class StaticMap extends PureComponent {
|
||||
super(props);
|
||||
|
||||
this._queryParams = {};
|
||||
mapboxgl.accessToken = props.mapboxApiAccessToken;
|
||||
if (mapboxgl) {
|
||||
mapboxgl.accessToken = props.mapboxApiAccessToken;
|
||||
}
|
||||
|
||||
if (!StaticMap.supported()) {
|
||||
this.componentDidMount = noop;
|
||||
@ -211,7 +213,9 @@ export default class StaticMap extends PureComponent {
|
||||
}
|
||||
|
||||
_updateStateFromProps(oldProps, newProps) {
|
||||
mapboxgl.accessToken = newProps.mapboxApiAccessToken;
|
||||
if (mapboxgl) {
|
||||
mapboxgl.accessToken = newProps.mapboxApiAccessToken;
|
||||
}
|
||||
}
|
||||
|
||||
// Hover and click only query layers whose interactive property is true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user