Test for the presence of OpenLayers.Control before attempting to load controls. Makes it possible to run Map.js in the lightweight version.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1595 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-10-05 15:55:47 +00:00
parent deb64d31fe
commit d81c2f0187

View File

@@ -162,8 +162,12 @@ OpenLayers.Map.prototype = {
this.layers = [];
if (this.controls == null) {
this.controls = [ new OpenLayers.Control.MouseDefaults(),
new OpenLayers.Control.PanZoom()];
if (OpenLayers.Control != null) { // running full or lite?
this.controls = [ new OpenLayers.Control.MouseDefaults(),
new OpenLayers.Control.PanZoom()];
} else {
this.controls = [];
}
}
for(var i=0; i < this.controls.length; i++) {