Refactor setCenter to do most of its work through a smarter function called

moveTo. In moveTo, we also have knowledge of whether the event was fired
through setCenter, allowing us to know the difference between an 'internal'
move and an external one.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6099 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-02-08 13:23:41 +00:00
parent f6fe7d48d3
commit 03a827de4d
2 changed files with 35 additions and 7 deletions

View File

@@ -726,7 +726,7 @@
t.eq( ct, 3, "raiseLayer triggered changelayer the right # of times" );
}
function test_15_Map_setCenter(t) {
function test_15_Map_moveTo(t) {
t.plan(1);
map = new OpenLayers.Map('map');
@@ -736,7 +736,7 @@
{maxResolution: 'auto', maxExtent: new OpenLayers.Bounds(-10,-10,10,10)});
map.addLayer(baseLayer);
var ll = new OpenLayers.LonLat(-100,-150);
map.setCenter(ll, 0);
map.moveTo(ll, 0);
t.ok(map.getCenter().equals(new OpenLayers.LonLat(0,0)), "safely sets out-of-bounds lonlat");
}