I think the exaggerated zoom depends on what scale are your data. <br><br>Maybe the scale factor could be a relative factor with the canvas fullExtent as base extent. <br><br>Something like this can be useful (zoomtopoint.py file, run() method): <br>
<br>    mc=self.iface.mapCanvas() <br>    extent = mc.fullExtent()<br>    xmin = float(x) - extent.width() / ( 2 * ( 100-scale ) )<br>    xmax = float(x) + extent.width() / ( 2* ( 100-scale ) )<br>    ymin = float(y) - extent.height() / (2 * ( 100-scale ) )<br>
    ymax = float(y) + extent.height() / ( 2 *( 100-scale ) )<br>    rect = QgsRectangle( xmin, ymin, xmax, ymax )<br>    mc.setExtent(rect)<br><br>x, y are the point coordinates to center<br>scale is the factor (1 to detailed scale, 99 to general scale) <br>
<br>I tested and works fine.<br><br>Germán.<br><br><div class="gmail_quote">2009/7/31 Agustin Lobo <span dir="ltr">&lt;<a href="mailto:alobolistas@gmail.com" target="_blank">alobolistas@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi!<br>
<br>
I&#39;m getting a weird behaviour with &quot;zoom to point&quot;, I get<br>
an exaggerated zoom no matter what you set, anybody else is<br>
finding the same problem? (qgis 1.1.0 Pan unstable on<br>
ubuntu 9.04)<br>
<br>
Also, would it be possible to get that point marked with a circle<br>
or something so that you can fine tune the zoom and pan, and even<br>
get the point saved to a points vector layer?<br>
<br>
Thanks<br>
<br>
Agus<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>-----------<br>   |\__  <br>(:&gt;__)(<br>   |/    <br><br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br>