With ratio and resFactor I can see a request on each zoom action but the list in my gris is always the same with all  objects.<div>Being that my map starts at the full zoom and with all features displayed and I want that zooming in the gird reduce the number of names displayed. I should try to apply the filter only on the featureStore that fills the grid, so to avoid continuous requests to the server. </div>

<div><br></div><div>Thanks for your explanation Andreas, now is more clear.<br><br><div class="gmail_quote">2010/11/2 Andreas Hocevar <span dir="ltr">&lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
there is no need to redraw the layer on zoomend. The reason why you don&#39;t see changes is because the BBOX strategy won&#39;t reload features if you zoom in, and has a buffer so it may be that you can also zoom out once before you see changes.<br>


<br>
If you really want the strategy to reload on every zoom, and load it exactly the features that match the visible match extent, you should configure the strategy with<br>
<br>
ratio: 1,<br>
resFactor: 1<br>
<br>
Regards,<br>
<font color="#888888">Andreas.<br>
</font><div><div></div><div class="h5"><br>
On Nov 2, 2010, at 15:23 , Simone Dalmasso wrote:<br>
<br>
&gt; Seems that the proxy doesn&#39;t have the setFilter method.<br>
&gt; Actually the strategy is an excellent solution, but I need to trigger a reload of the store on zoomend and moovend.<br>
&gt;<br>
&gt; To explain I pos my new code:<br>
&gt;<br>
&gt; var sites = new OpenLayers.Layer.Vector(&#39;Sites&#39;,{<br>
&gt;                               styleMap: styleMap,<br>
&gt;                               strategies: [/*new OpenLayers.Strategy.Fixed(),*/new OpenLayers.Strategy.BBOX()],<br>
&gt;                               projection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>
&gt;                               protocol: new OpenLayers.Protocol.WFS({<br>
&gt;                                       version: &quot;1.1.0&quot;,<br>
&gt;                                   srsName: &quot;EPSG:4326&quot;,<br>
&gt;                                       url: &#39;/geoserver/wfs/&#39;,<br>
&gt;                                       featureType: &#39;name&#39;,<br>
&gt;                                   featurePrefix: &quot;prefix&quot;<br>
&gt;                               })<br>
&gt;                       });<br>
&gt;<br>
&gt; map.events.register(&#39;zoomend&#39;,this, function(){<br>
&gt;                sites.redraw();<br>
&gt;       });<br>
&gt;<br>
&gt; var featureStore = new GeoExt.data.FeatureStore({<br>
&gt;           fields: [<br>
&gt;               {name: &quot;name&quot;, type: &quot;string&quot;}<br>
&gt;           ],<br>
&gt;           layer: sites<br>
&gt;       });<br>
&gt;<br>
&gt; and more...<br>
&gt;<br>
&gt; With that I can&#39;t see changes in the grid.<br>
&gt;<br>
&gt; Thanks a lot for your help.<br>
&gt;<br>
&gt; Simone<br>
&gt;<br>
&gt; 2010/11/2 Andreas Hocevar &lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; try the following:<br>
&gt;<br>
&gt; featureStore.proxy.setFilter(your_new_filter);<br>
&gt; featureStore.reload();<br>
&gt;<br>
&gt; But note that you could also configure your vector layer with your protocol and a BBOX strategy, and bind your featureStore to that layer by configuring the store&#39;s layer property. This will make the BBOX strategy take care of requesting features for the correct extent.<br>


&gt;<br>
&gt; Regards,<br>
&gt; Andreas.<br>
&gt;<br>
&gt; On Nov 2, 2010, at 14:24 , Simone Dalmasso wrote:<br>
&gt;<br>
&gt; &gt; Hi list, I have an OL vector layer with a feature store linked. The output of the store is in a grid, so I have the name of the features selectable.<br>
&gt; &gt; What I would like to do is to apply a spatial filter (BBOX) on the store to have displayed in the grid only the features that are within the BBOX. The update events for the store should be the &#39;zoomend&#39; and the &#39;moveend&#39; events of the map.<br>


&gt; &gt; I post some code:<br>
&gt; &gt;<br>
&gt; &gt; var featureStore = new GeoExt.data.FeatureStore({<br>
&gt; &gt;           fields: [<br>
&gt; &gt;               {name: &quot;name&quot;, type: &quot;string&quot;}<br>
&gt; &gt;           ],<br>
&gt; &gt;           layer: map.getLayersByName(&#39;Sites&#39;)[0],<br>
&gt; &gt;             featureFilter : new OpenLayers.Filter.Spatial({<br>
&gt; &gt;               type : OpenLayers.Filter.Spatial.BBOX,<br>
&gt; &gt;               value : map.getExtent()<br>
&gt; &gt; });<br>
&gt; &gt; var gridFeature = new Ext.grid.GridPanel({<br>
&gt; &gt;               store: featureStore,<br>
&gt; &gt;               sm: new GeoExt.grid.FeatureSelectionModel(),<br>
&gt; &gt;               cm: new Ext.grid.ColumnModel([{header:&#39;Name&#39;,dataIndex: &quot;name&quot;,id:&#39;name&#39;}]),<br>
&gt; &gt;               autoExpandColumn : &#39;name&#39;<br>
&gt; &gt; });<br>
&gt; &gt;<br>
&gt; &gt; Then I wrote:<br>
&gt; &gt; map.events.register(&#39;zoomend&#39;,this, function(){<br>
&gt; &gt;             featureStore.reload();<br>
&gt; &gt; });<br>
&gt; &gt;<br>
&gt; &gt; But in this way I get the this.proxy is null error from ext.js<br>
&gt; &gt; I&#39;ve also tried to re-bind the layer:<br>
&gt; &gt; map.events.register(&#39;zoomend&#39;,this, function(){<br>
&gt; &gt;     featureStore.unbind();<br>
&gt; &gt;     featureStore.bind(map.getLayersByName(&#39;Sites&#39;)[0]);<br>
&gt; &gt; });<br>
&gt; &gt;  But I get record is undefined error from ext.js<br>
&gt; &gt;<br>
&gt; &gt; For both I still have all the features displayed in the grid.<br>
&gt; &gt; Maybe I should destroy and recreate the entire gridPanel but is not the right way to do that for me.<br>
&gt; &gt; Can you help me?<br>
&gt; &gt; Thanks<br>
&gt; &gt; --<br>
&gt; &gt; Simone Dalmasso<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Users mailing list<br>
&gt; &gt; <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
&gt; &gt; <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
&gt; --<br>
&gt; Andreas Hocevar<br>
&gt; OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
&gt; Expert service straight from the developers.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Simone Dalmasso, Ing.<br>
&gt; ITHACA<br>
&gt; Information Technology for Humanitarian Assistance, Cooperation and Action<br>
&gt; <a href="http://www.ithacaweb.org" target="_blank">www.ithacaweb.org</a><br>
&gt; Via Pier Carlo Boggio 61 - 10138 Torino<br>
&gt; Tel: +39.011.1975.1854<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
&gt; <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
<br>
--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Simone Dalmasso, Ing.<br>ITHACA<br>Information Technology for Humanitarian Assistance, Cooperation and Action<br><a href="http://www.ithacaweb.org">www.ithacaweb.org</a><br>

Via Pier Carlo Boggio 61 - 10138 Torino<br>Tel: +39.011.1975.1854<br>
</div>