Merge pull request #7772 from marcjansen/named-filter-exports

Named exports from filter module
This commit is contained in:
Marc Jansen
2018-02-07 07:15:14 +01:00
committed by GitHub
4 changed files with 124 additions and 105 deletions
+8 -4
View File
@@ -1,6 +1,10 @@
import Map from '../src/ol/Map.js'; import Map from '../src/ol/Map.js';
import View from '../src/ol/View.js'; import View from '../src/ol/View.js';
import _ol_format_filter_ from '../src/ol/format/filter.js'; import {
equalTo as equalToFilter,
like as likeFilter,
and as andFilter
} from '../src/ol/format/filter.js';
import WFS from '../src/ol/format/WFS.js'; import WFS from '../src/ol/format/WFS.js';
import GeoJSON from '../src/ol/format/GeoJSON.js'; import GeoJSON from '../src/ol/format/GeoJSON.js';
import TileLayer from '../src/ol/layer/Tile.js'; import TileLayer from '../src/ol/layer/Tile.js';
@@ -46,9 +50,9 @@ const featureRequest = new WFS().writeGetFeature({
featurePrefix: 'osm', featurePrefix: 'osm',
featureTypes: ['water_areas'], featureTypes: ['water_areas'],
outputFormat: 'application/json', outputFormat: 'application/json',
filter: _ol_format_filter_.and( filter: andFilter(
_ol_format_filter_.like('name', 'Mississippi*'), likeFilter('name', 'Mississippi*'),
_ol_format_filter_.equalTo('waterway', 'riverbank') equalToFilter('waterway', 'riverbank')
) )
}); });
+3 -3
View File
@@ -6,7 +6,7 @@ import {assert} from '../asserts.js';
import GML2 from '../format/GML2.js'; import GML2 from '../format/GML2.js';
import GML3 from '../format/GML3.js'; import GML3 from '../format/GML3.js';
import GMLBase from '../format/GMLBase.js'; import GMLBase from '../format/GMLBase.js';
import _ol_format_filter_ from '../format/filter.js'; import {and as andFilter, bbox as bboxFilter} from '../format/filter.js';
import XMLFeature from '../format/XMLFeature.js'; import XMLFeature from '../format/XMLFeature.js';
import XSD from '../format/XSD.js'; import XSD from '../format/XSD.js';
import Geometry from '../geom/Geometry.js'; import Geometry from '../geom/Geometry.js';
@@ -959,11 +959,11 @@ WFS.prototype.writeGetFeature = function(options) {
if (options.bbox) { if (options.bbox) {
assert(options.geometryName, assert(options.geometryName,
12); // `options.geometryName` must also be provided when `options.bbox` is set 12); // `options.geometryName` must also be provided when `options.bbox` is set
const bbox = _ol_format_filter_.bbox( const bbox = bboxFilter(
/** @type {string} */ (options.geometryName), options.bbox, options.srsName); /** @type {string} */ (options.geometryName), options.bbox, options.srsName);
if (filter) { if (filter) {
// if bbox and filter are both set, combine the two into a single filter // if bbox and filter are both set, combine the two into a single filter
filter = _ol_format_filter_.and(filter, bbox); filter = andFilter(filter, bbox);
} else { } else {
filter = bbox; filter = bbox;
} }
+68 -70
View File
@@ -1,24 +1,23 @@
/** /**
* @module ol/format/filter * @module ol/format/filter
*/ */
import _ol_format_filter_And_ from '../format/filter/And.js'; import And from '../format/filter/And.js';
import _ol_format_filter_Bbox_ from '../format/filter/Bbox.js'; import Bbox from '../format/filter/Bbox.js';
import _ol_format_filter_Contains_ from '../format/filter/Contains.js'; import Contains from '../format/filter/Contains.js';
import _ol_format_filter_During_ from '../format/filter/During.js'; import During from '../format/filter/During.js';
import _ol_format_filter_EqualTo_ from '../format/filter/EqualTo.js'; import EqualTo from '../format/filter/EqualTo.js';
import _ol_format_filter_GreaterThan_ from '../format/filter/GreaterThan.js'; import GreaterThan from '../format/filter/GreaterThan.js';
import _ol_format_filter_GreaterThanOrEqualTo_ from '../format/filter/GreaterThanOrEqualTo.js'; import GreaterThanOrEqualTo from '../format/filter/GreaterThanOrEqualTo.js';
import _ol_format_filter_Intersects_ from '../format/filter/Intersects.js'; import Intersects from '../format/filter/Intersects.js';
import _ol_format_filter_IsBetween_ from '../format/filter/IsBetween.js'; import IsBetween from '../format/filter/IsBetween.js';
import _ol_format_filter_IsLike_ from '../format/filter/IsLike.js'; import IsLike from '../format/filter/IsLike.js';
import _ol_format_filter_IsNull_ from '../format/filter/IsNull.js'; import IsNull from '../format/filter/IsNull.js';
import _ol_format_filter_LessThan_ from '../format/filter/LessThan.js'; import LessThan from '../format/filter/LessThan.js';
import _ol_format_filter_LessThanOrEqualTo_ from '../format/filter/LessThanOrEqualTo.js'; import LessThanOrEqualTo from '../format/filter/LessThanOrEqualTo.js';
import _ol_format_filter_Not_ from '../format/filter/Not.js'; import Not from '../format/filter/Not.js';
import _ol_format_filter_NotEqualTo_ from '../format/filter/NotEqualTo.js'; import NotEqualTo from '../format/filter/NotEqualTo.js';
import _ol_format_filter_Or_ from '../format/filter/Or.js'; import Or from '../format/filter/Or.js';
import _ol_format_filter_Within_ from '../format/filter/Within.js'; import Within from '../format/filter/Within.js';
const _ol_format_filter_ = {};
/** /**
@@ -28,10 +27,10 @@ const _ol_format_filter_ = {};
* @returns {!ol.format.filter.And} `<And>` operator. * @returns {!ol.format.filter.And} `<And>` operator.
* @api * @api
*/ */
_ol_format_filter_.and = function(conditions) { export function and(conditions) {
const params = [null].concat(Array.prototype.slice.call(arguments)); const params = [null].concat(Array.prototype.slice.call(arguments));
return new (Function.prototype.bind.apply(_ol_format_filter_And_, params)); return new (Function.prototype.bind.apply(And, params));
}; }
/** /**
@@ -41,10 +40,10 @@ _ol_format_filter_.and = function(conditions) {
* @returns {!ol.format.filter.Or} `<Or>` operator. * @returns {!ol.format.filter.Or} `<Or>` operator.
* @api * @api
*/ */
_ol_format_filter_.or = function(conditions) { export function or(conditions) {
const params = [null].concat(Array.prototype.slice.call(arguments)); const params = [null].concat(Array.prototype.slice.call(arguments));
return new (Function.prototype.bind.apply(_ol_format_filter_Or_, params)); return new (Function.prototype.bind.apply(Or, params));
}; }
/** /**
@@ -54,9 +53,9 @@ _ol_format_filter_.or = function(conditions) {
* @returns {!ol.format.filter.Not} `<Not>` operator. * @returns {!ol.format.filter.Not} `<Not>` operator.
* @api * @api
*/ */
_ol_format_filter_.not = function(condition) { export function not(condition) {
return new _ol_format_filter_Not_(condition); return new Not(condition);
}; }
/** /**
@@ -70,9 +69,9 @@ _ol_format_filter_.not = function(condition) {
* @returns {!ol.format.filter.Bbox} `<BBOX>` operator. * @returns {!ol.format.filter.Bbox} `<BBOX>` operator.
* @api * @api
*/ */
_ol_format_filter_.bbox = function(geometryName, extent, opt_srsName) { export function bbox(geometryName, extent, opt_srsName) {
return new _ol_format_filter_Bbox_(geometryName, extent, opt_srsName); return new Bbox(geometryName, extent, opt_srsName);
}; }
/** /**
* Create a `<Contains>` operator to test whether a geometry-valued property * Create a `<Contains>` operator to test whether a geometry-valued property
@@ -85,9 +84,9 @@ _ol_format_filter_.bbox = function(geometryName, extent, opt_srsName) {
* @returns {!ol.format.filter.Contains} `<Contains>` operator. * @returns {!ol.format.filter.Contains} `<Contains>` operator.
* @api * @api
*/ */
_ol_format_filter_.contains = function(geometryName, geometry, opt_srsName) { export function contains(geometryName, geometry, opt_srsName) {
return new _ol_format_filter_Contains_(geometryName, geometry, opt_srsName); return new Contains(geometryName, geometry, opt_srsName);
}; }
/** /**
* Create a `<Intersects>` operator to test whether a geometry-valued property * Create a `<Intersects>` operator to test whether a geometry-valued property
@@ -100,9 +99,9 @@ _ol_format_filter_.contains = function(geometryName, geometry, opt_srsName) {
* @returns {!ol.format.filter.Intersects} `<Intersects>` operator. * @returns {!ol.format.filter.Intersects} `<Intersects>` operator.
* @api * @api
*/ */
_ol_format_filter_.intersects = function(geometryName, geometry, opt_srsName) { export function intersects(geometryName, geometry, opt_srsName) {
return new _ol_format_filter_Intersects_(geometryName, geometry, opt_srsName); return new Intersects(geometryName, geometry, opt_srsName);
}; }
/** /**
* Create a `<Within>` operator to test whether a geometry-valued property * Create a `<Within>` operator to test whether a geometry-valued property
@@ -115,9 +114,9 @@ _ol_format_filter_.intersects = function(geometryName, geometry, opt_srsName) {
* @returns {!ol.format.filter.Within} `<Within>` operator. * @returns {!ol.format.filter.Within} `<Within>` operator.
* @api * @api
*/ */
_ol_format_filter_.within = function(geometryName, geometry, opt_srsName) { export function within(geometryName, geometry, opt_srsName) {
return new _ol_format_filter_Within_(geometryName, geometry, opt_srsName); return new Within(geometryName, geometry, opt_srsName);
}; }
/** /**
@@ -129,9 +128,9 @@ _ol_format_filter_.within = function(geometryName, geometry, opt_srsName) {
* @returns {!ol.format.filter.EqualTo} `<PropertyIsEqualTo>` operator. * @returns {!ol.format.filter.EqualTo} `<PropertyIsEqualTo>` operator.
* @api * @api
*/ */
_ol_format_filter_.equalTo = function(propertyName, expression, opt_matchCase) { export function equalTo(propertyName, expression, opt_matchCase) {
return new _ol_format_filter_EqualTo_(propertyName, expression, opt_matchCase); return new EqualTo(propertyName, expression, opt_matchCase);
}; }
/** /**
@@ -143,9 +142,9 @@ _ol_format_filter_.equalTo = function(propertyName, expression, opt_matchCase) {
* @returns {!ol.format.filter.NotEqualTo} `<PropertyIsNotEqualTo>` operator. * @returns {!ol.format.filter.NotEqualTo} `<PropertyIsNotEqualTo>` operator.
* @api * @api
*/ */
_ol_format_filter_.notEqualTo = function(propertyName, expression, opt_matchCase) { export function notEqualTo(propertyName, expression, opt_matchCase) {
return new _ol_format_filter_NotEqualTo_(propertyName, expression, opt_matchCase); return new NotEqualTo(propertyName, expression, opt_matchCase);
}; }
/** /**
@@ -156,9 +155,9 @@ _ol_format_filter_.notEqualTo = function(propertyName, expression, opt_matchCase
* @returns {!ol.format.filter.LessThan} `<PropertyIsLessThan>` operator. * @returns {!ol.format.filter.LessThan} `<PropertyIsLessThan>` operator.
* @api * @api
*/ */
_ol_format_filter_.lessThan = function(propertyName, expression) { export function lessThan(propertyName, expression) {
return new _ol_format_filter_LessThan_(propertyName, expression); return new LessThan(propertyName, expression);
}; }
/** /**
@@ -169,9 +168,9 @@ _ol_format_filter_.lessThan = function(propertyName, expression) {
* @returns {!ol.format.filter.LessThanOrEqualTo} `<PropertyIsLessThanOrEqualTo>` operator. * @returns {!ol.format.filter.LessThanOrEqualTo} `<PropertyIsLessThanOrEqualTo>` operator.
* @api * @api
*/ */
_ol_format_filter_.lessThanOrEqualTo = function(propertyName, expression) { export function lessThanOrEqualTo(propertyName, expression) {
return new _ol_format_filter_LessThanOrEqualTo_(propertyName, expression); return new LessThanOrEqualTo(propertyName, expression);
}; }
/** /**
@@ -182,9 +181,9 @@ _ol_format_filter_.lessThanOrEqualTo = function(propertyName, expression) {
* @returns {!ol.format.filter.GreaterThan} `<PropertyIsGreaterThan>` operator. * @returns {!ol.format.filter.GreaterThan} `<PropertyIsGreaterThan>` operator.
* @api * @api
*/ */
_ol_format_filter_.greaterThan = function(propertyName, expression) { export function greaterThan(propertyName, expression) {
return new _ol_format_filter_GreaterThan_(propertyName, expression); return new GreaterThan(propertyName, expression);
}; }
/** /**
@@ -195,9 +194,9 @@ _ol_format_filter_.greaterThan = function(propertyName, expression) {
* @returns {!ol.format.filter.GreaterThanOrEqualTo} `<PropertyIsGreaterThanOrEqualTo>` operator. * @returns {!ol.format.filter.GreaterThanOrEqualTo} `<PropertyIsGreaterThanOrEqualTo>` operator.
* @api * @api
*/ */
_ol_format_filter_.greaterThanOrEqualTo = function(propertyName, expression) { export function greaterThanOrEqualTo(propertyName, expression) {
return new _ol_format_filter_GreaterThanOrEqualTo_(propertyName, expression); return new GreaterThanOrEqualTo(propertyName, expression);
}; }
/** /**
@@ -208,9 +207,9 @@ _ol_format_filter_.greaterThanOrEqualTo = function(propertyName, expression) {
* @returns {!ol.format.filter.IsNull} `<PropertyIsNull>` operator. * @returns {!ol.format.filter.IsNull} `<PropertyIsNull>` operator.
* @api * @api
*/ */
_ol_format_filter_.isNull = function(propertyName) { export function isNull(propertyName) {
return new _ol_format_filter_IsNull_(propertyName); return new IsNull(propertyName);
}; }
/** /**
@@ -223,9 +222,9 @@ _ol_format_filter_.isNull = function(propertyName) {
* @returns {!ol.format.filter.IsBetween} `<PropertyIsBetween>` operator. * @returns {!ol.format.filter.IsBetween} `<PropertyIsBetween>` operator.
* @api * @api
*/ */
_ol_format_filter_.between = function(propertyName, lowerBoundary, upperBoundary) { export function between(propertyName, lowerBoundary, upperBoundary) {
return new _ol_format_filter_IsBetween_(propertyName, lowerBoundary, upperBoundary); return new IsBetween(propertyName, lowerBoundary, upperBoundary);
}; }
/** /**
@@ -244,11 +243,11 @@ _ol_format_filter_.between = function(propertyName, lowerBoundary, upperBoundary
* @returns {!ol.format.filter.IsLike} `<PropertyIsLike>` operator. * @returns {!ol.format.filter.IsLike} `<PropertyIsLike>` operator.
* @api * @api
*/ */
_ol_format_filter_.like = function(propertyName, pattern, export function like(propertyName, pattern,
opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) { opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) {
return new _ol_format_filter_IsLike_(propertyName, pattern, return new IsLike(propertyName, pattern,
opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase); opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase);
}; }
/** /**
@@ -260,7 +259,6 @@ _ol_format_filter_.like = function(propertyName, pattern,
* @returns {!ol.format.filter.During} `<During>` operator. * @returns {!ol.format.filter.During} `<During>` operator.
* @api * @api
*/ */
_ol_format_filter_.during = function(propertyName, begin, end) { export function during(propertyName, begin, end) {
return new _ol_format_filter_During_(propertyName, begin, end); return new During(propertyName, begin, end);
}; }
export default _ol_format_filter_;
+45 -28
View File
@@ -1,7 +1,24 @@
import Feature from '../../../../src/ol/Feature.js'; import Feature from '../../../../src/ol/Feature.js';
import GML2 from '../../../../src/ol/format/GML2.js'; import GML2 from '../../../../src/ol/format/GML2.js';
import WFS from '../../../../src/ol/format/WFS.js'; import WFS from '../../../../src/ol/format/WFS.js';
import _ol_format_filter_ from '../../../../src/ol/format/filter.js'; import {
and as andFilter,
bbox as bboxFilter,
between as betweenFilter,
contains as containsFilter,
during as duringFilter,
equalTo as equalToFilter,
greaterThan as greaterThanFilter,
greaterThanOrEqualTo as greaterThanOrEqualToFilter,
intersects as intersectsFilter,
isNull as isNullFilter,
lessThan as lessThanFilter,
lessThanOrEqualTo as lessThanOrEqualToFilter,
like as likeFilter,
not as notFilter,
or as orFilter,
within as withinFilter
} from '../../../../src/ol/format/filter.js';
import LineString from '../../../../src/ol/geom/LineString.js'; import LineString from '../../../../src/ol/geom/LineString.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js'; import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
@@ -306,7 +323,7 @@ describe('ol.format.WFS', function() {
featureNS: 'http://www.openplans.org/topp', featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp', featurePrefix: 'topp',
featureTypes: ['states'], featureTypes: ['states'],
filter: _ol_format_filter_.equalTo('name', 'New York', false) filter: equalToFilter('name', 'New York', false)
}); });
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text)); expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
}); });
@@ -334,9 +351,9 @@ describe('ol.format.WFS', function() {
featureNS: 'http://www.openplans.org/topp', featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp', featurePrefix: 'topp',
featureTypes: ['states'], featureTypes: ['states'],
filter: _ol_format_filter_.or( filter: orFilter(
_ol_format_filter_.equalTo('name', 'New York'), equalToFilter('name', 'New York'),
_ol_format_filter_.equalTo('area', 1234)) equalToFilter('area', 1234))
}); });
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text)); expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
}); });
@@ -376,14 +393,14 @@ describe('ol.format.WFS', function() {
featureNS: 'http://www.openplans.org/topp', featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp', featurePrefix: 'topp',
featureTypes: ['states'], featureTypes: ['states'],
filter: _ol_format_filter_.or( filter: orFilter(
_ol_format_filter_.and( andFilter(
_ol_format_filter_.greaterThan('area', 100), greaterThanFilter('area', 100),
_ol_format_filter_.greaterThanOrEqualTo('pop', 20000) greaterThanOrEqualToFilter('pop', 20000)
), ),
_ol_format_filter_.and( andFilter(
_ol_format_filter_.lessThan('area', 100), lessThanFilter('area', 100),
_ol_format_filter_.lessThanOrEqualTo('pop', 20000) lessThanOrEqualToFilter('pop', 20000)
) )
) )
}); });
@@ -408,7 +425,7 @@ describe('ol.format.WFS', function() {
featureNS: 'http://www.openplans.org/topp', featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp', featurePrefix: 'topp',
featureTypes: ['states'], featureTypes: ['states'],
filter: _ol_format_filter_.between('area', 100, 1000) filter: betweenFilter('area', 100, 1000)
}); });
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text)); expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
}); });
@@ -429,7 +446,7 @@ describe('ol.format.WFS', function() {
featureNS: 'http://www.openplans.org/topp', featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp', featurePrefix: 'topp',
featureTypes: ['states'], featureTypes: ['states'],
filter: _ol_format_filter_.isNull('area') filter: isNullFilter('area')
}); });
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text)); expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
}); });
@@ -451,7 +468,7 @@ describe('ol.format.WFS', function() {
featureNS: 'http://www.openplans.org/topp', featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp', featurePrefix: 'topp',
featureTypes: ['states'], featureTypes: ['states'],
filter: _ol_format_filter_.like('name', 'New*') filter: likeFilter('name', 'New*')
}); });
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text)); expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
}); });
@@ -473,7 +490,7 @@ describe('ol.format.WFS', function() {
featureNS: 'http://www.openplans.org/topp', featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp', featurePrefix: 'topp',
featureTypes: ['states'], featureTypes: ['states'],
filter: _ol_format_filter_.like('name', 'New*', '*', '.', '!', false) filter: likeFilter('name', 'New*', '*', '.', '!', false)
}); });
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text)); expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
}); });
@@ -497,7 +514,7 @@ describe('ol.format.WFS', function() {
featureNS: 'http://www.openplans.org/topp', featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp', featurePrefix: 'topp',
featureTypes: ['states'], featureTypes: ['states'],
filter: _ol_format_filter_.not(_ol_format_filter_.equalTo('name', 'New York')) filter: notFilter(equalToFilter('name', 'New York'))
}); });
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text)); expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
}); });
@@ -533,10 +550,10 @@ describe('ol.format.WFS', function() {
featureNS: 'http://www.openplans.org/topp', featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp', featurePrefix: 'topp',
featureTypes: ['states'], featureTypes: ['states'],
filter: _ol_format_filter_.and( filter: andFilter(
_ol_format_filter_.equalTo('name', 'New York'), equalToFilter('name', 'New York'),
_ol_format_filter_.bbox('the_geom', [1, 2, 3, 4], 'urn:ogc:def:crs:EPSG::4326'), bboxFilter('the_geom', [1, 2, 3, 4], 'urn:ogc:def:crs:EPSG::4326'),
_ol_format_filter_.greaterThan('population', 2000000) greaterThanFilter('population', 2000000)
) )
}); });
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text)); expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
@@ -565,7 +582,7 @@ describe('ol.format.WFS', function() {
const serialized = new WFS().writeGetFeature({ const serialized = new WFS().writeGetFeature({
srsName: 'EPSG:4326', srsName: 'EPSG:4326',
featureTypes: ['area'], featureTypes: ['area'],
filter: _ol_format_filter_.contains( filter: containsFilter(
'the_geom', 'the_geom',
new Polygon([[ new Polygon([[
[10, 20], [10, 20],
@@ -602,7 +619,7 @@ describe('ol.format.WFS', function() {
const serialized = new WFS().writeGetFeature({ const serialized = new WFS().writeGetFeature({
srsName: 'EPSG:4326', srsName: 'EPSG:4326',
featureTypes: ['area'], featureTypes: ['area'],
filter: _ol_format_filter_.intersects( filter: intersectsFilter(
'the_geom', 'the_geom',
new Polygon([[ new Polygon([[
[10, 20], [10, 20],
@@ -639,7 +656,7 @@ describe('ol.format.WFS', function() {
const serialized = new WFS().writeGetFeature({ const serialized = new WFS().writeGetFeature({
srsName: 'EPSG:4326', srsName: 'EPSG:4326',
featureTypes: ['area'], featureTypes: ['area'],
filter: _ol_format_filter_.within( filter: withinFilter(
'the_geom', 'the_geom',
new Polygon([[ new Polygon([[
[10, 20], [10, 20],
@@ -679,7 +696,7 @@ describe('ol.format.WFS', function() {
const serialized = new WFS().writeGetFeature({ const serialized = new WFS().writeGetFeature({
srsName: 'EPSG:4326', srsName: 'EPSG:4326',
featureTypes: ['states'], featureTypes: ['states'],
filter: _ol_format_filter_.during('date_prop', '2010-01-20T00:00:00Z', '2012-12-31T00:00:00Z') filter: duringFilter('date_prop', '2010-01-20T00:00:00Z', '2012-12-31T00:00:00Z')
}); });
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text)); expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
}); });
@@ -1298,9 +1315,9 @@ describe('ol.format.WFS', function() {
' </And>' + ' </And>' +
'</Filter>'; '</Filter>';
const serialized = WFS.writeFilter( const serialized = WFS.writeFilter(
_ol_format_filter_.and( andFilter(
_ol_format_filter_.like('name', 'Mississippi*'), likeFilter('name', 'Mississippi*'),
_ol_format_filter_.equalTo('waterway', 'riverbank') equalToFilter('waterway', 'riverbank')
) )
); );
expect(serialized).to.xmleql(_ol_xml_.parse(text)); expect(serialized).to.xmleql(_ol_xml_.parse(text));