Skip to content
Permalink
Browse files

DBManager TopoViewer: zoom on topology if first load

Fixes #13064

(backport of b9b6257)
  • Loading branch information
Sandro Santilli
Sandro Santilli committed Jul 2, 2015
1 parent d60ff95 commit da949161699741268d6be22e42762bec9ece1b55
Showing with 10 additions and 0 deletions.
  1. +10 −0 python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/__init__.py
@@ -262,6 +262,16 @@ def run(item, action, mainwindow):
legend.setLayerExpanded(layer, False)

finally:

# Set canvas extent to topology extent, if not yet initialized
canvas = iface.mapCanvas()
if ( canvas.fullExtent().isNull() ):
ext = node_extent
ext.combineExtentWith(edge_extent)
# Grow by 1/20 of largest side
ext = ext.buffer(max(ext.width(),ext.height())/20)
canvas.setExtent(ext)

# restore canvas render flag
iface.mapCanvas().setRenderFlag( prevRenderFlagState )

0 comments on commit da94916

Please sign in to comment.
You can’t perform that action at this time.