<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19170"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=984282618-27122011><FONT color=#0000ff
size=2 face=Arial>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=984282618-27122011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=984282618-27122011><FONT color=#0000ff
size=2 face=Arial>i think, you cannot use filter to load static data.
OpenLayers have to load the whole file and doesnot use the filter to serialize
only parts of the file and add them as features.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=984282618-27122011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=984282618-27122011><FONT color=#0000ff
size=2 face=Arial>If you request the data from a provider, which evaluates the
filter like WFS, filter does work.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=984282618-27122011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=984282618-27122011><FONT color=#0000ff
size=2 face=Arial>Instead you can use a styleMap to display only a set of
features.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=984282618-27122011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=984282618-27122011><FONT color=#0000ff
size=2 face=Arial>Arnd</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=984282618-27122011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr align=left><FONT size=2 face=Tahoma><B>Von:</B>
openlayers-users-bounces@lists.osgeo.org
[mailto:openlayers-users-bounces@lists.osgeo.org] <B>Im Auftrag von
</B>Aparna<BR><B>Gesendet:</B> Montag, 26. Dezember 2011 12:15<BR><B>An:</B>
users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] Filtering a GeoJSON
layer<BR></FONT><BR></DIV>
<DIV></DIV>filtering either after projection or in the
protocol->format->filter does not seem to be working at all. <BR><BR>var
state = new OpenLayers.Layer.Vector("State",
{<BR>
projection: map.displayProjection,
<BR>
filter: new
OpenLayers.Filter.Comparison({<BR>
type:
OpenLayers.Filter.Comparison.EQUAL_TO,<BR>
property:
'SCHMGT',<BR>
value: 2<BR>
}),
<BR> strategies: [new
OpenLayers.Strategy.Fixed()],<BR>
protocol: new
OpenLayers.Protocol.HTTP({<BR>
url:
"klm/GIS.json",
<BR>
format: new OpenLayers.Format.GeoJSON({
<BR>
extractAttributes:
true
<BR>
<BR>
})<BR>
})<BR>
});<BR><BR>How does one implement a filter?? </BODY></HTML>