QGIS 3.16
Looking to insert an expression to my layer, Survey Coverage
(text), in the legend. I want dynamic text to reflect the attribute value from the field, VIS_RADIUS
(Integer64) so it looks something like:
Survey Coverage (20 m)
Survey Coverage map layer id: Spatial_SurveyCoverage_Mission
Field: VIS_RADIUS
Map Item ID: Working Map
At present I have testing different expressions in the Legend Item Properties as follows:
Survey Coverage ([%to_string(display_expression(@Spatial_SurveyCoverage_Mission, "VIS_RADIUS"))%] m)
Survey Coverage ([%to_string(display_expression(@Spatial_SurveyCoverage_Mission, "VIS_RADIUS", map_get(item_variables('Working Map'), 'map_extent')))%] m)
Survey Coverage ([%layer_property('Survey Coverage', 'VIS_RADIUS')%] m)
All result in...
Survey Coverage ( m)
Ultimate goal is to reduce the amount of revisions to layouts for multi-map projects which I can share with colleagues to be more user-friendly.
Edit: Additional dynamic text using SQL to update as Map Extent is updated/moved
Map Layout Text Box Properties
[% map_get(item_variables('Working Map'),'map_crs_description') %]
Base Map Source: ESRI World Topo
Map data sources from BC Gazetteer [%layer_property(@NTS, 'title')%] [%map_get(item_variables('Working Map'), 'map_layers')%]
[%attribute(get_feature('nts_snrc_50k', 'NTS_SNRC', 'IS NOT NULL'), 'NTS_SNRC')%]
[%@map_layers%]
As seen in the below image, the 'map_crs_description' reveals text in a way I want. However, the text after BC Gazetteer does not appear in the text box display.
RE: aggregate expression
Solution provided yields no result...
Survey Coverage Layer Properties > Variables
note: the "display as" in Source is greyed out, unsure why or if it even effects this at all.