Initialize controls after map has been configured
This commit is contained in:
+8
-8
@@ -185,14 +185,6 @@ ol.Map = function(container, mapOptionsLiteral) {
|
|||||||
*/
|
*/
|
||||||
this.controls_ = mapOptions.controls;
|
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,
|
goog.events.listen(this.controls_, ol.CollectionEventType.ADD,
|
||||||
this.handleControlsAdd_, false, this);
|
this.handleControlsAdd_, false, this);
|
||||||
goog.events.listen(this.controls_, ol.CollectionEventType.REMOVE,
|
goog.events.listen(this.controls_, ol.CollectionEventType.REMOVE,
|
||||||
@@ -225,6 +217,14 @@ ol.Map = function(container, mapOptionsLiteral) {
|
|||||||
|
|
||||||
this.handleBrowserWindowResize();
|
this.handleBrowserWindowResize();
|
||||||
|
|
||||||
|
this.controls_.forEach(
|
||||||
|
/**
|
||||||
|
* @param {ol.control.Control} control Control.
|
||||||
|
*/
|
||||||
|
function(control) {
|
||||||
|
control.setMap(this);
|
||||||
|
}, this);
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.Map, ol.Object);
|
goog.inherits(ol.Map, ol.Object);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user