check that context.map exists (#974)

This commit is contained in:
Xiaoji Chen 2020-01-02 11:22:10 -08:00 committed by GitHub
parent 28f0b6e01a
commit ed7d8df842
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,9 @@ export default class NavigationControl extends BaseControl<
const {className, showCompass, showZoom, zoomInLabel, zoomOutLabel, compassLabel} = this.props;
if (!this._uiVersion) {
this._uiVersion = getUIVersion(this._context.map.version);
// map may not exist if context is provided by user application (e.g. DeckGL)
const {map} = this._context;
this._uiVersion = getUIVersion(map && map.version);
}
return (