2017-07-14 13:14:02 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/layout/qgslayoutitemmap.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
|
2017-07-14 13:14:02 +10:00
|
|
|
class QgsLayoutItemMap : QgsLayoutItem
|
|
|
|
{
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Layout graphical items for displaying a map.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-07-14 13:14:02 +10:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgslayoutitemmap.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
enum AtlasScalingMode
|
|
|
|
{
|
|
|
|
Fixed,
|
|
|
|
|
|
|
|
Predefined,
|
|
|
|
|
|
|
|
Auto
|
|
|
|
};
|
|
|
|
|
2017-07-14 13:14:02 +10:00
|
|
|
explicit QgsLayoutItemMap( QgsLayout *layout );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsLayoutItemMap, with the specified parent ``layout``.
|
2017-07-14 13:14:02 +10:00
|
|
|
%End
|
2017-10-20 16:42:35 +10:00
|
|
|
~QgsLayoutItemMap();
|
|
|
|
|
2017-07-18 15:48:38 +10:00
|
|
|
virtual int type() const;
|
2017-10-09 12:41:33 +10:00
|
|
|
|
2017-12-20 16:39:33 +07:00
|
|
|
virtual QIcon icon() const;
|
|
|
|
|
2017-10-09 12:41:33 +10:00
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
void assignFreeId();
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the map id() to a number not yet used in the layout. The existing id() is kept if it is not in use.
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual QString displayName() const;
|
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-10-16 17:34:19 +10:00
|
|
|
static QgsLayoutItemMap *create( QgsLayout *layout ) /Factory/;
|
2017-10-10 11:41:08 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns a new map item for the specified ``layout``.
|
|
|
|
|
|
|
|
The caller takes responsibility for deleting the returned object.
|
2017-10-10 11:41:08 +10:00
|
|
|
%End
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget );
|
|
|
|
|
|
|
|
virtual int numberExportLayers() const;
|
|
|
|
|
|
|
|
virtual void setFrameStrokeWidth( const QgsLayoutMeasurement &width );
|
|
|
|
|
|
|
|
|
|
|
|
double scale() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the map scale.
|
|
|
|
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setScale`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setScale( double scale, bool forceUpdate = true );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets new map ``scale`` and changes only the map extent.
|
2017-10-20 16:42:35 +10:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
2017-10-20 16:42:35 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`scale`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setExtent( const QgsRectangle &extent );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets a new ``extent`` for the map. This method may change the width or height of the map
|
|
|
|
item to ensure that the extent exactly matches the specified extent, with no
|
|
|
|
overlap or margin. This method implicitly alters the map scale.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`zoomToExtent`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`extentChanged`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void zoomToExtent( const QgsRectangle &extent );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Zooms the map so that the specified ``extent`` is fully visible within the map item.
|
|
|
|
This method will not change the width or height of the map, and may result in
|
|
|
|
an overlap or margin from the specified extent. This method implicitly alters the
|
|
|
|
map scale.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setExtent`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsRectangle extent() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the current map extent.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`visibleExtentPolygon`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`extentChanged`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
QPolygonF visibleExtentPolygon() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns a polygon representing the current visible map extent, considering map extents and rotation.
|
|
|
|
If the map rotation is 0, the result is the same as currentMapExtent
|
|
|
|
|
|
|
|
:return: polygon with the four corner points representing the visible map extent. The points are
|
2018-05-24 21:21:14 +10:00
|
|
|
clockwise, starting at the top-left point
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`extent`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsCoordinateReferenceSystem crs() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns coordinate reference system used for rendering the map.
|
|
|
|
This will match the presetCrs() if that is set, or if a preset
|
|
|
|
CRS is not set then the map's CRS will follow the composition's
|
|
|
|
project's CRS.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`presetCrs`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setCrs`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsCoordinateReferenceSystem presetCrs() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the map's preset coordinate reference system. If set, this
|
|
|
|
CRS will be used to render the map regardless of any project CRS
|
|
|
|
setting. If the returned CRS is not valid then the project CRS
|
|
|
|
will be used to render the map.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`crs`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setCrs`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setCrs( const QgsCoordinateReferenceSystem &crs );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the map's preset ``crs`` (coordinate reference system). If a valid CRS is
|
|
|
|
set, this CRS will be used to render the map regardless of any project CRS
|
|
|
|
setting. If the CRS is not valid then the project CRS will be used to render the map.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`crs`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`presetCrs`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool keepLayerSet() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns whether a stored layer set should be used
|
|
|
|
or the current layer set from the project associated with the layout. This is just a GUI flag,
|
|
|
|
and itself does not change which layers are rendered in the map.
|
|
|
|
Instead, use setLayers() to control which layers are rendered.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setKeepLayerSet`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`layers`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setKeepLayerSet( bool enabled );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether the stored layer set should be used
|
|
|
|
or the current layer set of the associated project. This is just a GUI flag,
|
|
|
|
and itself does not change which layers are rendered in the map.
|
|
|
|
Instead, use setLayers() to control which layers are rendered.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`keepLayerSet`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`layers`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QList<QgsMapLayer *> layers() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the stored layer set. If empty, the current project layers will
|
|
|
|
be used instead.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setLayers`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`keepLayerSet`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setLayers( const QList<QgsMapLayer *> &layers );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the stored ``layers`` set. If empty, the current project layers will
|
|
|
|
be used instead.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`layers`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`keepLayerSet`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool keepLayerStyles() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns whether current styles of layers should be overridden by previously stored styles.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setKeepLayerStyles`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setKeepLayerStyles( bool enabled );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether current styles of layers should be overridden by previously stored styles.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`keepLayerStyles`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QMap<QString, QString> layerStyleOverrides() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns stored overrides of styles for layers.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setLayerStyleOverrides`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the stored overrides of styles for layers.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`layerStyleOverrides`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void storeCurrentLayerStyles();
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Stores the current project layer styles into style overrides.
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool followVisibilityPreset() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns whether the map should follow a map theme. If true, the layers and layer styles
|
|
|
|
will be used from given preset name (configured with setFollowVisibilityPresetName() method).
|
|
|
|
This means when preset's settings are changed, the new settings are automatically
|
|
|
|
picked up next time when rendering, without having to explicitly update them.
|
|
|
|
At most one of the flags keepLayerSet() and followVisibilityPreset() should be enabled
|
|
|
|
at any time since they are alternative approaches - if both are enabled,
|
|
|
|
following map theme has higher priority. If neither is enabled (or if preset name is not set),
|
|
|
|
map will use the same configuration as the map canvas uses.
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setFollowVisibilityPreset( bool follow );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether the map should follow a map theme. See followVisibilityPreset() for more details.
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString followVisibilityPresetName() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Preset name that decides which layers and layer styles are used for map rendering. It is only
|
|
|
|
used when followVisibilityPreset() returns true.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setFollowVisibilityPresetName`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setFollowVisibilityPresetName( const QString &name );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets preset name for map rendering. See followVisibilityPresetName() for more details.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`followVisibilityPresetName`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual void moveContent( double dx, double dy );
|
|
|
|
|
2017-10-21 12:24:11 +10:00
|
|
|
virtual void setMoveContentPreviewOffset( double dx, double dy );
|
|
|
|
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
virtual void zoomContent( double factor, QPointF point );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool containsWmsLayer() const;
|
|
|
|
%Docstring
|
|
|
|
Returns true if the map contains a WMS layer.
|
|
|
|
%End
|
|
|
|
|
2017-12-16 08:16:52 +10:00
|
|
|
virtual bool requiresRasterization() const;
|
|
|
|
|
|
|
|
virtual bool containsAdvancedEffects() const;
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
|
|
|
|
void setMapRotation( double rotation );
|
|
|
|
%Docstring
|
2018-01-18 06:59:57 +10:00
|
|
|
Sets the ``rotation`` for the map - this does not affect the layout item shape, only the
|
2017-12-15 10:36:55 -04:00
|
|
|
way the map is drawn within the item. Rotation is in degrees, clockwise.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`mapRotation`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`mapRotationChanged`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
double mapRotation( QgsLayoutObject::PropertyValueType valueType = QgsLayoutObject::EvaluatedValue ) const;
|
|
|
|
%Docstring
|
2018-01-18 06:59:57 +10:00
|
|
|
Returns the rotation used for drawing the map within the layout item, in degrees clockwise.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param valueType: controls whether the returned value is the user specified rotation,
|
2018-05-24 21:21:14 +10:00
|
|
|
or the current evaluated rotation (which may be affected by data driven rotation
|
|
|
|
settings).
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setMapRotation`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`mapRotationChanged`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setDrawAnnotations( bool draw );
|
|
|
|
%Docstring
|
2018-01-18 06:59:57 +10:00
|
|
|
Sets whether annotations are drawn within the map.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`drawAnnotations`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool drawAnnotations() const;
|
|
|
|
%Docstring
|
2018-01-18 06:59:57 +10:00
|
|
|
Returns whether annotations are drawn within the map.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setDrawAnnotations`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
bool atlasDriven() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns whether the map extent is set to follow the current atlas feature.
|
|
|
|
|
|
|
|
:return: true if map will follow the current atlas feature.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setAtlasDriven`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`atlasScalingMode`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setAtlasDriven( bool enabled );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether the map extent will follow the current atlas feature.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param enabled: set to true if the map extents should be set by the current atlas feature.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`atlasDriven`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setAtlasScalingMode`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
AtlasScalingMode atlasScalingMode() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the current atlas scaling mode. This controls how the map's extents
|
|
|
|
are calculated for the current atlas feature when an atlas composition
|
|
|
|
is enabled.
|
|
|
|
|
|
|
|
:return: the current scaling mode
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
this parameter is only used if atlasDriven() is true
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setAtlasScalingMode`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`atlasDriven`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setAtlasScalingMode( AtlasScalingMode mode );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the current atlas scaling mode. This controls how the map's extents
|
|
|
|
are calculated for the current atlas feature when an atlas composition
|
|
|
|
is enabled.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param mode: atlas scaling mode to set
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
this parameter is only used if atlasDriven() is true
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`atlasScalingMode`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`atlasDriven`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
double atlasMargin( QgsLayoutObject::PropertyValueType valueType = QgsLayoutObject::EvaluatedValue );
|
2017-10-20 16:42:35 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the margin size (percentage) used when the map is in atlas mode.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param valueType: controls whether the returned value is the user specified atlas margin,
|
2018-05-24 21:21:14 +10:00
|
|
|
or the current evaluated atlas margin (which may be affected by data driven atlas margin
|
|
|
|
settings).
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
:return: margin size in percentage to leave around the atlas feature's extent
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
this is only used if atlasScalingMode() is Auto.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`atlasScalingMode`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setAtlasMargin`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setAtlasMargin( double margin );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the margin size (percentage) used when the map is in atlas mode.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param margin: size in percentage to leave around the atlas feature's extent
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
this is only used if atlasScalingMode() is Auto.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`atlasScalingMode`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`atlasMargin`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
2017-10-21 14:37:54 +10:00
|
|
|
QgsLayoutItemMapGridStack *grids();
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the map item's grid stack, which is used to control how grids
|
|
|
|
are drawn over the map's contents.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`grid`
|
2017-10-21 14:37:54 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsLayoutItemMapGrid *grid();
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the map item's first grid. This is a convenience function.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`grids`
|
2017-10-21 14:37:54 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsLayoutItemMapOverviewStack *overviews();
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the map item's overview stack, which is used to control how overviews
|
|
|
|
are drawn over the map's contents.
|
|
|
|
|
|
|
|
:return: pointer to overview stack
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`overview`
|
2017-10-21 14:37:54 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsLayoutItemMapOverview *overview();
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the map item's first overview. This is a convenience function.
|
|
|
|
|
|
|
|
:return: pointer to first overview for map item
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`overviews`
|
2017-10-21 14:37:54 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual QgsExpressionContext createExpressionContext() const;
|
|
|
|
|
|
|
|
|
2017-10-24 17:50:58 +10:00
|
|
|
double mapUnitsToLayoutUnits() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the conversion factor from map units to layout units.
|
|
|
|
This is calculated using the width of the map item and the width of the
|
|
|
|
current visible map extent.
|
2017-10-24 17:50:58 +10:00
|
|
|
%End
|
|
|
|
|
2018-01-18 12:08:59 +10:00
|
|
|
QgsMapSettings mapSettings( const QgsRectangle &extent, QSizeF size, double dpi, bool includeLayerSettings ) const;
|
2017-10-24 17:50:58 +10:00
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Returns map settings that will be used for drawing of the map.
|
2018-01-18 12:08:59 +10:00
|
|
|
|
|
|
|
If ``includeLayerSettings`` is true, than settings specifically relating to map layers and map layer styles
|
|
|
|
will be calculated. This can be expensive to calculate, so if they are not required in the map settings
|
|
|
|
(e.g. for map settings which are used for scale related calculations only) then ``includeLayerSettings`` should be false.
|
2017-10-24 17:50:58 +10:00
|
|
|
%End
|
|
|
|
|
2017-11-30 08:08:40 +10:00
|
|
|
virtual void finalizeRestoreFromXml();
|
|
|
|
|
|
|
|
|
2017-07-14 13:14:02 +10:00
|
|
|
protected:
|
|
|
|
|
2018-02-19 16:04:46 +10:00
|
|
|
virtual void draw( QgsLayoutItemRenderContext &context );
|
2017-07-14 13:14:02 +10:00
|
|
|
|
2017-10-24 12:02:57 +10:00
|
|
|
virtual bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const;
|
|
|
|
|
|
|
|
virtual bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context );
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
|
|
|
|
bool isDrawing() const;
|
|
|
|
%Docstring
|
|
|
|
True if a draw is already in progress
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual QRectF boundingRect() const;
|
|
|
|
|
|
|
|
|
|
|
|
QPolygonF transformedMapPolygon() const;
|
|
|
|
%Docstring
|
|
|
|
Returns extent that considers rotation and shift with mOffsetX / mOffsetY
|
|
|
|
%End
|
|
|
|
|
|
|
|
QPointF mapToItemCoords( QPointF mapCoords ) const;
|
|
|
|
%Docstring
|
|
|
|
Transforms map coordinates to item coordinates (considering rotation and move offset)
|
|
|
|
%End
|
|
|
|
|
|
|
|
QgsRectangle requestedExtent() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Calculates the extent to request and the yShift of the top-left point in case of rotation.
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
signals:
|
2017-10-24 22:02:14 +10:00
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
void extentChanged();
|
2017-10-24 22:02:14 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Is emitted when the map's extent changes.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setExtent`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`extent`
|
2017-10-24 22:02:14 +10:00
|
|
|
%End
|
2017-10-20 16:42:35 +10:00
|
|
|
|
|
|
|
void mapRotationChanged( double newRotation );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Is emitted when the map's rotation changes.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setMapRotation`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`mapRotation`
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void preparedForAtlas();
|
|
|
|
%Docstring
|
|
|
|
Is emitted when the map has been prepared for atlas rendering, just before actual rendering
|
|
|
|
%End
|
|
|
|
|
|
|
|
void layerStyleOverridesChanged();
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when layer style overrides are changed... a means to let
|
|
|
|
associated legend items know they should update
|
2017-10-20 16:42:35 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
2017-12-23 17:50:25 +10:00
|
|
|
virtual void refresh();
|
|
|
|
|
|
|
|
|
2017-10-21 10:50:10 +10:00
|
|
|
virtual void invalidateCache();
|
|
|
|
|
2017-10-20 16:42:35 +10:00
|
|
|
|
|
|
|
void updateBoundingRect();
|
|
|
|
%Docstring
|
|
|
|
Updates the bounding rect of this item. Call this function before doing any changes related to annotation out of the map rectangle
|
|
|
|
%End
|
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
|
2017-10-20 16:42:35 +10:00
|
|
|
|
|
|
|
|
2017-07-14 13:14:02 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/layout/qgslayoutitemmap.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|