<div dir="ltr">Thank you very much Phil. I got it. I am sharing the code for all my friends. this code first checks if the layer is empty and then proceed. the clearData() is to do with destroying.<br><br>if(wfs_layer) {<br>
map.removeLayer(wfs_layer);<br>clearData(wfs_layer);<br>}<br><br>var radiusPoint = new OpenLayers.Geometry.Point([longitude, latitiude]);<br> var propertyFilter = new OpenLayers.Filter.Spatial({<br>        type:OpenLayers.Filter.Spatial.BBOX,<br>
        property:'the_geom',<br>        value:new OpenLayers.Bounds(extreme_x,extreme_y,minimum_x,minimum_y)<br>    });<br>wfs_layer = new OpenLayers.Layer.Vector("settlements", {<br>strategies: [new OpenLayers.Strategy.BBOX()],<br>
filter: propertyFilter, <br>protocol: new OpenLayers.Protocol.WFS({<br>version: "1.1.0",<br>url: "<a href="http://192.168.1.19:8081/geoserver/wfs">http://192.168.1.19:8081/geoserver/wfs</a>",<br>featureType: "settlements",<br>
featureNS: "<a href="http://www.gospatial.com">www.gospatial.com</a>",<br>srsName: "EPSG:900913",<br>visibility: true,<br>}),<br><br>}) <br><br>map.addLayers([wfs_layer]);<br><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Apr 8, 2013 at 3:13 AM, Phil Scadden <span dir="ltr"><<a href="mailto:p.scadden@gns.cri.nz" target="_blank">p.scadden@gns.cri.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">>How can i redraw or update the wfs layer after each spatial query.<br>
<br></div>
The control you are using draws the features returned to a vector layer that you must have specified when you created the control.<br>
Do a layer.destroyFeatures() call on that layer.<div class="HOEnZb"><div class="h5"><br>
<br>
Notice: This email and any attachments are confidential.<br>
If received in error please destroy and immediately notify us.<br>
Do not copy or disclose the contents.<br>
<br>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/openlayers-<u></u>users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div><b>Thanking you,</b></div><div><b>D.K Siva Kumar,</b></div><div>
<b><br></b></div><img src="https://sites.google.com/site/shivaisloyalist/kuidfc-nkusip/1.jpg"></div><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Research Engineer,</div><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Indian Institute for Human Settlement (iihs),</div><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
tharangavana,<br><em style="font-style:normal;line-height:16px">sadashivanagar,</em></div><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Bangalore-15</div>
</div>