sourcepole / qgis-instantprint-plugin

QGIS Instant Print Plugin
GNU General Public License v2.0
10 stars 10 forks source link

Feature Request: rotation #9

Open tveinot opened 6 years ago

tveinot commented 6 years ago

Wondering if rotation could be added to the GUI? Not sure if this is the right spot to put a feature request but it is where someone else did on another package.

tveinot commented 4 years ago

I did do some work on this and made a little breakthrough, in order to get the Canvas to rotate with the map all you need to do is create a function for the Expression String Editor using python and then use that custom function in the data driven overide for the Map Rotation in the Map Layout Properties of the desired layout.

Function Code: from qgis.core import from qgis.gui import from qgis.utils import iface

@qgsfunction(args='auto', group='Custom') def CanvasRotation(feature, parent): return (iface.mapCanvas().rotation())

However rotating the map causes some minor issues when moving the Map View Box and in how the Map View Box looks in your Canvas. I think a solution lies in using QgsTransform on the def __createRubberBand(self): and the def canvasMoveEvent(self, e): I have not had any success yet but if I do I will post it here. Thanks again for the tool! Tyler