Project: QGIS

Version: 3.18

Feature: Add map_credits function

A map_credits function was added that collates a list of all the layer metadata attribution strings for the layers shown inside a specified map item.

For example:

array_to_string( map_credits( 'Main Map' ) )

Returns a comma-separated list of layer credits for layers shown in the 'Main Map' layout item, e.g 'CC-BY-NC, CC-BY-SA'

There's an optional include_layer_names argument you can use to include layer names before their attribution:

array_to_string( map_credits( 'Main Map',
   include_layer_names := true,
   layer_name_separator := ': ' ) )

This would return a comma-separated list of layer names and their credits for layers shown in the 'Main Map' layout item, e.g. 'Railway lines: CC-BY-NC, Basemap: CC-BY-SA'

This feature was funded by SLYR

This feature was developed by Nyall Dawson