Adding a WFS protocol. This allows for creating, reading, updating, and deleting features via WFS. Huge thanks to ahocevar for the test writing and review. r=ahocevar (closes #1648)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@8868 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* @requires OpenLayers/Protocol.js
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function: OpenLayers.Protocol.WFS
|
||||
* Used to create a versioned WFS protocol. Default version is 1.0.0.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Protocol>} A WFS protocol of the given version.
|
||||
*/
|
||||
OpenLayers.Protocol.WFS = function(options) {
|
||||
options = OpenLayers.Util.applyDefaults(
|
||||
options, OpenLayers.Protocol.WFS.DEFAULTS
|
||||
);
|
||||
var cls = OpenLayers.Protocol.WFS["v"+options.version.replace(/\./g, "_")];
|
||||
if(!cls) {
|
||||
throw "Unsupported WFS version: " + options.version;
|
||||
}
|
||||
return new cls(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constant: OpenLayers.Protocol.WFS.DEFAULTS
|
||||
*/
|
||||
OpenLayers.Protocol.WFS.DEFAULTS = {
|
||||
"version": "1.0.0"
|
||||
};
|
||||
Reference in New Issue
Block a user