replace map.minPx and map.maxPx with simple objects

This commit is contained in:
fredj
2012-01-06 15:17:00 +01:00
committed by Frederic Junod
parent 8ef0ad8c17
commit 69bc0fc772

View File

@@ -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) {