Add new ol.format.filter.Contains spatial operator
This commit is contained in:
@@ -514,6 +514,43 @@ describe('ol.format.WFS', function() {
|
||||
expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text));
|
||||
});
|
||||
|
||||
it('creates a contains filter', function() {
|
||||
var text =
|
||||
'<wfs:Query xmlns:wfs="http://www.opengis.net/wfs" ' +
|
||||
' typeName="area" srsName="EPSG:4326" ' +
|
||||
' xmlns:topp="http://www.openplans.org/topp">' +
|
||||
' <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">' +
|
||||
' <ogc:Contains>' +
|
||||
' <ogc:PropertyName>the_geom</ogc:PropertyName>' +
|
||||
' <gml:Polygon xmlns:gml="http://www.opengis.net/gml">' +
|
||||
' <gml:exterior>' +
|
||||
' <gml:LinearRing>' +
|
||||
' <gml:posList srsDimension="2">' +
|
||||
' 10 20 10 25 15 25 15 20 10 20' +
|
||||
' </gml:posList>' +
|
||||
' </gml:LinearRing>' +
|
||||
' </gml:exterior>' +
|
||||
' </gml:Polygon>' +
|
||||
' </ogc:Contains>' +
|
||||
' </ogc:Filter>' +
|
||||
'</wfs:Query>';
|
||||
var serialized = new ol.format.WFS().writeGetFeature({
|
||||
srsName: 'EPSG:4326',
|
||||
featureTypes: ['area'],
|
||||
filter: ol.format.filter.contains(
|
||||
'the_geom',
|
||||
new ol.geom.Polygon([[
|
||||
[10, 20],
|
||||
[10, 25],
|
||||
[15, 25],
|
||||
[15, 20],
|
||||
[10, 20]
|
||||
]])
|
||||
)
|
||||
});
|
||||
expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text));
|
||||
});
|
||||
|
||||
it('creates a intersects filter', function() {
|
||||
var text =
|
||||
'<wfs:Query xmlns:wfs="http://www.opengis.net/wfs" ' +
|
||||
|
||||
Reference in New Issue
Block a user