replace Pixel argument with simple object (OverviewMap.getLonLatFromOverviewPx)

This commit is contained in:
fredj
2012-01-09 09:59:58 +01:00
committed by Frederic Junod
parent 07e3fa9624
commit 1e6f56fe82

View File

@@ -659,12 +659,14 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
* translated into lon/lat bounds for the overview map
*/
getMapBoundsFromRectBounds: function(pxBounds) {
var leftBottomPx = new OpenLayers.Pixel(pxBounds.left,
pxBounds.bottom);
var rightTopPx = new OpenLayers.Pixel(pxBounds.right,
pxBounds.top);
var leftBottomLonLat = this.getLonLatFromOverviewPx(leftBottomPx);
var rightTopLonLat = this.getLonLatFromOverviewPx(rightTopPx);
var leftBottomLonLat = this.getLonLatFromOverviewPx({
x: pxBounds.left,
y: pxBounds.bottom
});
var rightTopLonLat = this.getLonLatFromOverviewPx({
x: pxBounds.right,
y: pxBounds.top
});
return new OpenLayers.Bounds(leftBottomLonLat.lon, leftBottomLonLat.lat,
rightTopLonLat.lon, rightTopLonLat.lat);
},