-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
map canvas rotation #24
Comments
I have been working on this, as well as asked about this very feature. from qgis.core import * @qgsfunction(args='auto', group='Custom') As you can see I named my function "CanvasRotation" it should probably be "MapRotation" you can change the name where it says "def CanvasRotation(feature, parent):" with that saved you can then go to the Expression tab and use CanvasRotation() to return the value from your map rotation. Back to your Layout if you look to the left of the Map Rotation value box in the Map Properties you will see a button for Data Defined Override. Click that, got to edit and enter CanvasRotation() and save it. Now, your Layout will be rotated by the same rotation as your Canvas. NOTES: The other issue is once rotated when you try to move the box will move in relation to the rotation; meaning if you rotate the map 90 degrees and grab the map view box and drag the mouse left the box will move up, at 180 degrees all the movements are reversed i.e. the box moves "Map Rotation" off from your mouse movements. It can make things interesting when aligning your map view but can be done with some patience. I think QgsTransform needs to be applied to the tools def __createRubberBand(self):, and the def canvasMoveEvent(self, e): to fix this. As I mentioned I have made some attempts but this is as far as I have gotten to get it all to work. |
Is it possible to respect the map rotation in canvas view when you print?
The text was updated successfully, but these errors were encountered: