I have previously used the following:
map.events.register("mousemove", map, function(e) {
var position = this.events.getMousePosition(e);
var lonlat = map.getLonLatFromPixel(position);
// A mysterious error is causing OpenLayers to return a non-varying
fraction after a zoom has been made.
// This is removed by toFixed().
OpenLayers.Util.getElement("Easting").innerHTML = lonlat.lon.toFixed(0) +
"<i>m</i>";
OpenLayers.Util.getElement("Northing").innerHTML = lonlat.lat.toFixed(0) +
"<i>m</i>";
});
Regards, Casper
-----Oprindelig meddelelse-----
Fra: [email protected] [mailto:[email protected]] På
vegne af stash
Sendt: 7. december 2009 11:51
Til: [email protected]
Emne: [OpenLayers-Users] Get Coordinates after moving mouse
Hello,
I have a question, which is not so difficult but I can't solve it.
I have mousemove event like this:
map.events.register('mousemove', map, callthis);
now i want to get in my callthis function the coordinates of the position of my
mouse (the coordinates which are displayed in the lower right corner of the
openlayers map).
How do I get them.
can someone help me?
regards
stash
--
View this message in context:
http://n2.nabble.com/Get-Coordinates-after-moving-mouse-tp4125336p4125336.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users