Changeset 7064
- Timestamp:
- 05/05/08 17:58:28 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/vector-behavior/lib/OpenLayers/Protocol/WFS/v1_0_0.js
r7056 r7064 35 35 }, 36 36 37 /** 38 * Property: params 39 * {Object} Hashtable of key/value parameters 40 */ 41 params: null, 42 37 43 /** 38 44 * Property: defaultPrefix … … 116 122 OpenLayers.Util.applyDefaults(params, this.params); 117 123 118 119 124 var callback = function(request) { 120 125 var features = null; … … 168 173 */ 169 174 commit: function(features) { 175 176 if(!features){ 177 features = this.layer.features; 178 } 179 170 180 var root = this.parser.createElementNSPlus("wfs:Transaction", { 171 attributes: {version: this. VERSION, service: this.service}181 attributes: {version: this.params.VERSION, service: this.params.SERVICE} 172 182 }); 173 183 var method, node; 174 184 for(var i=0; i < features.length; i++) { 175 method = this.getMethod(feature [i]);185 method = this.getMethod(features[i]); 176 186 if(method) { 187 node = method.apply(this,[features[i]]); 177 188 root.appendChild(node); 178 189 } 179 190 } 180 return this.parser.write(root); 191 192 var data = this.parser.write(root); 193 194 new OpenLayers.Ajax.Request(this.url, 195 {method: 'post', 196 postBody: data, 197 onComplete: OpenLayers.Console.log //quick fix 198 }); 181 199 }, 182 200 … … 220 238 221 239 // TODO: this should deal with alt formats 222 node.appendChild(this.layer.format.createFeatureXML(feature) );240 node.appendChild(this.layer.format.createFeatureXML(feature).firstChild); 223 241 224 242 return node; … … 280 298 "delete": function(feature) { 281 299 var node = this.parser.createElementNSPlus("wfs:Delete", { 282 attributes: {typename: this. featureName}300 attributes: {typename: this.params.typename} 283 301 }); 284 302 var filter = this.parser.createElementNSPlus("ogc:Filter");
