[OpenLayers-Dev] new class style

Tim Schaub noreply at geocartic.com
Mon Jul 16 19:15:04 EDT 2007


As of revision 3767[1], we'll be using a new syntax for class definitions.

Old syntax:

     var MyClass = OpenLayers.Class.create();
     MyClass.prototype = OpenLayers.Class.inherit(BaseClass, {
         // class def here
     });

New syntax:

     var MyClass = OpenLayers.Class(BaseClass, {
         // class def here
     });

Until 3.0, you can use the create and inherit methods - and old style 
classes can inherit from new style classes.  After 3.0, only the new 
syntax will be supported.  With this change, all classes in the library 
use the new syntax.

Tim

[1] http://trac.openlayers.org/changeset/3767



More information about the Dev mailing list