Bug report #1588

invoking ZoomToSelected() on a single point feature puts map at scale 2:1

Added by luca76 - over 10 years ago. Updated about 10 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Map Canvas
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 #:11648

Description

Hi,

I wrote a python plugin and I use ZoomToSelected() to zoom to a point feature.

The problem is that QGIS zooms too near, at 2:1 scale.

If you have a raster image behind that point, it is VERY slow to render at that strange scale.

It would be nice to have a parameter, like minimum zoom level...

History

#1 Updated by Paolo Cavallini over 10 years ago

It is not clear which the minimum zoom level would be, but I agree that 2:1 is zooming really too close: can this be changed to, say, 100:1?

#2 Updated by luca76 - over 10 years ago

Replying to [comment:1 pcav]:

It is not clear which the minimum zoom level would be, but I agree that 2:1 is zooming really too close: can this be changed to, say, 100:1?

ehm... 1:100, not 100:1 (that would be TOO near :-P) !

Anyway, you should give the opportunity to programmer to set its preferred minimum scale factor.

#3 Updated by Gary Sherman over 10 years ago

You could modify your code to expand the view extent to a reasonable level prior to the zoom, using the coordinates of the selected point.

#4 Updated by luca76 - over 10 years ago

Replying to [comment:3 gsherman]:

You could modify your code to expand the view extent to a reasonable level prior to the zoom, using the coordinates of the selected point.

Yes, but if I'm right, there's no way to zoom ad a fixed scale in QGIS. Correct me if I am wrong.

#5 Updated by Paolo Cavallini about 10 years ago

See suggestion (and possible patch) in #1822

#6 Updated by Jürgen Fischer about 10 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

fixed in 40650bbb (SVN r10995) (see also #1311)

Also available in: Atom PDF