Opened 15 years ago

Closed 15 years ago

#1588 closed bug (fixed)

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

Reported by: trapanator Owned by: nobody
Priority: major: does not work as expected Milestone: Version 1.2.0
Component: MapCanvas Version: Trunk
Keywords: Cc:
Must Fix for Release: Yes Platform: All
Platform Version: Awaiting user input: no

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...

Change History (8)

comment:1 by pcav, 15 years ago

Milestone: Version 1.0.2
Platform: WindowsAll

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?

in reply to:  1 comment:2 by trapanator, 15 years ago

Replying to 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.

comment:3 by gsherman, 15 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.

in reply to:  3 comment:4 by trapanator, 15 years ago

Replying to 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.

comment:5 by trapanator, 15 years ago

Milestone: Version 1.0.3Version 1.2.0

comment:6 by pcav, 15 years ago

Component: C++ PluginsPython plugins and bindings

comment:7 by pcav, 15 years ago

See suggestion (and possible patch) in #1822

comment:8 by jef, 15 years ago

Component: Python plugins and bindingsMapCanvas
Resolution: fixed
Status: newclosed

fixed in r10994 (see also #1311)

Note: See TracTickets for help on using tickets.