[Qgis-developer] Two Questions about the QGIS API

Bob Bruce Bob.Bruce at gov.mb.ca
Wed Apr 29 07:52:05 EDT 2009


Thanks Martin, this helps a lot.

	Bob

-----Original Message-----
From: Martin Dobias [mailto:wonder.sk at gmail.com]
Sent: 29-Apr-09 5:41 AM
To: Bob.Bruce at pobox.com
Cc: qgis-developer at lists.osgeo.org
Subject: Re: [Qgis-developer] Two Questions about the QGIS API


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
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.287 / Virus Database: 270.12.8/2086 - Release Date: 04/29/09
06:37:00



More information about the Qgis-developer mailing list