From a111808e062640d1cf6cc001a25997ee35710348 Mon Sep 17 00:00:00 2001 From: fredj Date: Fri, 6 Jan 2012 15:23:05 +0100 Subject: [PATCH] replace Pixel argument with simple object (Map.getLonLatFromPixel) --- lib/OpenLayers/Control/GetFeature.js | 14 ++++++++------ lib/OpenLayers/Control/SelectFeature.js | 14 ++++++++------ lib/OpenLayers/Control/ZoomBox.js | 12 ++++++++---- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/lib/OpenLayers/Control/GetFeature.js b/lib/OpenLayers/Control/GetFeature.js index 650370224c..c16d26b143 100644 --- a/lib/OpenLayers/Control/GetFeature.js +++ b/lib/OpenLayers/Control/GetFeature.js @@ -299,12 +299,14 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, { selectBox: function(position) { var bounds; if (position instanceof OpenLayers.Bounds) { - var minXY = this.map.getLonLatFromPixel( - new OpenLayers.Pixel(position.left, position.bottom) - ); - var maxXY = this.map.getLonLatFromPixel( - new OpenLayers.Pixel(position.right, position.top) - ); + var minXY = this.map.getLonLatFromPixel({ + x: position.left, + y: position.bottom + }); + var maxXY = this.map.getLonLatFromPixel({ + x: position.right, + y: position.top + }); bounds = new OpenLayers.Bounds( minXY.lon, minXY.lat, maxXY.lon, maxXY.lat ); diff --git a/lib/OpenLayers/Control/SelectFeature.js b/lib/OpenLayers/Control/SelectFeature.js index e46f540e18..3c47929feb 100644 --- a/lib/OpenLayers/Control/SelectFeature.js +++ b/lib/OpenLayers/Control/SelectFeature.js @@ -535,12 +535,14 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, { */ selectBox: function(position) { if (position instanceof OpenLayers.Bounds) { - var minXY = this.map.getLonLatFromPixel( - new OpenLayers.Pixel(position.left, position.bottom) - ); - var maxXY = this.map.getLonLatFromPixel( - new OpenLayers.Pixel(position.right, position.top) - ); + var minXY = this.map.getLonLatFromPixel({ + x: position.left, + y: position.bottom + }); + var maxXY = this.map.getLonLatFromPixel({ + x: position.right, + y: position.top + }); var bounds = new OpenLayers.Bounds( minXY.lon, minXY.lat, maxXY.lon, maxXY.lat ); diff --git a/lib/OpenLayers/Control/ZoomBox.js b/lib/OpenLayers/Control/ZoomBox.js index f8f35d51a3..7355916143 100644 --- a/lib/OpenLayers/Control/ZoomBox.js +++ b/lib/OpenLayers/Control/ZoomBox.js @@ -63,10 +63,14 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, { if (position instanceof OpenLayers.Bounds) { var bounds; if (!this.out) { - var minXY = this.map.getLonLatFromPixel( - new OpenLayers.Pixel(position.left, position.bottom)); - var maxXY = this.map.getLonLatFromPixel( - new OpenLayers.Pixel(position.right, position.top)); + var minXY = this.map.getLonLatFromPixel({ + x: position.left, + y: position.bottom + }); + var maxXY = this.map.getLonLatFromPixel({ + x: position.right, + y: position.top + }); bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat, maxXY.lon, maxXY.lat); } else {