you can create a custom openlayer control ... something like this <br><br><br><br>OpenLayers.Control.<div id=":h1" class="ii gt">ClickLayerInfo = OpenLayers.Class(OpenLayers.Control, {<br> defaultHandlerOptions: {<br> 'single': true,<br>
'double': false,<br> 'pixelTolerance': 0, //tolarance<br> 'stopSingle': false,<br> 'stopDouble': false<br> },<br> initialize: function(options) {<br> this.handlerOptions = OpenLayers.Util.extend(<br>
{}, this.defaultHandlerOptions<br> );<br> OpenLayers.Control.prototype.initialize.apply(<br> this, arguments<br> );<br> this.handler = new OpenLayers.Handler.Click(<br> this, {<br>
'click': this.trigger<br> }, this.handlerOptions<br> );<br> },<br> trigger: function(e) {<br> var lonLat = you_map.getLonLatFromViewPortPx(e.xy);<br> <br> // you cant transform you lat and lon <br>
// you can def a pixel buffer with the map resolution <br> // you can do a asyn call<br> }<br>});<br><br>its work for me !! :-)<br>gretting Rodolfo B.</div><br><br><div class="gmail_quote">2009/12/21 Robert Hicks <span dir="ltr"><<a href="mailto:robhyx@gmail.com">robhyx@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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.<div>
<br></div><div>Thanks!<br clear="all"><br>-- <br>web <a href="http://www.hyxspace.com" target="_blank">http://www.hyxspace.com</a><br>aim hyx1138<br>
</div>
<br>_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@openlayers.org">Dev@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/dev" target="_blank">http://openlayers.org/mailman/listinfo/dev</a><br>
<br></blockquote></div><br>