Bug report #1822
Zoom to point: exaggerated zoom
|Affected QGIS version:||Regression?:||No|
|Operating System:||All||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||11882|
I'm getting a weird behaviour with "zoom to point", I get
an exaggerated zoom unless I set values around 90 (qgis 1.1.0 Pan unstable on
Also, would it be possible to get the 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?
#2 Updated by gcarrillo - almost 12 years ago
#5 Updated by gcarrillo - almost 12 years ago
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):
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 )
x, y are the point coordinates to center
scale is the factor (1 to detailed scale, 99 to general scale)