bringing all changes from sandbox/euzuro/LayersReworking down into the trunk. this is a merge of r656:HEAD http://svn.openlayers.org/sandbox/euzuro/LayersReworking

git-svn-id: http://svn.openlayers.org/trunk/openlayers@806 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-06-27 23:16:26 +00:00
parent 63bd624827
commit ff0e83d0a0
24 changed files with 1262 additions and 467 deletions
+20 -10
View File
@@ -30,25 +30,35 @@
t.plan( 7 );
var evt = {which: 1}; // control expects left-click
map = new OpenLayers.Map('map');
var layer = new OpenLayers.Layer.WMS("Test Layer",
"http://octo.metacarta.com/cgi-bin/mapserv?",
{map: "/mapdata/vmap_wms.map", layers: "basic"});
map.addLayer(layer);
control = new OpenLayers.Control.PanZoom();
map.addControl(control,
new OpenLayers.Pixel(20,20));
map.setCenter(new OpenLayers.LonLat(0,0), 4);
var res = map.getResolution();
map.addControl(control, new OpenLayers.Pixel(20,20));
var centerLL = new OpenLayers.LonLat(0,0);
map.setCenter(centerLL, 5);
control.buttons[0].onmousedown(evt);
t.eq( map.getCenter().lat, res*50, "Pan up works correctly" );
t.ok( map.getCenter().lat > centerLL.lat, "Pan up works correctly" );
control.buttons[1].onmousedown(evt);
t.eq( map.getCenter().lon, res*-50, "Pan left works correctly" );
t.ok( map.getCenter().lon < centerLL.lon, "Pan left works correctly" );
control.buttons[2].onmousedown(evt);
t.eq( map.getCenter().lon, 0, "Pan right works correctly" );
t.ok( map.getCenter().lon == centerLL.lon, "Pan right works correctly" );
control.buttons[3].onmousedown(evt);
t.eq( map.getCenter().lat, 0, "Pan down works correctly" );
control.buttons[4].onmousedown(evt);
t.ok( map.getCenter().lat == centerLL.lat, "Pan down works correctly" );
control.buttons[4].onmousedown(evt);
t.eq( map.getZoom(), 6, "zoomin works correctly" );
control.buttons[6].onmousedown(evt);
t.eq( map.getZoom(), 5, "zoomout works correctly" );
control.buttons[4].onmousedown(evt);
control.buttons[5].onmousedown(evt);
t.eq( map.getZoom(), 2, "zoomworld works correctly" );