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.