[OpenLayers-Dev] Overwriting attributes

Steven Ottens steven at minst.net
Tue Jun 29 07:39:55 EDT 2010


Hi all,

I want to add GML 3.2.1 support to an OpenLayers application but I don't want to modify OpenLayers.js so I want to override two classes (OpenLayers.Format.WFST.v1_1_0 and OpenLayers.Format.WFST.v1) Actually, I only want to add another namespace to v1.namespaces and an extra reader to v1_1_0.readers
I found this thread: http://openlayers.org/pipermail/users/2009-April/011227.html which provide 3 ways to overwrite a class. They're all meant for either overwriting a class or a specific function within that class. The things I want to change, aren't functions so I've tried to overwrite the two classes.
However, due to the way OpenLayers handles WFS/GML with formats, I don't believe I have the option to directly call the new classes instead of the original classes. The two WFST classes are called through a whole series of other classes, which would mean I have to change these as well (right?).

So my question is, if there's an easy way to add the two attributes from outside openlayers.js?

Regards,
Steven






More information about the Dev mailing list