From 6a1b77b38223c8110796e2974a09368f5af5c4b9 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 10 Dec 2007 23:01:24 +0000 Subject: [PATCH] Turn the pixels into geographic coordinates. git-svn-id: http://svn.openlayers.org/trunk/openlayers@5369 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/custom-control.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/custom-control.html b/examples/custom-control.html index ae684f05a6..b6f1d58ccc 100644 --- a/examples/custom-control.html +++ b/examples/custom-control.html @@ -33,7 +33,13 @@ }, notice: function (bounds) { - alert(bounds); + console.log(bounds); + var ll = map.getLonLatFromPixel(new OpenLayers.Pixel(bounds.left, bounds.bottom)); + var ur = map.getLonLatFromPixel(new OpenLayers.Pixel(bounds.right, bounds.top)); + alert(ll.lon.toFixed(4) + ", " + + ll.lat.toFixed(4) + ", " + + ur.lon.toFixed(4) + ", " + + ur.lat.toFixed(4)); } });