Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Hy,

I'm developing a plugin in python for Qgis.

I would like the user to select a particular area in a list (let say a country list) and zoom in the map on the corresponding area.

Actually I'm doing it 'ugly':I create a layer (from a wkt), zoom to this particular layer, and delete this layer...

Is there a way to do it properly ?

share|improve this question

1 Answer 1

Try this:

rect = geometry.boundingBox()
iface.mapCanvas().setExtent(rect)
iface.mapCanvas().refresh()
share|improve this answer
    
The problem with this, is that some other plugins does the same at launch time. –  Djab Jul 24 '12 at 9:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.