Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[layouts] Add shortcut to insert map projection description as
dynamic text
  • Loading branch information
nyalldawson committed May 11, 2021
1 parent ca26f60 commit 8aba877
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gui/layout/qgslayoutlabelwidget.cpp
Expand Up @@ -22,6 +22,7 @@
#include "qgsguiutils.h"
#include "qgslayoutitemmap.h"
#include "qgsvectorlayer.h"
#include "qgsprojoperation.h"

#include <QColorDialog>
#include <QFontDialog>
Expand Down Expand Up @@ -145,6 +146,7 @@ void QgsLayoutLabelWidget::buildInsertDynamicTextMenu( QgsLayout *layout, QMenu
std::make_pair( tr( "CRS Name (%1)" ).arg( map->crs().description() ), QStringLiteral( "item_variables('%1')['map_crs_description']" ).arg( map->id() ) ),
std::make_pair( tr( "Ellipsoid Name (%1)" ).arg( map->crs().ellipsoidAcronym() ), QStringLiteral( "item_variables('%1')['map_crs_ellipsoid']" ).arg( map->id() ) ),
std::make_pair( tr( "Units (%1)" ).arg( QgsUnitTypes::toString( map->crs().mapUnits() ) ), QStringLiteral( "item_variables('%1')['map_units']" ).arg( map->id() ) ),
std::make_pair( tr( "Projection (%1)" ).arg( map->crs().operation().description() ), QStringLiteral( "item_variables('%1')['map_crs_projection']" ).arg( map->id() ) ),
} )
{
addExpression( mapMenu, expression.first, expression.second );
Expand Down

0 comments on commit 8aba877

Please sign in to comment.