From d96ea1cb979c5ffad7165951f530386293030f33 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 25 Jun 2013 15:29:20 +0200 Subject: [PATCH] Don't invoke interactions if view is not defined --- src/ol/map.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ol/map.js b/src/ol/map.js index eb8632d0f6..75f8519ccd 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -659,6 +659,11 @@ ol.Map.prototype.handleLayersRemove_ = function(collectionEvent) { * @param {ol.MapBrowserEvent} mapBrowserEvent The event to handle. */ ol.Map.prototype.handleMapBrowserEvent = function(mapBrowserEvent) { + if (goog.isNull(this.frameState_)) { + // With no view defined, we cannot translate pixels into geographical + // coordinates so interactions cannot be used. + return; + } mapBrowserEvent.frameState = this.frameState_; var interactions = this.getInteractions(); var interactionsArray = /** @type {Array.} */