[OpenLayers-Users] Filter not working

Siva kumar Devineni dksivagis at gmail.com
Mon Apr 8 00:24:53 PDT 2013


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.

if(wfs_layer) {
map.removeLayer(wfs_layer);
clearData(wfs_layer);
}

var radiusPoint = new OpenLayers.Geometry.Point([longitude, latitiude]);
 var propertyFilter = new OpenLayers.Filter.Spatial({
        type:OpenLayers.Filter.Spatial.BBOX,
        property:'the_geom',
        value:new OpenLayers.Bounds(extreme_x,extreme_y,minimum_x,minimum_y)
    });
wfs_layer = new OpenLayers.Layer.Vector("settlements", {
strategies: [new OpenLayers.Strategy.BBOX()],
filter: propertyFilter,
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
url: "http://192.168.1.19:8081/geoserver/wfs",
featureType: "settlements",
featureNS: "www.gospatial.com",
srsName: "EPSG:900913",
visibility: true,
}),

})

map.addLayers([wfs_layer]);



On Mon, Apr 8, 2013 at 3:13 AM, Phil Scadden <p.scadden at gns.cri.nz> wrote:

> >How can i redraw or update the wfs layer after each spatial query.
>
> The control you are using draws the features returned to a vector layer
> that you must have specified when you created the control.
> Do a layer.destroyFeatures() call on that layer.
>
>
> Notice: This email and any attachments are confidential.
> If received in error please destroy and immediately notify us.
> Do not copy or disclose the contents.
>
> ______________________________**_________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/openlayers-**users<http://lists.osgeo.org/mailman/listinfo/openlayers-users>
>



-- 
*Thanking you,*
*D.K Siva Kumar,*
*
*

Research Engineer,
Indian Institute for Human Settlement (iihs),
tharangavana,
*sadashivanagar,*
Bangalore-15
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130408/f8209a8b/attachment.html>


More information about the Users mailing list