Test that setcenter creates a latlon, and that the values are equal to what we expect. (This would break if we ever

changed the order of LatLon's args, for example.)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@20 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-12 23:28:56 +00:00
parent f2fa6622f1
commit 768f800430

View File

@@ -18,9 +18,12 @@
t.ok( map.events instanceof OpenLayers.Events, "map.events is an OpenLayers.Events" );
}
function test_2_Map_center(t) {
t.plan(1);
map.setCenter(new OpenLayers.LatLon(0,0), 0);
t.plan(4);
map.setCenter(new OpenLayers.LatLon(1,2), 3);
t.ok( map.getCenter() instanceof OpenLayers.LatLon, "map.getCenter returns a LatLon");
t.eq( map.getZoom(), 3, "map.zoom is correct after calling setCenter");
t.eq( map.getCenter().lat, 1, "map center lat is correct after calling setCenter");
t.eq( map.getCenter().lon, 2, "map center lon is correct after calling setCenter");
}
function test_99_Map_destroy (t) {
t.plan( 2 );