Skip to content
Permalink
Browse files

One day is today

  • Loading branch information
nirvn committed May 10, 2020
1 parent 3675af1 commit 16a45f4e224eaf9fd79664a5122e095640c72228
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/core/layout/qgslayoutitemmap.cpp
@@ -1561,10 +1561,9 @@ QgsExpressionContext QgsLayoutItemMap::createExpressionContext() const

scope->addFunction( QStringLiteral( "is_layer_visible" ), new QgsExpressionContextUtils::GetLayerVisibility( layersInMap, scale() ) );

// maybe one day we'll populate these with real values!
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_start_time" ), QVariant(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_end_time" ), QVariant(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_interval" ), QVariant(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_start_time" ), isTemporal() ? temporalRange().begin() : QVariant(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_end_time" ), isTemporal() ? temporalRange().end() : QVariant(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_interval" ), isTemporal() ? ( temporalRange().end() - temporalRange().begin() ) : QVariant(), true ) );

return context;
}

0 comments on commit 16a45f4

Please sign in to comment.
You can’t perform that action at this time.