QGIS – Displaying Labels Based on Timedate Attribute with Temporal Controller

animationqgistemporal-controllertime

I have a layer with two attribute columns: stop_name and schedule. I am animating this layer using Temporal Controller, so a dot displays on the map whenever the schedule time is active, as seen on this tutorial.

I would like to display the stop_name label whenever the relevant schedule attribute is active on Time Controller. I have tried, unsuccesfully, using CASE WHEN; however, I cannot figure out how to make this conditional dependant of what is displayed by the Temporal Controller.

Best Answer

Just create a lablel with the rule

@map_start_time <= "time" and "time" <= @map_end_time

enter image description here

and replace "time" with your datetime field.

Then set up the temporal settings of the layer to Redraw layer only.

enter image description here

Example result:

enter image description here