From d079f0bbca0dfad0e86961d9be5f5d9acdc26a49 Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 26 Jul 2006 10:01:45 +0000 Subject: [PATCH] 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 --- lib/OpenLayers/Map.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 3e513cd697..23eca09e45 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -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());