[Qgis-developer] weird behavior of "zoom to point"
Germán Carrillo
carrillo.german at gmail.com
Fri Jul 31 11:46:28 EDT 2009
I think the exaggerated zoom depends on what scale are your data.
Maybe the scale factor could be a relative factor with the canvas fullExtent
as base extent.
Something like this can be useful (zoomtopoint.py file, run() method):
mc=self.iface.mapCanvas()
extent = mc.fullExtent()
xmin = float(x) - extent.width() / ( 2 * ( 100-scale ) )
xmax = float(x) + extent.width() / ( 2* ( 100-scale ) )
ymin = float(y) - extent.height() / (2 * ( 100-scale ) )
ymax = float(y) + extent.height() / ( 2 *( 100-scale ) )
rect = QgsRectangle( xmin, ymin, xmax, ymax )
mc.setExtent(rect)
x, y are the point coordinates to center
scale is the factor (1 to detailed scale, 99 to general scale)
I tested and works fine.
Germán.
2009/7/31 Agustin Lobo <alobolistas at gmail.com>
> Hi!
>
> I'm getting a weird behaviour with "zoom to point", I get
> an exaggerated zoom no matter what you set, anybody else is
> finding the same problem? (qgis 1.1.0 Pan unstable on
> ubuntu 9.04)
>
> Also, would it be possible to get that point marked with a circle
> or something so that you can fine tune the zoom and pan, and even
> get the point saved to a points vector layer?
>
> Thanks
>
> Agus
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
--
-----------
|\__
(:>__)(
|/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090731/ea3e7914/attachment.html
More information about the Qgis-developer
mailing list