From f4deff5f340fb53c07e891f96ea17fa5b4f8d85a Mon Sep 17 00:00:00 2001 From: crschmidt Date: Sun, 16 Sep 2007 16:01:51 +0000 Subject: [PATCH] Add Attribution control to the map by default. (No visual affect if no layers have 'attribution' set.) git-svn-id: http://svn.openlayers.org/trunk/openlayers@4334 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Map.js | 3 ++- tests/test_Map.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 7a4052d728..0090b2a654 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -341,7 +341,8 @@ OpenLayers.Map = OpenLayers.Class({ if (OpenLayers.Control != null) { // running full or lite? this.controls = [ new OpenLayers.Control.Navigation(), new OpenLayers.Control.PanZoom(), - new OpenLayers.Control.ArgParser() + new OpenLayers.Control.ArgParser(), + new OpenLayers.Control.Attribution() ]; } else { this.controls = []; diff --git a/tests/test_Map.html b/tests/test_Map.html index 13370edc87..bdb75455f2 100644 --- a/tests/test_Map.html +++ b/tests/test_Map.html @@ -7,7 +7,7 @@ var map; function test_01_Map_constructor (t) { - t.plan( 9 ); + t.plan( 10 ); map = new OpenLayers.Map('map'); var baseLayer = new OpenLayers.Layer.WMS("Test Layer", @@ -27,6 +27,7 @@ } t.ok( map.layers instanceof Array, "map.layers is an Array" ); t.ok( map.controls instanceof Array, "map.controls is an Array" ); + t.eq( map.controls.length, 4, "Default map has 4 controls." ); t.ok( map.events instanceof OpenLayers.Events, "map.events is an OpenLayers.Events" ); t.ok( map.getMaxExtent() instanceof OpenLayers.Bounds, "map.maxExtent is an OpenLayers.Bounds" ); t.ok( map.getNumZoomLevels() > 0, "map has a default numZoomLevels" );