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.

What are the commands to apply all types of zoom (full, on selected layer, etc.) in python console? I'm searching both on pyqgis cookbook and API documentantion, but I'm not finding anything interesting.

share|improve this question
    
Not sure please check out qgis.org/pyqgis-cookbook/canvas.html#embedding-map-canvas & QGIS API doc (qgis.org/api/index.html) –  Sunil Mar 6 '13 at 12:11
    
+ useful for you gis.stackexchange.com/questions/3651/… –  Sunil Mar 6 '13 at 12:24

1 Answer 1

After getting around cookbook, the best place to learn is referring the QGis API Documentation. In this case we are looking for zoom functions, which are related to map canvas. So check if QgsMapCanvas class contains something.

enter image description here

Zoom functions available in QGis are provided in QgsMapCanvas Class.

>>> canvas = qgis.utils.iface.mapCanvas()
>>> canvas.zoomIn()
>>> canvas.zoomOut()
>>> canvas.zoomToFullExtent()
share|improve this answer

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.