Initialize controls after map has been configured

This commit is contained in:
Tom Payne
2012-09-28 13:48:12 +02:00
parent e3cef24f5f
commit 0bf17f64f7

View File

@@ -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);