QGIS – Dynamically Displaying Feature Labels in Decorations Title Bar

animationdynamic-layerqgistemporal-controllertime series

Related: Display label depending on timedate attribute used by Temporal Controller

Following the linked thread, I have managed to display labels according to what Temporal Controller prompts using the rule @map_start_time <= "time" and "time" <= @map_end_time

On this tutorial, point 11, you can see how the date is dynamically changing. Would it be possible to display the aforementioned labels but, instead of next to their respective points, dynamically inside the Title Bar from the Decorations section?

Best Answer

Using this formula in the Title Bar custom expression should work, "stop_name" being the layer attribute you want do display as a Label:

    aggregate(
         layer:='your_layer_name',aggregate:='concatenate_unique',
         expression:="stop_name",
         filter:=@map_start_time <= "time" and "time" <= @map_end_time,
         concatenator:=',')

enter image description here

This formula will list the Label name that match the current time window, separated by commas