From d81c2f0187a32657b3030c256b189f2e912a2993 Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Thu, 5 Oct 2006 15:55:47 +0000 Subject: [PATCH] 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 --- lib/OpenLayers/Map.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 936b613832..d70041b47d 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -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++) {