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?
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Zoom-to-selected-features-tp2649057p7063131.html
Sent from the OpenLayers Users mailing list archive at Nabble.com._______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users