Hi, I need to have my map to show features if they are in the current extent and if they match a selected category.<div>So I've written a filter function that uses the filterBy of the FeatureStore:</div><div><br></div>
<div><div><i>function sitesFilter(){</i></div><div><span class="Apple-tab-span" style="white-space:pre"><i>                </i></span><i>var extent = map.getExtent();</i></div><div><span class="Apple-tab-span" style="white-space:pre"><i>                </i></span><i>featureStore.filterBy(function(record){</i></div>
<div><span class="Apple-tab-span" style="white-space:pre"><i>                        </i></span><i>var currentCategory = Ext.getCmp('category').value;</i></div><div><span class="Apple-tab-span" style="white-space:pre"><i>                        </i></span><i>var feature = record.data.feature;</i></div>
<div><span class="Apple-tab-span" style="white-space:pre"><i>                        </i></span><i>if(feature.data.category == currentCategory){</i></div><div><span class="Apple-tab-span" style="white-space:pre"><i>                                </i></span><i>return extent.containsLonLat(new OpenLayers.LonLat(feature.geometry.x,feature.geometry.y));</i></div>
<div><span class="Apple-tab-span" style="white-space:pre"><i>                        </i></span><i>}else if(!currentCategory || currentCategory == 'ALL'){</i></div><div><span class="Apple-tab-span" style="white-space:pre"><i>                                </i></span><i>return extent.containsLonLat(new OpenLayers.LonLat(feature.geometry.x,feature.geometry.y));</i></div>
<div><span class="Apple-tab-span" style="white-space:pre"><i>                        </i></span><i>}</i></div><div><span class="Apple-tab-span" style="white-space:pre"><i>                </i></span><i>});</i></div><div><br></div>this is called on zoomend, moveend or when a category is chosen.</div>
<div>All works pretty well and quick with each browser except for ie which is extremely slow and unusable.</div><div><br></div><div>Is there something I can do to speed it up?</div><div><br></div><div>Thanks in advance<br>
-- <br>Simone <br>
</div>