[OpenLayers-Users] Change filter on vector layer
Andreas Hocevar
ahocevar at opengeo.org
Mon Jul 6 11:27:57 EDT 2009
Hi,
On Mon, Jul 6, 2009 at 4:38 PM, Lak
Krishnan<lakshmanan.krishnan at mecklenburgcountync.gov> wrote:
>
> I have a vector layer with a WFS protocol and filter as below
>
> var impactlocptlayer = new OpenLayers.Layer.Vector("Editable Features", {
> strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
> projection: new OpenLayers.Projection("EPSG:2264"),
> filter: new OpenLayers.Filter.Comparison({type:
> OpenLayers.Filter.Comparison.EQUAL_TO,property: 'eventid',value: 4}),
> extractAttributes: false,
> protocol: new OpenLayers.Protocol.WFS({
> version: "1.1.0",
> srsName: "EPSG:2264",
> url: "http://localhost/geoserver/wfs",
> featureNS : "http://postgis.org",
> featureType: "impactlocpt",
> geometryName: "the_geom",
> schema:
> "http://localhost/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=uasidata:impactlocpt"
> }),
> styleMap: wfsstyle
> });
>
> How do I change "Filter" later in my code?
impactlocptlayer.filter = /* your new filter here */;
impactlocptlayer.refresh();
Regards,
Andreas.
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list