Class: QgsMapLayerTemporalProperties¶
Base class for storage of map layer temporal properties.
QgsMapLayerTemporalProperties
exposes user-configurable
settings for controlling how an individual QgsMapLayer
behaves in a temporal context, e.g. while animating a map object.
Added in version 3.14.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: readXml()
, setDefaultsFromDataProviderTemporalCapabilities()
, writeXml()
Class Hierarchy¶
Base classes¶
Base class for temporal property. |
|
Subclasses¶
Implementation of map layer temporal properties for mesh layers. |
|
Implementation of map layer temporal properties for raster layers. |
|
Implementation of map layer temporal properties for vector layers. |
Abstract Methods
Reads temporal properties from a DOM element previously written by |
|
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities. |
|
Writes the properties to a DOM element, to be used later with |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsMapLayerTemporalProperties. See the FAQ for more details.
Attempts to calculate the overall list of all temporal extents which are contained in the specified layer, using the settings defined by the temporal properties object. |
|
Returns |
- class qgis.core.QgsMapLayerTemporalProperties[source]¶
Bases:
QgsTemporalProperty
- __init__(parent: QObject | None, enabled: bool = False)
Constructor for QgsMapLayerTemporalProperties, with the specified
parent
object.The
enabled
argument specifies whether the temporal properties are initially enabled or not (seeisActive()
).- Parameters:
parent (Optional[QObject])
enabled (bool = False)
- virtual allTemporalRanges(self, layer: QgsMapLayer | None) List[QgsDateTimeRange] ¶
Attempts to calculate the overall list of all temporal extents which are contained in the specified
layer
, using the settings defined by the temporal properties object.May return an empty list if the ranges could not be calculated.
Added in version 3.20.
- Parameters:
layer (Optional[QgsMapLayer])
- Return type:
List[QgsDateTimeRange]
- virtual isVisibleInTemporalRange(self, range: QgsDateTimeRange) bool [source]¶
Returns
True
if the layer should be visible and rendered for the specified timerange
.- Parameters:
range (QgsDateTimeRange)
- Return type:
bool
- abstract readXml(self, element: QDomElement, context: QgsReadWriteContext) bool [source]¶
Reads temporal properties from a DOM
element
previously written bywriteXml()
.See also
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- Return type:
bool
- abstract setDefaultsFromDataProviderTemporalCapabilities(self, capabilities: QgsDataProviderTemporalCapabilities | None)[source]¶
Sets the layers temporal settings to appropriate defaults based on a provider’s temporal
capabilities
.- Parameters:
capabilities (Optional[QgsDataProviderTemporalCapabilities])
- abstract writeXml(self, element: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) QDomElement [source]¶
Writes the properties to a DOM
element
, to be used later withreadXml()
.See also
- Parameters:
element (QDomElement)
doc (QDomDocument)
context (QgsReadWriteContext)
- Return type:
QDomElement