[Qgis-developer] Two Questions about the QGIS API

Martin Dobias wonder.sk at gmail.com
Wed Apr 29 06:40:39 EDT 2009


Hi Bob

On Sun, Apr 26, 2009 at 6:38 PM, Bob Bruce <Bob.Bruce at gov.mb.ca> wrote:
>
> In the QgsMapCanvas class there are two methods that I am having trouble
> with:
>
> zoomWithCenter - when I use the input coordinates that I type the view moves
> to some strange location. For instance the current view is centered roughly
> at: 330616E,6058767 and when I put in the coordinates 329946,6058707 in the
> call to this method it moves roughly to the coordinates 603170,1047099.
> Maybe I don't understand how I should call this method?

You should pass screen coordinates, not map coordinates to this
function. It's being used usually for the wheel event in map canvas.


> zoomByFactor: the documentation states: "Factor > 1 zooms in" however when I
> call this with 0 < Factor < 1 it actually zooms in. When I call it with
> Factor > 1 it zooms out. Is this an error in the documentation?

You're right. Fixed in svn trunk (r10684).

Bye
Martin


More information about the Qgis-developer mailing list