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:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user