Hi All
It may asked before, but i cant get any answer after searching . I just
could not figure out how to use finters in openlayer, please have a look of
the code.
// initailise the map
var options = {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
numZoomLevels: 18,
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508,
20037508.34)
};
map = new OpenLayers.Map('mapDiv', options);
function distanceSearch(city){
nameFilter = new OpenLayers.Filter.Spatial({
type: OpenLayers.Filter.Spatial.DWITHIN,
value: city.geometry,
// city.geometry returns POINT(52.215263 0.1222)
property: 'the_geom',
distance:20000,
distanceUnits:'m'
});
_xml = new OpenLayers.Format.XML();
var temp = Filter.write(nameFilter);
var stringFilter = _xml.write(temp);
var url = wfsHost;
options = {
outputformat:'json',
extractAttributes:true,
Request:'GetFeature',
version:'1.1.0',
typename:'myproject:stores',
filter: stringFilter
};
OpenLayers.loadURL(url,options,null,distanceSearchEnd);
}
it will return all the data in stores layer, the filter does not filter
anything out.
Where am i doing wrong??
thanks
--
View this message in context: http://www.nabble.com/DWITHIN-Filter-in-WFS-tp25530632p25530632.html
Sent from the GeoServer - User mailing list archive at Nabble.com.