[Qgis-developer] ZoomToLayer doesn't work

luca_manganelli at comune.trento.it luca_manganelli at comune.trento.it
Fri Mar 20 05:15:17 EDT 2009


qgis-developer-bounces at lists.osgeo.org scritti il 20/03/2009 09.39.21

> Hi,

> I discovered that ZoomToLayer function doesn't work if the layer with
> selected features is not "selected in the list of layers".
> I do this:

> mapCanvas=self.iface.mapCanvas()
> mapCanvas.setExtent(lay.extent())
> mapCanvas.zoomToSelected()
> mapCanvas.refresh()
>
> how can I select that layer?

Too early: I discovered the trick: use mapCanvas.setCurrentLayer (lay)

:-)




More information about the Qgis-developer mailing list