diff --git a/src/ui/map.js b/src/ui/map.js index 8bda264935f..bcef97e883d 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -284,8 +284,10 @@ class Map extends Camera { } else { this._container = container; } - } else { + } else if (options.container instanceof HTMLElement) { this._container = options.container; + } else { + throw new Error(`Invalid type: 'container must be a String or HTMLElement'`); } this.animationLoop = new AnimationLoop();