[Qgis-developer] QgsMapCanvas - Special zoom

Germán Carrillo carrillo.german at gmail.com
Thu Sep 30 22:38:19 EDT 2010


Hi,

not sure if it's the same, but the Aaron Racicot's MirrorMap plugin does
something similar. Have a look at it:

http://www.reprojected.com/geoblog/2009/02/17/mirrormap/

Regards,

Germán

On Thu, Sep 30, 2010 at 2:13 PM, GOO Creations <goocreations at gmail.com>wrote:

>  Hello,
>
>  Is there any trick I can use to zoom into a canvas with a specific centre
> AND a specific scale.
>  I have 2 map canvases, and I want to zoom into the same position and scale
> on both canvases at the same time: If i zoom into canvas1 at location (x,y)
> with factor 0.87, canvas2 should also zoom in with factor0.87 at position
> (x,y).
>
>  What I currently do is:
>  1. When the user zooms on one canvas (zoomLastStatusChanged signal), the
> signal is caught and the continues to step 2
>  2. Zoomin -> QgsMapCanvas provides 2 functions that can be used:
> zoomWithCenter and zoomScale
>
>  The problem is that there is not a function that can zoom into a certain
> point WITH a certain scale.
>  If zoomScale is used and one image is moved/paned individual, the zooming
> will have the same scale, but with different locations.
>  Hence if I zoom into one point, both canvases should the same location
> (zoomed in with the same amount)
>
>  If zoomWithCenter is used a fixed factor will be used to zoom in. Hence,
> if I zoom in on canvas1 with a factor different to 1, canvas2 will be zoomed
> into the correct location, but with a factor of 1 and not the factor of
> canvas1.
>
>  Does anyone have a solution to this problem? And is it even possible?
>
>  Thanks
>  Christoph
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>


-- 
-----------
  |\__
(:>__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20100930/cd410be8/attachment-0001.html


More information about the Qgis-developer mailing list