Wrap values in <Literal>

This commit is contained in:
tsauerwein
2016-08-29 09:34:52 +02:00
parent 784be4099e
commit 7128e86e3c
2 changed files with 10 additions and 4 deletions

View File

@@ -667,8 +667,14 @@ ol.format.WFS.writeIsNullFilter_ = function(node, filter, objectStack) {
*/ */
ol.format.WFS.writeIsBetweenFilter_ = function(node, filter, objectStack) { ol.format.WFS.writeIsBetweenFilter_ = function(node, filter, objectStack) {
ol.format.WFS.writeOgcPropertyName_(node, filter.propertyName); ol.format.WFS.writeOgcPropertyName_(node, filter.propertyName);
ol.format.WFS.writeOgcExpression_('LowerBoundary', node, '' + filter.lowerBoundary);
ol.format.WFS.writeOgcExpression_('UpperBoundary', node, '' + filter.upperBoundary); var lowerBoundary = ol.xml.createElementNS('http://www.opengis.net/ogc', 'LowerBoundary');
node.appendChild(lowerBoundary);
ol.format.WFS.writeOgcLiteral_(lowerBoundary, '' + filter.lowerBoundary);
var upperBoundary = ol.xml.createElementNS('http://www.opengis.net/ogc', 'UpperBoundary');
node.appendChild(upperBoundary);
ol.format.WFS.writeOgcLiteral_(upperBoundary, '' + filter.upperBoundary);
}; };

View File

@@ -369,8 +369,8 @@ describe('ol.format.WFS', function() {
' <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">' + ' <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">' +
' <ogc:PropertyIsBetween>' + ' <ogc:PropertyIsBetween>' +
' <ogc:PropertyName>area</ogc:PropertyName>' + ' <ogc:PropertyName>area</ogc:PropertyName>' +
' <ogc:LowerBoundary>100</ogc:LowerBoundary>' + ' <ogc:LowerBoundary><ogc:Literal>100</ogc:Literal></ogc:LowerBoundary>' +
' <ogc:UpperBoundary>1000</ogc:UpperBoundary>' + ' <ogc:UpperBoundary><ogc:Literal>1000</ogc:Literal></ogc:UpperBoundary>' +
' </ogc:PropertyIsBetween>' + ' </ogc:PropertyIsBetween>' +
' </ogc:Filter>' + ' </ogc:Filter>' +
'</wfs:Query>'; '</wfs:Query>';