Wednesday 25 July 2018

qgis 3 - How to turn on the 'on-the-fly' functionality with PyQGIS?


Before QgsMapRenderer was deprecated if we wanted to activate OTF we used code like this:


canvas = QgsMapCanvas()
canvas.mapRenderer().setProjectionsEnabled(True)

Currently, QgsMapRenderer is divided into two classes QgsMapSettings and QgsMapRendererJob. I did some research, but with no success. So how we can achieve the same now?



Answer




Not sure if this will be possible as according to one of the QGIS devs @ndawson in response to Feature request #11644:



"Disabling on the fly projection is no longer an option in QGIS 3.0"



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...