[OpenLayers-Users] Retrieve coordinates from a map

Brent Pedersen bpederse at gmail.com
Sat Nov 18 20:58:08 EST 2006


hi, i just did this yesterday like this (thanks crschmidt) :

OpenLayers.Event.observe($('map'),"click",mapclicked.bindAsEventListener(map));

function mapclicked(e){
            var LL = this.getLonLatFromPixel(e.xy)
            //console.debug(LL)
            alert(LL.lon + "," + LL.lat)
}



On 11/18/06, Christian López Espínola <penyaskito at gmail.com> wrote:
>
> http://openlayers.org/dev/examples/controls.html
>
> On 11/15/06, Jacopo Boari <jacopo.boari at sysgroup.it> wrote:
> >
> >
> >
> >
> > Hi Everybody,
> >
> >
> >
> > How can I retrive the cursor's position in the map?
> >
> >
> >
> > There's a method that return the coordinates?
> >
> >
> >
> > Thanks in advance
> >
> >
> >
> >
> >
> > Jacopo Boari
> >
> >  Sysgroup srl - Lungo Dora Colletta 113/14 - 10153 Torino
> >  tel 0112440983   fax 0112406561
> >  e-mail jacopo.boari at sysgroup.it           www.sysgroup.it
> >
> >
> > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> >
> >
> >
>
>
> --
> Christian López Espínola
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20061118/4aef9488/attachment.html


More information about the Users mailing list