<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>Michal,<br><br>I am not sure if this answers your question completely. You can try using WFS which can get the boundary of your feature of interest and then you can code for zooming to those bounds.<br><br>-Ravi. <br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> michsred <michsred@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> users@openlayers.org<br><b><span style="font-weight: bold;">Sent:</span></b> Fri, March 11, 2011 3:58:47 AM<br><b><span style="font-weight: bold;">Subject:</span></b> [OpenLayers-Users] Zoom to filtered feature<br></font><br>Hi list,<br><br>is there possible
to perform automatical zoom to feature filtered by CQL<br>filter?<br><br>I have a WMS layer containig parcels and I want to enable some kind of<br>searching mechanism where user will put parcel number to a form and after<br>apply it the only searched parcel will be displayed and map view will be set<br>to this parcel's bounds.<br><br>I enabled CQL filtering like this:<br><br> function updateFilter(){<br> if(pureCoverage)<br> return;<br> <br> var filter = "parcel_number = " +<br>document.getElementById('filter').value;<br> <br> var
filterParams = {<br> cql_filter: filter<br> };<br> <br> mergeNewParams(filterParams);<br> }<br> <br> function mergeNewParams(params){<br> myLayer.mergeNewParams(params);<br> }<br><br>and after I put parcel number to a form connected with updateFilter()<br>function and apply it, the only searched parcel is dispayed. My question is<br>what should I do to enable zooming to the filtered parcel? Is it possible to<br>retrieve BBOX of a particular feature from WMS layer and then use it in JS?<br><br>Thank you in advance
for any suggestions!<br><br>Michal<br><br>--<br>View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Zoom-to-filtered-feature-tp6160737p6160737.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/Zoom-to-filtered-feature-tp6160737p6160737.html</a><br>Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@lists.osgeo.org" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br></div></div>
</div><br>
</body></html>