Hi, i working on function, which will zoom to selected feature/s from CQL. Here is my syntax:
function filtrovanie()
{
var cql = document.getElementById("select").value;
var hodnota = document.getElementById("dopyt").value;
var vypis = cql+" "+hodnota;
var format = new OpenLayers.Format.CQL();
var filter;
filter = format.read(vypis);
if(filter)
{
rule.filter = filter;
wfs.redraw();
map.zoomToExtent(new OpenLayers.Bounds(wfs.selectedFeatures[0].getDataExtent()));
};
return false;
}
I got this error message :
Cannot call method 'getDataExtent' of undefined
I also tried to set wfs.selectedFeatures[0].geometry.getBounds().clone() , but nothing happened.
Can you say me what is wrong?
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Zoom-to-selected-features-tp2649057p7063131.html">Re: Zoom to selected features</a><br/>
Sent from the <a href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Users-f1822463.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br/>