allow user to specify initial controls via 'controls' array option, instead of simply passing an empty array and then later adding. that seems extraneous

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1005 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-26 10:01:45 +00:00
parent 04a2e9472d
commit d079f0bbca

View File

@@ -152,7 +152,11 @@ OpenLayers.Map.prototype = {
this.layers = [];
if (!this.controls) {
if (this.controls) {
for(var i=0; i < this.controls.length; i++) {
this.addControl(this.controls[i]);
}
} else {
this.controls = [];
this.addControl(new OpenLayers.Control.MouseDefaults());
this.addControl(new OpenLayers.Control.PanZoom());