adjusting dx and dy instad of not moving the map at all when we reach the restrictedExtent. p=me,elemoine, r=elemoine (closes #3388)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12158 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-07-06 07:22:31 +00:00
parent 3bdf6ba93e
commit 2809bc30b5
2 changed files with 26 additions and 10 deletions

View File

@@ -1824,6 +1824,26 @@
map.destroy();
}
// test for http://trac.osgeo.org/openlayers/ticket/3388
function test_moveByPx_restrictedExtent(t) {
t.plan(2);
var map = new OpenLayers.Map({
div: 'map',
restrictedExtent: new OpenLayers.Bounds(-22.5,-11.25,22.5,11.25),
layers: [
new OpenLayers.Layer('name', {isBaseLayer: true})
]
});
map.zoomToExtent(new OpenLayers.Bounds(-11.25, 0, 11.25, 11.25));
map.moveByPx(-10, -10);
t.eq(map.layerContainerDiv.style.left, '10px', 'layer container left correct');
t.eq(map.layerContainerDiv.style.top, '0px', 'layer container top correct');
}
</script>
</head>
<body>