Merge all changes from the naturaldocs sandbox. This brings all the work that
has been done in the NaturalDocs branch back to trunk. Thanks to everyone who helped out in making this happen. (I could list people, but the list would be long, and I'm already mentally on vacation.) git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -3,25 +3,36 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* Read/WRite WFS.
|
||||
* @requires OpenLayers/Format/GML.js
|
||||
*
|
||||
* Class: OpenLayers.Format.WFS
|
||||
* Read/Write WFS.
|
||||
*/
|
||||
OpenLayers.Format.WFS = OpenLayers.Class.create();
|
||||
OpenLayers.Format.WFS.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Format.GML, {
|
||||
|
||||
/**
|
||||
* Property: layer
|
||||
*/
|
||||
layer: null,
|
||||
|
||||
/**
|
||||
* APIProperty: wfsns
|
||||
*/
|
||||
wfsns: "http://www.opengis.net/wfs",
|
||||
|
||||
/*
|
||||
* Constructor: OpenLayers.Format.WFS
|
||||
* Create a WFS-T formatter. This requires a layer: that layer should
|
||||
* have two properties: geometry_column and typename. The parser
|
||||
* for this format is subclassed entirely from GML: There is a writer
|
||||
* only, which uses most of the code from the GML layer, and wraps
|
||||
* it in transactional elements.
|
||||
* @param {Object} options
|
||||
* @param {OpenLayers.Layer} layer
|
||||
*
|
||||
* Parameters:
|
||||
* options - {Object}
|
||||
* layer - {<OpenLayers.Layer>}
|
||||
*/
|
||||
|
||||
initialize: function(options, layer) {
|
||||
@@ -39,10 +50,11 @@ OpenLayers.Format.WFS.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* write
|
||||
* Method: write
|
||||
* Takes a feature list, and generates a WFS-T Transaction
|
||||
*
|
||||
* @param {Array}
|
||||
* Parameters:
|
||||
* features - {Array}
|
||||
*/
|
||||
write: function(features) {
|
||||
|
||||
@@ -64,7 +76,13 @@ OpenLayers.Format.WFS.prototype =
|
||||
}
|
||||
return transaction;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: createFeatureXML
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>}
|
||||
*/
|
||||
createFeatureXML: function(feature) {
|
||||
var geometryNode = this.buildGeometryNode(feature.geometry);
|
||||
var geomContainer = document.createElementNS(this.featureNS, "feature:" + this.geometryName);
|
||||
@@ -85,10 +103,11 @@ OpenLayers.Format.WFS.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* insert
|
||||
* Method: insert
|
||||
* Takes a feature, and generates a WFS-T Transaction "Insert"
|
||||
*
|
||||
* @param {OpenLayers.Feature.Vector} feature
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>}
|
||||
*/
|
||||
insert: function(feature) {
|
||||
var insertNode = document.createElementNS(this.wfsns, 'wfs:Insert');
|
||||
@@ -97,10 +116,11 @@ OpenLayers.Format.WFS.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* update
|
||||
* Method: update
|
||||
* Takes a feature, and generates a WFS-T Transaction "Update"
|
||||
*
|
||||
* @param {OpenLayers.Feature.Vector} feature
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>}
|
||||
*/
|
||||
update: function(feature) {
|
||||
if (!feature.fid) { alert("Can't update a feature for which there is no FID."); }
|
||||
@@ -130,10 +150,11 @@ OpenLayers.Format.WFS.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* delete
|
||||
* Method: remove
|
||||
* Takes a feature, and generates a WFS-T Transaction "Delete"
|
||||
*
|
||||
* @param {OpenLayers.Feature.Vector} feature
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>}
|
||||
*/
|
||||
remove: function(feature) {
|
||||
if (!feature.attributes.fid) {
|
||||
@@ -152,6 +173,10 @@ OpenLayers.Format.WFS.prototype =
|
||||
return deleteNode;
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: destroy
|
||||
* Remove ciruclar ref to layer
|
||||
*/
|
||||
destroy: function() {
|
||||
this.layer = null;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user