diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index c2f6e84e42..7b37e3761e 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -339,8 +339,8 @@ OpenLayers.Bounds.prototype = { * @type OpenLayers.Pixel */ getCenterPixel:function() { - return new OpenLayers.Pixel(this.left + (this.getWidth() / 2), - this.bottom + (this.getHeight() / 2)); + return new OpenLayers.Pixel( (this.left + this.right) / 2, + (this.bottom + this.top) / 2); }, /** @@ -348,8 +348,8 @@ OpenLayers.Bounds.prototype = { * @type OpenLayers.LonLat */ getCenterLonLat:function() { - return new OpenLayers.LonLat(this.left + (this.getWidth() / 2), - this.bottom + (this.getHeight() / 2)); + return new OpenLayers.LonLat( (this.left + this.right) / 2, + (this.bottom + this.top) / 2); }, /**