From 0bf17f64f7f1383d6d5589c9a8c5a792e0707366 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Fri, 28 Sep 2012 13:48:12 +0200 Subject: [PATCH] Initialize controls after map has been configured --- src/ol/map.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ol/map.js b/src/ol/map.js index b667bf470f..18a15bad87 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -185,14 +185,6 @@ ol.Map = function(container, mapOptionsLiteral) { */ this.controls_ = mapOptions.controls; - this.controls_.forEach( - /** - * @param {ol.control.Control} control Control. - */ - function(control) { - control.setMap(this); - }, this); - goog.events.listen(this.controls_, ol.CollectionEventType.ADD, this.handleControlsAdd_, false, this); goog.events.listen(this.controls_, ol.CollectionEventType.REMOVE, @@ -225,6 +217,14 @@ ol.Map = function(container, mapOptionsLiteral) { this.handleBrowserWindowResize(); + this.controls_.forEach( + /** + * @param {ol.control.Control} control Control. + */ + function(control) { + control.setMap(this); + }, this); + }; goog.inherits(ol.Map, ol.Object);