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

Pascal Ehlert dadark at dadark.de
Wed Nov 21 08:55:18 EST 2007


Hi Eric!

First of all, thank you for your answer, I haven't expected it anymore.

> You'd also need to declare your control using something like that:
>
> OpenLayers.Control.ODAQuery = OpenLayers.Class(OpenLayers.Control, {
>     initialize: function(options) {
>         OpenLayers.Control.prototype.initialize.apply(this,  
> [options]);
>     },
>
>     CLASS_NAME: "OpenLayers.Control.ODAQuery"
> });

Okay, I've done that and it looks much cleaner!
Unfortunately it is still no applying the ItemsActive appendix to the  
css class name, but I
fixed it by setting this.active manually in both, my activate and  
deactivate methods.


> Your class should override the unactivate() method and call
> this.map.unregister() from this method.

Sorry, but this is not working either, it complains that  
this.map.unregister() does not return an object.

> Hmm, if you register a callback for the click event only, you should
> still be able to navigate. Go back to us with examples if that doesn't
> work.

That's right, but I want my users _not_ to be able to navigate  
anymore when my own control is active.

I hope someone can help me with sorting out the last problems as well.


Regards

Pascal Ehlert






More information about the Users mailing list