[OpenLayers-Users] Filters and WFS

Tim Schaub tschaub at opengeo.org
Wed Jul 2 16:11:11 EDT 2008


Hey-

This is scheduled to be fixed in 2.7.

The new vector behavior work includes a WFS protocol that properly 
handles ogc:Filter.

If you want to try it out, find the vector behavior sandbox:
http://svn.openlayers.org/sandbox/vector-behavior

Remaining issues will be ironed out in the next few months.

Tim

Stuart Eve wrote:
> 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]);
> 
> !DSPAM:4033,486b50fe101954901796417!
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 
> !DSPAM:4033,486b50fe101954901796417!




More information about the Users mailing list