<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 &lt;michsred@gmail.com&gt;<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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function updateFilter(){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(pureCoverage)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var filter = "parcel_number = " +<br>document.getElementById('filter').value;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var
 filterParams = {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cql_filter: filter<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mergeNewParams(filterParams);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function mergeNewParams(params){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myLayer.mergeNewParams(params);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<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>