]> dev.renevier.net Git - syp.git/blob - openlayers/lib/OpenLayers/Format/WFST.js
initial commit
[syp.git] / openlayers / lib / OpenLayers / Format / WFST.js
1 /* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
2  * license.  See http://svn.openlayers.org/trunk/openlayers/license.txt for the
3  * full text of the license. */
4
5 /**
6  * @requires OpenLayers/Format.js
7  */
8
9 /**
10  * Function: OpenLayers.Format.WFST
11  * Used to create a versioned WFS protocol.  Default version is 1.0.0.
12  *
13  * Returns:
14  * {<OpenLayers.Format>} A WFST format of the given version.
15  */
16 OpenLayers.Format.WFST = function(options) {
17     options = OpenLayers.Util.applyDefaults(
18         options, OpenLayers.Format.WFST.DEFAULTS
19     );
20     var cls = OpenLayers.Format.WFST["v"+options.version.replace(/\./g, "_")];
21     if(!cls) {
22         throw "Unsupported WFST version: " + options.version;
23     }
24     return new cls(options);
25 };
26
27 /**
28  * Constant: OpenLayers.Format.WFST.DEFAULTS
29  * {Object} Default properties for the WFST format.
30  */
31 OpenLayers.Format.WFST.DEFAULTS = {
32     "version": "1.0.0"
33 };