Turn the pixels into geographic coordinates.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5369 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-12-10 23:01:24 +00:00
parent d72fb3c130
commit 6a1b77b382

View File

@@ -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));
}
});