[OpenLayers-Dev] unregister event

Slawomir Messner slawomir.messner at staff.uni-marburg.de
Fri Apr 15 08:35:35 EDT 2011


Hi,
It's a idea, but I don't think you can unregister it. Because of the 
empty string as scope/context object.
You can try:
this.myScope ='';
lyr[0].events.register("featureadded",this.myScope, onFeatureAdded);

lyr[0].events.unregister("featureadded",this.myScope, onFeatureAdded);

You have to use the same object on register as on unregister. "this" has 
to be also the same "this".
When you try
lyr[0].events.unregister("featureadded",'', onFeatureAdded);
Then a new string object is created.
Regards
Slawomir


Am 15.04.2011 14:19, schrieb Mohammed Rashad:
> how to unregister an event registered as
>
>
> lyr[0].events.register("featureadded",'', onFeatureAdded);
>
> -- 
> Thanks && Regards
> Rashad
>
>
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20110415/c6c24339/attachment.html


More information about the Dev mailing list