[OpenLayers-Users] Filters and WFS
Stuart Eve
stuarteve at gmail.com
Wed Jul 2 05:57:08 EDT 2008
I am trying to get my WFS server to return a filtered set of results (to
avoid browser overload). I had previously been sending a FILTER param in the
url - but now this is breaking because of the fact BBOX and FILTER are
mutually exclusive (tickets #1430 and #1113). I attempted the patch in #1430
but it did not seem to work for me.
I have been attempting to instead use the Openlayers.Filters - but it is
just returning the whole of the WFS dataset (unfiltered). I was under the
impression that you could use an Openlayers Filter to filter the data (as
well as apply a style). Having checked the documentation it looks like only
a GeoJSON layer has the option of adding a filter - is this true and if so
is there any plans to include this v. useful functionality in the WFS layer?
Alternatively are there any plans to fix the FILTER/BBOX error?
Many thanks
Stuart
Code Snippets:
function getDefaultStyle(sld, layerName) {
> var styles = sld.namedLayers[layerName].userStyles;
> var style;
> for (var i=0; i<styles.length; ++i){
> style = styles[i];
> if(style.isDefault) {
> break;
> }
> }
>
> var rule = new OpenLayers.Rule({
> filter: new OpenLayers.Filter.Comparison(
> {
> type: OpenLayers.Filter.Comparison.EQUAL_TO,
> property: "ark_id",
> value: "CH05SR_536",}
> )
> });
> style.addRules(rule);
> return style;
> }
>
>
style_cxt_schm = getDefaultStyle(sld,"cxt_schm");
> var cxt_schm = new OpenLayers.Layer.WFS(cxt_schm,'php/map/ark_wxs_server.php?TYPENAME=cxt_schm',{},
> {styleMap: new OpenLayers.StyleMap({"default":style_cxt_schm})});
> map.addLayers([cxt_schm]);
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080702/84b49036/attachment.html
More information about the Users
mailing list