Hi all,<br><br>What i am looking to do is have my map automatically re-size itself based off a WMS layer which is being overlayed on top of a Google Map layer.<br><br>The WMS layer is generated using the filter option to only get specific polygons.<br>
<br>What i would like to do is have the map re-size to zoom itself to just fit in the currently displayed polygons, sometimes only 1 and sometimes many.<br><br>After redrawing the map<br><span style="color: rgb(0, 153, 0);">wms.redraw(true);</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>I have tried both of the following to re-size the map correctly, however no luck, both are zoomed out too far. &nbsp;&nbsp; <br><span style="color: rgb(0, 153, 0);">var newBounds = wms.getExtent();</span><br style="color: rgb(0, 153, 0);">
<span style="color: rgb(0, 153, 0);">map.zoomToExtent(newBounds);</span><br><br><span style="color: rgb(0, 153, 0);">var newZoom = wms.getZoomForExtent(wms.getExtent(), true)</span><br style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 153, 0);">map.zoomTo(newZoom);</span><br>
<br>Brad<br clear="all"><br>-- <br>Bradley Mclain<br>Systems Administrator Trainee<br>De Bortoli Wines Pty limited<br>De Bortoli Rd, BILBUL NSW &nbsp;2680<br>e: &nbsp;<a href="mailto:bradley_mclain@debortoliwines.com">bradley_mclain@debortoliwines.com</a><br>