QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
40 void QgsLayoutNorthArrowHandler::updateMapRotation()
46 double rotation = mRotationMap->mapRotation() + mRotationMap->rotation();
56 QgsPointXY center = mRotationMap->extent().center();
74 rotation += mNorthOffset;
75 const double oldRotation = mArrowRotation;
76 mArrowRotation = ( rotation > 360.0 ) ? rotation - 360.0 : rotation ;
77 if ( mArrowRotation != oldRotation )
85 disconnectMap( mRotationMap );
90 mRotationMap =
nullptr;
91 if ( mArrowRotation != 0 )
120 mNorthOffset = offset;
Defines a QGIS exception class.
Contains information about the context in which a coordinate transform is executed.
static Q_INVOKABLE double bearingTrueNorth(const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &transformContext, const QgsPointXY &point)
Returns the direction to true north from a specified point and for a specified coordinate reference s...
void extentChanged()
Emitted when the map's extent changes.
const QgsCoordinateReferenceSystem & crs
QgsLayoutItemMap * linkedMap() const
Returns the linked rotation map, if set.
@ TrueNorth
Align to true north.
QgsLayoutNorthArrowHandler(QObject *parent)
Constructor for QgsLayoutNorthArrowHandler, with the specified parent object.
void setNorthOffset(double offset)
Sets the offset added to the arrows's rotation from a map's North.
void setLinkedMap(QgsLayoutItemMap *map)
Sets the linked map item.
void arrowRotationChanged(double newRotation)
Emitted on arrow rotation change.
void setNorthMode(NorthMode mode)
Sets the mode used to calculate the arrow rotation.
void rotationChanged(double newRotation)
Emitted on item rotation change.
This class represents a coordinate reference system (CRS).
A class to represent a 2D point.
NorthMode
Method for syncing rotation to a map's North direction.
Layout graphical items for displaying a map.
void mapRotationChanged(double newRotation)
Emitted when the map's rotation changes.
@ GridNorth
Align to grid north.