Great, thanks everyone! I got what I needed and it works great!
On Mon, Dec 21, 2009 at 3:43 PM, Rodolfo Barriga
<[email protected]>wrote:
> you can create a custom openlayer control ... something like this
>
>
>
> OpenLayers.Control.
> ClickLayerInfo = OpenLayers.Class(OpenLayers.Control, {
> defaultHandlerOptions: {
> 'single': true,
> 'double': false,
> 'pixelTolerance': 0, //tolarance
> 'stopSingle': false,
> 'stopDouble': false
> },
> initialize: function(options) {
> this.handlerOptions = OpenLayers.Util.extend(
> {}, this.defaultHandlerOptions
> );
> OpenLayers.Control.prototype.initialize.apply(
> this, arguments
> );
> this.handler = new OpenLayers.Handler.Click(
> this, {
> 'click': this.trigger
> }, this.handlerOptions
> );
> },
> trigger: function(e) {
> var lonLat = you_map.getLonLatFromViewPortPx(e.xy);
>
> // you cant transform you lat and lon
> // you can def a pixel buffer with the map resolution
> // you can do a asyn call
> }
> });
>
> its work for me !! :-)
> gretting Rodolfo B.
>
>
> 2009/12/21 Robert Hicks <[email protected]>
>
>> 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
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://openlayers.org/mailman/listinfo/dev
>>
>>
>
--
web http://www.hyxspace.com
aim hyx1138
_______________________________________________
Dev mailing list
[email protected]
http://openlayers.org/mailman/listinfo/dev