[OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

RICHARD Didier didier.richard at ign.fr
Sun Jul 24 07:43:32 EDT 2011


Hi devs,

With 2.10, overloading constructors was as simple as overwriting the
initialize prototype :

X.prototype.initialize= function () { ...}

In 2.11-RC1, it breaks as the new prototype is not the constructor !

This forces to "re-create" the class when overloading its constructor ...

Looking as the test directory, I haven't seen such a feature mentioned and
checked.

Any idea how to proceed "auto-magically" (**)?

BTW, as this new OpenLayers.Class is a major change in OpenLayers, don't
you thing it is more a 3.0 feature than a 2.x ?


didier


(**) by overloading correctly the superclass and its sub-classes too like

    OpenLayers.overload= function(P,F) { ... }

    OpenLayers.Layer= OpenLayers.overload( OpenLayers.Layer, {
        ... // overloaded constructor or methods or properties
    });



More information about the Dev mailing list