Sunday 29 September 2019

python - How to programmatically detect a canvas refresh or pan/zoom in QGIS


For my python plugin I would like to remove a VertexMarker when the user pans/zooms there map.


Which is the best way to detect a canvas refresh or pan/zoom carried out by the user?



Can you suggest any plugins which have this functionality I can take a look at?


Thanks



Answer



Just connect to the refresh signal


iface.mapCanvas().mapCanvasRefreshed.connect(yourmethod)

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...