replace map.minPx and map.maxPx with simple objects
This commit is contained in:
@@ -1833,10 +1833,14 @@ OpenLayers.Map = OpenLayers.Class({
|
|||||||
var latDelta = maxExtentCenter.lat - this.center.lat;
|
var latDelta = maxExtentCenter.lat - this.center.lat;
|
||||||
var extentWidth = Math.round(maxExtent.getWidth() / res);
|
var extentWidth = Math.round(maxExtent.getWidth() / res);
|
||||||
var extentHeight = Math.round(maxExtent.getHeight() / res);
|
var extentHeight = Math.round(maxExtent.getHeight() / res);
|
||||||
var left = (this.size.w - extentWidth) / 2 - lonDelta / res;
|
this.minPx = {
|
||||||
var top = (this.size.h - extentHeight) / 2 - latDelta / res;
|
x: (this.size.w - extentWidth) / 2 - lonDelta / res,
|
||||||
this.minPx = new OpenLayers.Pixel(left, top);
|
y: (this.size.h - extentHeight) / 2 - latDelta / res
|
||||||
this.maxPx = new OpenLayers.Pixel(left + extentWidth, top + extentHeight);
|
};
|
||||||
|
this.maxPx = {
|
||||||
|
x: this.minPx.x + Math.round(maxExtent.getWidth() / res),
|
||||||
|
y: this.minPx.y + Math.round(maxExtent.getHeight() / res)
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zoomChanged) {
|
if (zoomChanged) {
|
||||||
|
|||||||
Reference in New Issue
Block a user