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

Thomas Gratier osgeo.mailinglist at gmail.com
Thu Aug 27 05:38:23 PDT 2020


Hi,

Could be wrong but you may need to "sync" canvas with your
QgsTemporalController e.g below method

iface.mapCanvas().setTemporalController(yourTemporalControllerInstance)


Regards

Thomas


Le jeu. 27 août 2020 à 13:48, Richard Duivenvoorde <rdmailings at duif.net> a
écrit :

> 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
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200827/c977da50/attachment.html>


More information about the QGIS-Developer mailing list