Ticket #1822 (closed bug: fixed)

Opened 4 years ago

Last modified 2 years ago

Zoom to point: exaggerated zoom

Reported by: alobo Owned by: gsherman
Priority: major: does not work as expected Milestone: Version 1.7.0
Component: Python plugins and bindings Version: Trunk
Keywords: Cc:
Platform Version: Platform: All
Must Fix for Release: No Awaiting user input: no

Description

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 ubuntu 9.04)

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?

Change History

Changed 4 years ago by pcav

  • status changed from new to closed
  • resolution set to duplicate

Duplicate of #1588

Changed 4 years ago by gcarrillo

This is related to the Gary's plugin? If this is, please reopen the ticket because I have a suggestion :)

I think the #1588 is related to ZoomToSelected? method (QgsMapCanvas? class), I guess #1588 and this aren't the same thing, but please forgive me If I'm wrong.

Changed 4 years ago by borysiasty

  • status changed from closed to reopened
  • resolution duplicate deleted

yes, you're right

Changed 4 years ago by borysiasty

  • owner changed from borysiasty to gsherman
  • status changed from reopened to new

Changed 4 years ago by gcarrillo

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)

Changed 3 years ago by pcav

  • must_fix changed from Yes to No
  • milestone changed from Version 1.5.0 to Version 1.6.0

Changed 2 years ago by borysiasty

  • status changed from new to closed
  • platform changed from Linux to All
  • resolution set to fixed

Applied as version 1.1, with a small modification: extent.width() / 200 * scale

So scale n means n% of the full extent.

Note: See TracTickets for help on using tickets.