[OpenLayers-Users] CQL queries with WFS

Per Engström pereng at gmail.com
Wed Jul 1 10:57:15 EDT 2009


Hi!

I've been looking at an old conversation (Aug 2008) with the same subject as
this where 'Todd Brenningmeyer' tried to use a cql-filter / filter on a
OpenLayers.Layer.WFS with no luck.

var wfsLayer = new OpenLayers.Layer.WFS("My layer",
    http://localhost:8080/geoserver/wfs,
    {
        styleMap: myStyle
    }
);
wfsLayer.mergeNewParams({'CQL_FILTER': 'id=1'});

He found out that OpenLayers added a BBOX at the end of the request.

I dug a little bit further and found out that this ALWAYS is added in the
moveTo function of OpenLayers.Layer.WFS. When a filter or cql filter is used
in the same request as a bbox to a GeoServer you get the following response:

<?xml version="1.0" ?>
<ServiceExceptionReport
   version="1.2.0"
   xmlns="http://www.opengis.net/ogc"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
   <ServiceException>filter and bbox both specified but are mutually
exclusive</ServiceException>
</ServiceExceptionReport>

What would be the correct way to exclude the bbox parameter from the
request? I would really not like to use Todd's workaround and use a GML
layer!

Regards,
Per Engström
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090701/5ed84814/attachment.html


More information about the Users mailing list