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