[QGIS-Developer] PyQGIS: how to start the Temporal Animation?

Richard Duivenvoorde rdmailings at duif.net
Thu Aug 27 04:47:56 PDT 2020


On 8/27/20 12:45 PM, Richard Duivenvoorde wrote:
> Hi,
> 
> I'm registring a Temporal Layer fine now, but want to start the 'Temporal Controller' to start via PyQGIS (in a plugin).
> 
> This class: QgsTemporalNavigationObject has the 'play()' methods etc.
> 
> The QgsTemporalControllerWidget returns a temporalController..
> 
> So I was guessing I need to ask current Temporal Widget to hand me it's controller or navigation object to be able to start to 'play'.

Ok, just found out that I can get the temporalController of the MapCanvas, and then at least play and stop the animations:

c = iface.mapCanvas().temporalController()
c.setFrameDuration(2)
c.rewindToStart()
#c.skipToEnd()
#c.next()
#c.previous()
c.playForward()

But on this instance of QgsTemporalController, I can NOT 
see https://qgis.org/pyqgis/master/core/QgsTemporalNavigationObject.html
use 
c.setTemporalExtents(range)
or ask for the extents
c.setTemporalExtents()
or set the framerate 
c.setFramesPerSecond(2.0)
etc:

anybody can enlighten me?

Regards,

Richard 


More information about the QGIS-Developer mailing list