<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="font-family: arial, helvetica, sans-serif; "><span style="font-size: 12pt; ">Hello everyone. I've already sent this question to everyone, but no one seemed to know the answer. I'm hoping that </span><br></div><div style="font-family: arial, helvetica, sans-serif; ">this time I'll have better luck. Thanks in advance.</div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div id="yiv120646796"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 12pt; font-family: arial, helvetica, sans-serif; "><div style="font-family: arial, helvetica, sans-serif; "><div style="font-family: times, serif; "><div id="yiv120646796" style="font-size: 12pt; font-family: times, serif; "><div
style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 12pt; font-family: arial, helvetica, sans-serif; "><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; ">I want to use a Filter.Function to filter the features for a certain style.</div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; ">But the function that I'm passing to Filter.Function doesn't even get called.</div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; ">How can I use the OpenLayers.Filter.Function filter?</div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; ">Here is what I have:</div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 12pt; font-family:
arial, helvetica, sans-serif; "><br></div><div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> var my_filter = new OpenLayers.Filter.Function({</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> evaluate:function(attributes) {</span></font></div><div><font face="arial, helvetica,
sans-serif"><span style="font-size:16px;"> console.log(attributes);</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> var x=0; </span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> return true;</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> </span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> }</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> });</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"><br></span></font></div><div><font face="arial, helvetica, sans-serif"><span
style="font-size:16px;"> var ruleLow = new OpenLayers.Rule({</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> filter:my_filter</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> });</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"><br></span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"><br></span></font></div><div><font face="arial,
helvetica, sans-serif"><span style="font-size:16px;"> var my_style=new OpenLayers.Style( {pointRadius: 10, fillColor: "#FF3300",</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> fillOpacity: 0.5, strokeColor: "#FF3300"},ruleLow);</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> var my_style_map=new OpenLayers.StyleMap({</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> "temporary":my_style,</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> "default":my_style,</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;">
"select":my_style</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"><br></span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> });</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"><br></span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> this.vectors= new OpenLayers.Layer.Vector(</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> "Vector Layer",</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> {</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> styleMap:my_style_map,</span></font></div><div><font face="arial, helvetica,
sans-serif"><span style="font-size:16px;">
renderers:this.renderer,</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> }</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:16px;"> );</span></font></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; ">Thank you for your time and kind concern.</div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; ">Jenia</div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 12pt; font-family: arial,
helvetica, sans-serif; "><br></div></div></div></div><br><br> </div> </div> </div></div></div><br><br> </div> </div> </div></body></html>