Skip to content

Commit

Permalink
Fix collapsing layers
Browse files Browse the repository at this point in the history
for some layers setExpanded(False) isn't working for some reason
so we need to expand first
  • Loading branch information
pathmapper committed Oct 21, 2022
1 parent 5ea8f60 commit 6b959f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xplan_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,8 +1014,10 @@ def addXplanLayer(layername, gtype):
for group in [child for child in root.children() if child.nodeType() == 0]:
if new_group.name() == group.name():
for layer in group.findLayers():
if layer.isExpanded():
layer.setExpanded(False)
# for some layers setExpanded(False) isn't working for some reason
# so we need to expand first
layer.setExpanded(True)
layer.setExpanded(False)

# zoom to group / Zoom auf die Gruppe
self.iface.mapCanvas().setExtent(self.group_extent)
Expand Down

0 comments on commit 6b959f2

Please sign in to comment.