Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
allow temporal layout item map
  • Loading branch information
vcloarec authored and nyalldawson committed Apr 16, 2020
1 parent 11a9061 commit 9377ec4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/core/auto_generated/layout/qgslayoutitemmap.sip.in
Expand Up @@ -9,7 +9,7 @@



class QgsLayoutItemMap : QgsLayoutItem
class QgsLayoutItemMap : QgsLayoutItem, QgsTemporalRangeObject
{
%Docstring
Layout graphical items for displaying a map.
Expand Down
3 changes: 3 additions & 0 deletions src/3d/qgslayoutitem3dmap.cpp
Expand Up @@ -136,6 +136,9 @@ void QgsLayoutItem3DMap::draw( QgsLayoutItemRenderContext &context )
QSize sizePixelsInt = QSize( static_cast<int>( std::ceil( sizePixels.width() ) ),
static_cast<int>( std::ceil( sizePixels.height() ) ) );

if ( isTemporal() )
mSettings->setTemporalRange( temporalRange() );

if ( !mEngine )
{
mEngine.reset( new QgsOffscreen3DEngine );
Expand Down
4 changes: 2 additions & 2 deletions src/3d/qgslayoutitem3dmap.h
Expand Up @@ -19,7 +19,7 @@
#include "qgis_3d.h"

#include "qgslayoutitem.h"

#include "qgstemporalrangeobject.h"
#include "qgscamerapose.h"


Expand All @@ -34,7 +34,7 @@ class QgsOffscreen3DEngine;
*
* \since QGIS 3.4
*/
class _3D_EXPORT QgsLayoutItem3DMap : public QgsLayoutItem
class _3D_EXPORT QgsLayoutItem3DMap : public QgsLayoutItem, public QgsTemporalRangeObject
{
Q_OBJECT

Expand Down
3 changes: 3 additions & 0 deletions src/core/layout/qgslayoutitemmap.cpp
Expand Up @@ -1455,6 +1455,9 @@ QgsMapSettings QgsLayoutItemMap::mapSettings( const QgsRectangle &extent, QSizeF
jobMapSettings.addRenderedFeatureHandler( handler );
}

if ( isTemporal() )
jobMapSettings.setTemporalRange( temporalRange() );

return jobMapSettings;
}

Expand Down
3 changes: 2 additions & 1 deletion src/core/layout/qgslayoutitemmap.h
Expand Up @@ -25,6 +25,7 @@
#include "qgslayoutitemmapgrid.h"
#include "qgslayoutitemmapoverview.h"
#include "qgsmaprendererstagedrenderjob.h"
#include "qgstemporalrangeobject.h"

class QgsAnnotation;
class QgsRenderedFeatureHandlerInterface;
Expand All @@ -35,7 +36,7 @@ class QgsRenderedFeatureHandlerInterface;
* \brief Layout graphical items for displaying a map.
* \since QGIS 3.0
*/
class CORE_EXPORT QgsLayoutItemMap : public QgsLayoutItem
class CORE_EXPORT QgsLayoutItemMap : public QgsLayoutItem, public QgsTemporalRangeObject
{

Q_OBJECT
Expand Down

0 comments on commit 9377ec4

Please sign in to comment.