mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
This adds a new item_variables expression function when expressions are used inside a composition context. The function takes a single argument, the id for an item inside the composition, and returns a map of variable name to value for that item. This allows you to do things like insert text in a label fetching properties of another item in the composition, eg Insert scale of map into a label: map_get( item_variables( 'map'),'map_scale') Insert x coordinate of map center into a label: x(map_get( item_variables( 'map'),'map_extent_center'))
9 lines
317 B
Plaintext
9 lines
317 B
Plaintext
{
|
|
"name": "item_variables",
|
|
"type": "function",
|
|
"description": "Returns a map of variables from a composer item inside this composition.",
|
|
"arguments": [ {"arg":"id","description":"composer item ID"}],
|
|
"examples": [ { "expression":"map_get(item_variables('main_map'), 'map_scale')", "returns":"2000"}
|
|
]
|
|
}
|