<div>Ivan,</div>
<div> </div>
<div>Thanks for the input I'll investigate that approach</div>
<div> </div>
<div>Andrew<br><br></div>
<div class="gmail_quote">On 12 March 2010 23:26, Ivan Grcic <span dir="ltr"><<a href="mailto:igrcic@gmail.com">igrcic@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<br><br>OpenLayers.Filter.FeatureId should recieve object with fids property, like this:<br><br> new OpenLayers.Filter.FeatureId({<br>
fids: [feature.fid]<br> })<br>
<div>
<div></div>
<div class="h5"><br>On Fri, Mar 12, 2010 at 11:23 AM, Andrew Haigh<br><<a href="mailto:haighaj%2Bollist@googlemail.com">haighaj+ollist@googlemail.com</a>> wrote:<br>> I'm attempting to work out how to apply a filter to a WFS layer (from<br>
> GeoServer 2.0.1), I've looked at the examples / documentation / forums and<br>> there seems to be a lot of discussion about doing this but I can't seem to<br>> find a definative solution.<br>><br>> I've seen this thread<br>
> <a href="http://n2.nabble.com/WFS-GetFeature-Filter-td4026139.html" target="_blank">http://n2.nabble.com/WFS-GetFeature-Filter-td4026139.html</a> which seems to<br>> indicate I need to download the latest build, so I'm using the nightly build<br>
> from the OpenLayers site which reports a version number of 'Revision 10086'.<br>><br>> This is my code:<br>><br>> wfsLayer = new OpenLayers.Layer.Vector( "WFS", {<br>> strategies: [new OpenLayers.Strategy.BBOX()],<br>
> projection: new OpenLayers.Projection("EPSG:27700"),<br>> maxExtent: new OpenLayers.Bounds(0, 0, 13000000, 13000000),<br>> styleMap: mstylemap,<br>> protocol: new OpenLayers.Protocol.WFS({<br>
> url: "/MyApp/Proxy.ashx",<br>> version: "1.1.0",<br>> srsName: "EPSG:27700",<br>> featurePrefix: "ora_store",<br>> featureType: "BOUNDARY",<br>
> geometryName: "GEOM",<br>> featureID: "OBJECTID",<br>> defaultFilter: new<br>> OpenLayers.Filter.FeatureId(["BOUNDARY.1102283472"]) // should this be<br>> 1102283472 ?<br>
> })<br>> });<br>><br>> The FireFox error console reports: Error: uncaught exception: Filter writing<br>> not supported for rule type: undefined<br>><br>> If I comment out the filter then the WFS layer works fine.<br>
><br>> So it appears that I've done something wrong in configuring my filter but I<br>> can't seem to work out what.<br>><br>> Do I need to set the filter elsewhere?<br>><br></div></div>You can aslo apply filter to filter property on layer, you dont have<br>
to do it on defaultFilter on protocol. If both filters are supplied<br>they get combined I think...<br>
<div class="im"><br>> Also when using the FeatureId filter I assume I should use the ID as<br>> returned in GML (BOUNDARY.1102283472) and not as stored in the database<br>> (1102283472) - is that correct? I've tested both ways and get the same<br>
> error.<br>><br></div>Yesm ID is same as Geoserver supplies it<br><br>> Thanks in advance<br>><br>> Andrew<br><br>Cheers,<br>><br><br>--<br><font color="#888888">Ivan<br></font></blockquote></div><br>