[OpenLayers-Dev] get the map that caused the event

Juan G juangon at gmail.com
Tue Jun 24 10:26:06 EDT 2008


When you use the map.event.register, I think the "map" object is passed as
context variable. So in the "onClick" function you have it in "this.map". In
the register function you can also bind more variables to that function.
There are many examples about that..





2008/6/24 Paul Spencer <pspencer at dmsolutions.ca>:

> Hi Dan,
>
> I would recommend that you use firefox with the firebug extension for
> this kind of work as firebug allows you to set breakpoints in code and
> then inspect objects quite completely.  In this case, you can set a
> breakpoint inside the function and look at the evt object to see what
> it contains - and would find what you need reasonably quickly along
> with lots of other useful information.
>
> Cheers
>
> Paul
>
> On 24-Jun-08, at 6:00 AM, Darko Radiceski wrote:
>
> > Dear all,
> >
> > Is it possible to get the name of the map that fired the cliecked
> > event?
> >
> > I can get
> >
> > onClick:
> >
> > function(evt) {
> >
> > var output = document.getElementById(this.key + "Output");
> >
> > var msg = "click " + evt.xy;
> > output.value = output.value + msg +
> >
> > "\r\n";
> > },
> >
> > the x and y but how about the map name? or maybe div id?
> >
> >
> > Cheers
> >
> > Dan
> >
> >
> >
> > --
> > Radiceski Dan
> > University of Wollongong
> > Australia
> > SIFE - UOW Chapter - Alumni
> > CASUAL ACADEMIC STAFF TEACHING - UOW SITACS
> > (School of Information Technology and Computer Science,University of
> > Wollongong)
> > Univeristy of Wollongong - Alumni
> > _______________________________________________
> > Dev mailing list
> > Dev at openlayers.org
> > http://openlayers.org/mailman/listinfo/dev
>
>
> __________________________________________
>
>    Paul Spencer
>    Chief Technology Officer
>    DM Solutions Group Inc
>    http://www.dmsolutions.ca/
>
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



-- 
Un saludo,

Juan Gonzalez del Pino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20080624/bb97bbf4/attachment.html


More information about the Dev mailing list