exit the panTo method if the new center is the same as the current one, r=crschmidt (closes #1507)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7174 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
pgiraud
2008-05-14 08:11:01 +00:00
parent 5e3afa79f5
commit 078deb2ffe

View File

@@ -1375,6 +1375,13 @@ OpenLayers.Map = OpenLayers.Class({
this.panTween = new OpenLayers.Tween(this.panMethod);
}
var center = this.getCenter();
// center will not change, don't do nothing
if (lonlat.lon == center.lon &&
lonlat.lat == center.lat) {
return;
}
var from = {
lon: center.lon,
lat: center.lat