From ed7d8df84277759ddafeb8f19004aba8889ef643 Mon Sep 17 00:00:00 2001 From: Xiaoji Chen Date: Thu, 2 Jan 2020 11:22:10 -0800 Subject: [PATCH] check that context.map exists (#974) --- src/components/navigation-control.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/navigation-control.js b/src/components/navigation-control.js index 615a5729..893a71e8 100644 --- a/src/components/navigation-control.js +++ b/src/components/navigation-control.js @@ -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 (