r1005 introduced some infinite recursion. no good. split addControl() into two functions, one public, which adds to internal this.controls arrray... and one private addControlToMap() which does the same, but without adding it to this.controls
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1006 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -154,7 +154,7 @@ OpenLayers.Map.prototype = {
|
||||
|
||||
if (this.controls) {
|
||||
for(var i=0; i < this.controls.length; i++) {
|
||||
this.addControl(this.controls[i]);
|
||||
this.addControlToMap(this.controls[i]);
|
||||
}
|
||||
} else {
|
||||
this.controls = [];
|
||||
@@ -349,8 +349,18 @@ OpenLayers.Map.prototype = {
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*/
|
||||
addControl: function (control, px) {
|
||||
control.setMap(this);
|
||||
this.controls.push(control);
|
||||
this.addControlToMap(control, px);
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {OpenLayers.Control} control
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*/
|
||||
addControlToMap: function (control, px) {
|
||||
control.setMap(this);
|
||||
var div = control.draw(px);
|
||||
if (div) {
|
||||
div.style.zIndex = this.Z_INDEX_BASE['Control'] +
|
||||
@@ -358,7 +368,7 @@ OpenLayers.Map.prototype = {
|
||||
this.viewPortDiv.appendChild( div );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Popup} popup
|
||||
* @param {Boolean} exclusive If true, closes all other popups first
|
||||
|
||||
Reference in New Issue
Block a user