[OpenLayers-Users] Get lat/lon from user click?

Robert Sanson SansonR at asurequality.com
Mon Dec 21 15:01:20 EST 2009


Hi Robert
 
map.events.register('click', map, function (e) {
                  var xys = map.getLonLatFromViewPortPx(e.xy);
                  var easting = xys.lon;
                  var northing = xys.lat;
                  Event.stop(e);
                });
Cheers,
 
Robert
>>> Robert Hicks <robhyx at gmail.com> 22/12/2009 8:57 a.m. >>>
Hey all, is there a way to get the coordinates of a point on the map that a user has just clicked on? I see Mouse-position displays the coordinates at the bottom of the screen, and I also see you can register muliple mouse events to te map, but I need to store coordinates in a javascript var to send in a request to my server.

Thanks!

-- 
web http://www.hyxspace.com 
aim hyx1138



Click here ( https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg== ) to report this email as spam.
------------------------------------------------------------------
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
------------------------------------------------------------------


This message has been scanned for malware by SurfControl plc. www.surfcontrol.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091222/1135710d/attachment.html


More information about the Users mailing list