Nyall Dawson f7a7a24edb Make map id optional in map_credits layout function
If not specified, the credits for ALL layers from ALL maps
will be collected
2023-04-13 17:44:37 +10:00

33 lines
1.5 KiB
Plaintext

{
"name": "map_credits",
"type": "function",
"groups": ["Layout"],
"description": "Returns a list of credit (usage rights) strings for the layers shown in a layout, or specific layout map item.",
"arguments": [{
"arg": "id",
"optional": true,
"description": "Map item ID. If not specified, the layers from all maps in the layout will be used."
}, {
"arg": "include_layer_names",
"description": "Set to true to include layer names before their credit strings",
"optional": true,
"default": "false"
}, {
"arg": "layer_name_separator",
"description": "String to insert between layer names and their credit strings, if include_layer_names is true",
"optional": true,
"default": "': '"
}],
"examples": [{
"expression": "array_to_string( map_credits() )",
"returns": "comma separated list of layer credits for all layers shown in all map items in the layout, e.g 'CC-BY-NC, CC-BY-SA'"
}, {
"expression": "array_to_string( map_credits( 'Main Map' ) )",
"returns": "comma separated list of layer credits for layers shown in the 'Main Map' layout item, e.g 'CC-BY-NC, CC-BY-SA'"
}, {
"expression": "array_to_string( map_credits( 'Main Map', include_layer_names := true, layer_name_separator := ': ' ) )",
"returns": "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'"
}],
"tags": ["list", "rights", "layers", "layout", "item", "usage", "credit", "strings", "map"]
}