Merge pull request #524 from ahocevar/panzoombar

Zoom level restriction improvements. r=@bartvde
This commit is contained in:
ahocevar
2012-06-22 16:59:13 -07:00
4 changed files with 77 additions and 19 deletions

View File

@@ -33,6 +33,31 @@
map.addControl(control2, new OpenLayers.Pixel(100,100));
t.eq( control2.div.style.top, "100px", "2nd control div is located correctly");
}
function test_draw(t) {
t.plan(3);
map = new OpenLayers.Map('map', {controls:[]});
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);
map.zoomToMaxExtent();
control = new OpenLayers.Control.PanZoomBar();
map.addControl(control);
t.eq(control.zoombarDiv.style.height, '176px', "Bar's height is correct.");
map.baseLayer.wrapDateLine = true;
control.redraw();
t.eq(control.zoombarDiv.style.height, '154px', "Bar's height is correct after minZoom restriction.");
map.div.style.width = "512px";
map.updateSize();
t.eq(control.zoombarDiv.style.height, '165px', "Bar's height is correct after resize and minZoom restriction.");
map.div.style.width = "1024px";
map.destroy();
}
function test_Control_PanZoomBar_clearDiv(t) {
t.plan(2);