Class LayerTreeMapCanvasBridge
ClassList > LayerTreeMapCanvasBridge
#include <layertreemapcanvasbridge.h>
Inherits the following classes: QObject
Public Functions
| Type | Name |
|---|---|
| LayerTreeMapCanvasBridge (FlatLayerTreeModel * model, QgsQuickMapSettings * mapSettings, TrackingModel * trackingModel, QObject * parent=nullptr) Constructor: does not take ownership of the layer tree nor canvas. |
|
| bool | autoEnableCrsTransform () const |
| bool | autoSetupOnFirstLayer () const |
| QgsQuickMapSettings * | mapSettings () const |
| QgsLayerTree * | rootGroup () const |
| void | setAutoEnableCrsTransform (bool enabled) |
| void | setAutoSetupOnFirstLayer (bool enabled) |
| Q_INVOKABLE void | setCanvasLayers () force update of canvas layers from the layer tree. Normally this should not be needed to be called. |
Detailed Description
The QgsLayerTreeMapCanvasBridge class takes care of updates of layer set for QgsMapCanvas from a layer tree. The class listens to the updates in the layer tree and updates the list of layers for rendering whenever some layers are added, removed, or their visibility changes.
The update of layers is not done immediately - it is postponed, so a series of updates to the layer tree will trigger just one update of canvas layers.
Also allows the client to override the default order of layers. This is useful in advanced cases where the grouping in layer tree should be independent from the actual order in the canvas.
Passes to the legend (LayerTreeModel) the information, if the layer is in a tracking session
Public Functions Documentation
function LayerTreeMapCanvasBridge
Constructor: does not take ownership of the layer tree nor canvas.
LayerTreeMapCanvasBridge::LayerTreeMapCanvasBridge (
FlatLayerTreeModel * model,
QgsQuickMapSettings * mapSettings,
TrackingModel * trackingModel,
QObject * parent=nullptr
)
function autoEnableCrsTransform
inline bool LayerTreeMapCanvasBridge::autoEnableCrsTransform () const
function autoSetupOnFirstLayer
inline bool LayerTreeMapCanvasBridge::autoSetupOnFirstLayer () const
function mapSettings
inline QgsQuickMapSettings * LayerTreeMapCanvasBridge::mapSettings () const
function rootGroup
inline QgsLayerTree * LayerTreeMapCanvasBridge::rootGroup () const
function setAutoEnableCrsTransform
inline void LayerTreeMapCanvasBridge::setAutoEnableCrsTransform (
bool enabled
)
if enabled, will automatically turn on on-the-fly reprojection of layers if a layer with different source CRS is added
function setAutoSetupOnFirstLayer
inline void LayerTreeMapCanvasBridge::setAutoSetupOnFirstLayer (
bool enabled
)
if enabled, will automatically set full canvas extent and destination CRS + map units when first layer(s) are added
function setCanvasLayers [1/2]
force update of canvas layers from the layer tree. Normally this should not be needed to be called.
Q_INVOKABLE void LayerTreeMapCanvasBridge::setCanvasLayers ()
The documentation for this class was generated from the following file src/core/layertreemapcanvasbridge.h