diff --git a/lib/OpenLayers/BaseTypes/Bounds.js b/lib/OpenLayers/BaseTypes/Bounds.js index e416bdc5cf..b6717ae517 100644 --- a/lib/OpenLayers/BaseTypes/Bounds.js +++ b/lib/OpenLayers/BaseTypes/Bounds.js @@ -302,9 +302,9 @@ OpenLayers.Bounds = OpenLayers.Class({ * object - {Object} Can be LonLat, Point, or Bounds */ extend:function(object) { + var bounds = null; if (object) { // clear cached center location - this.centerLonLat = null; switch(object.CLASS_NAME) { case "OpenLayers.LonLat": bounds = new OpenLayers.Bounds(object.lon, object.lat, @@ -321,7 +321,7 @@ OpenLayers.Bounds = OpenLayers.Class({ } if (bounds) { - var bounds = null; + this.centerLonLat = null; if ( (this.left == null) || (bounds.left < this.left)) { this.left = bounds.left; }