[OpenLayers-Users] filter for WMS layer like Vector layer?

Charles Galpin cgalpin at lhsw.com
Thu Jul 21 11:49:21 EDT 2011


I would like to filter a WMS layer served by geoserver but I can't seem to get the filter to work. 

For a vector layer I can use the following just fine:
var layer = new OpenLayers.Layer.Vector("vector layer", {
  ...
                filter: new OpenLayers.Filter.Comparison({
                    type: OpenLayers.Filter.Comparison.EQUAL_TO,
                    property: "prop",
                    value: "value"
                })
});
I have tried using this same filter in the params and options blocks of a WMS layer. It appears to be ignored in the options, but is not converted to a filter in cql or something in the wms request and shows up as [object Object]
var allStreets = new OpenLayers.Layer.WMS(
                "All streets", "/geoserver/wms",
                {
                    filter:
                },
                {
		..
                } 
            );
thanks,
charles



More information about the Users mailing list