On Sat, Jan 22, 2011 at 4:36 AM, Planet)x <[email protected]> wrote:
>
> I have a GetFeatureInfo control which I declare then in myfeature.events.on I
> code the event. My question is I am trying to use this same control again
> but with a different layer this time so I modify the events.on by redefining
> it.. however it is still firing the first events.on. So do I have to
> unregister the first event.. and if so how to do that.. is it simply
> following the events object listed here -
> http://dev.openlayers.org/docs/files/OpenLayers/Events-js.html
> and using myfeature.unregister(myfeature.events.on) .. or how ? Appreciate
> any assistance.

I'm not sure I understand your issue, if you can unregister listeners using

control.events.un({"eventname": callback_reference});

For example:

function cb() {};
control.events.on({"eventname": cb});
control.events.un({"eventname": cb});

You need to keep references on callbacks you want to eventually unregister.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to