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
This commit is contained in:
@@ -341,7 +341,8 @@ OpenLayers.Map = OpenLayers.Class({
|
|||||||
if (OpenLayers.Control != null) { // running full or lite?
|
if (OpenLayers.Control != null) { // running full or lite?
|
||||||
this.controls = [ new OpenLayers.Control.Navigation(),
|
this.controls = [ new OpenLayers.Control.Navigation(),
|
||||||
new OpenLayers.Control.PanZoom(),
|
new OpenLayers.Control.PanZoom(),
|
||||||
new OpenLayers.Control.ArgParser()
|
new OpenLayers.Control.ArgParser(),
|
||||||
|
new OpenLayers.Control.Attribution()
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
this.controls = [];
|
this.controls = [];
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
var map;
|
var map;
|
||||||
|
|
||||||
function test_01_Map_constructor (t) {
|
function test_01_Map_constructor (t) {
|
||||||
t.plan( 9 );
|
t.plan( 10 );
|
||||||
|
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map');
|
||||||
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
|
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.layers instanceof Array, "map.layers is an Array" );
|
||||||
t.ok( map.controls instanceof Array, "map.controls 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.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.getMaxExtent() instanceof OpenLayers.Bounds, "map.maxExtent is an OpenLayers.Bounds" );
|
||||||
t.ok( map.getNumZoomLevels() > 0, "map has a default numZoomLevels" );
|
t.ok( map.getNumZoomLevels() > 0, "map has a default numZoomLevels" );
|
||||||
|
|||||||
Reference in New Issue
Block a user