diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index fe374d9bae..92f5a02da5 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -1833,10 +1833,14 @@ OpenLayers.Map = OpenLayers.Class({ var latDelta = maxExtentCenter.lat - this.center.lat; var extentWidth = Math.round(maxExtent.getWidth() / res); var extentHeight = Math.round(maxExtent.getHeight() / res); - var left = (this.size.w - extentWidth) / 2 - lonDelta / res; - var top = (this.size.h - extentHeight) / 2 - latDelta / res; - this.minPx = new OpenLayers.Pixel(left, top); - this.maxPx = new OpenLayers.Pixel(left + extentWidth, top + extentHeight); + this.minPx = { + x: (this.size.w - extentWidth) / 2 - lonDelta / res, + y: (this.size.h - extentHeight) / 2 - latDelta / res + }; + this.maxPx = { + x: this.minPx.x + Math.round(maxExtent.getWidth() / res), + y: this.minPx.y + Math.round(maxExtent.getHeight() / res) + }; } if (zoomChanged) {