qgis-js icon indicating copy to clipboard operation
qgis-js copied to clipboard

Expose QgsLayerTree in the API

Open boardend opened this issue 1 year ago • 2 comments

The current MapLayer implementation cannot deal with hierarchical layers (e.g. layer groups).

Instead of doing our own abstraction, we should expose the QGIS internals: QgsLayerTree, QgsLayerTreeModel, QgsLayerTreeNode, QgsLayerTreeGroup, QgsLayerTreeLayer.

Based on this API, one should be able to build a hierarchical layer tree widget.

boardend avatar Jan 20 '24 08:01 boardend

+1 ... exposing layer tree will be useful.

One note: QgsLayerTreeModel is most likely not needed here - it is mainly used for Qt model/view stuff.

wonder-sk avatar Jan 21 '24 11:01 wonder-sk

(And it would be very useful to also have a GUI widget which could be used to control the layer tree!)

wonder-sk avatar Jan 21 '24 11:01 wonder-sk