[OpenLayers-Users] Custom control isn't working properly - how to unregister?

Pascal Ehlert dadark at dadark.de
Thu Nov 22 11:24:57 EST 2007


Hi Eric!

> Your activate() and deactivate() methods should call the parent's  
> methods:
[..]
> In this way, you need not yourself set active to false|true.

Cool, that stuff is working like a charm now. Thank you.


>> Sorry, but this is not working either, it complains that
>> this.map.unregister() does not return an object.
>
> Do you pass the appropriate parameters to unregister()?

Nope, I haven't. My fault, I was not thinking about it and just  
called this.map.unregister().
I've searched the source for it's declaration and found a solution  
for my problem:
	this.map.events.unregister("click", this.map, this.queryHandler);
Works!!


>> That's right, but I want my users _not_ to be able to navigate
>> anymore when my own control is active.
>
> Sorry for misreading your former post! What you probably can do is
> unactivate() the Navigation control.

No problem, but shouldn't the Panel call the deactivate method of  
Control.Navigate when changing controls?
That's at least what it does for my control ;-)



Thank you!

Pascal



More information about the Users mailing list