add a map getUnits method, r=ahocevar (Closes 1591)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7374 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
pgiraud
2008-06-18 08:57:02 +00:00
parent 5f42b862ba
commit 4340867918
6 changed files with 37 additions and 4 deletions
+2 -2
View File
@@ -86,8 +86,8 @@
map.addControl(control);
t.eq(control.div.firstChild.style.visibility, "visible", "top scale is present.");
t.eq(control.div.lastChild.style.visibility, "visible", "bottom scale is present.");
t.eq(control.div.firstChild.innerHTML, "20000 km", "top scale has correct text.");
t.eq(control.div.lastChild.innerHTML, "20000 mi", "bottom scale has correct text.");
t.eq(control.div.firstChild.innerHTML, "200 m", "top scale has correct text.");
t.eq(control.div.lastChild.innerHTML, "1000 ft", "bottom scale has correct text.");
map.destroy();
}
+17
View File
@@ -1000,6 +1000,23 @@
layer.destroy();
map.destroy();
}
function test_Map_getUnits(t) {
t.plan(2);
var map = new OpenLayers.Map("map");
var units = map.getUnits();
t.eq(units, null, "getUnits returns null for no base layer");
var layer = new OpenLayers.Layer("test", {
isBaseLayer: true,
units: 'foo'
});
map.addLayer(layer);
var units = map.getUnits();
t.eq(units, 'foo', "getUnits returns the base layer units property");
layer.destroy();
map.destroy();
}
function test_Map_destroy (t) {
t.plan( 3 );