Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEATURE] item_variables expression function inside compositions
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'))
- Loading branch information
1 parent
d25fcec
commit f2032ea
Showing
5 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"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"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters