From 8a5fb286b6321ee33c48ed3d86eed35c251bf88a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Dub=C3=A9?= Date: Tue, 21 Mar 2017 08:56:32 -0400 Subject: [PATCH] Add writeFilter method to WFS format --- src/ol/format/wfs.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ol/format/wfs.js b/src/ol/format/wfs.js index dcba956592..892fbe7caa 100644 --- a/src/ol/format/wfs.js +++ b/src/ol/format/wfs.js @@ -782,6 +782,21 @@ ol.format.WFS.GETFEATURE_SERIALIZERS_ = { }; +/** + * Encode filter as WFS `Filter` and return the Node. + * + * @param {ol.format.filter.Filter} filter Filter. + * @return {Node} Result. + * @api + */ +ol.format.WFS.writeFilter = function(filter) { + var child = ol.xml.createElementNS(ol.format.WFS.OGCNS, 'Filter'); + var objectStack = []; + ol.format.WFS.writeFilterCondition_(child, filter, objectStack); + return child; +}; + + /** * @param {Node} node Node. * @param {Array.} featureTypes Feature types.