You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a QGIS project has a layer group set to visible==false, setting the visibility of the individual layers to true in QGIS-js does not render the layers on the map.
Steps to reproduce:
Create a QGIS project
Create a layer group with at least one layer, and set it to invisible (via the checkbox in the layer list)
Open the QGIS project with QGIS-js (e.g. on demo site)
Try to switch on the layer that is in the group
Actual result:
Layer is not displayed on the map
Expected result:
Layer is displayed on the map
Example:
(last two layers should render a choropleth map)
The text was updated successfully, but these errors were encountered:
amuedespacher
changed the title
QGIS layers with initial visible==false cannot be rendered
QGIS layers with initial visibility==false cannot be rendered
Jan 17, 2024
amuedespacher
changed the title
QGIS layers with initial visibility==false cannot be rendered
QGIS layers within layer groups with visibility=false cannot be displayed
Jan 18, 2024
I did some more testing, and the issue can be narrowed down to more specific cases, where layer groups are used. I updated the description of the issue accordingly.
I did a quick test switching to isVisible() and setItemVisibilityCheckedParentRecursive() which helps to actually show the layer as not visible and to be able to set the invisible group to visible. But will then also make the whole group invisible when just one layer should be set to invisible.
The whole MapLayer implementation was just a quick shot to get a basic example working (without thinking about groups at that point). IMHO the only sane solution is to actually expose the QGIS internals: QgsLayerTree, QgsLayerTreeModel, QgsLayerTreeNode, QgsLayerTreeGroup, QgsLayerTreeLayer. And then build a hierarchical layer widget on top of that.
If a QGIS project has a layer group set to visible==false, setting the visibility of the individual layers to true in QGIS-js does not render the layers on the map.
Steps to reproduce:
Actual result:
Expected result:
Example:
(last two layers should render a choropleth map)
The text was updated successfully, but these errors were encountered: