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:
@@ -33,7 +33,13 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
notice: function (bounds) {
|
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));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user