Skip to content

Commit

Permalink
fix: show layer inside the layer subgroup (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi authored and petrasovaa committed Mar 6, 2020
1 parent 430b427 commit 2509f45
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions gui/wxpython/lmgr/layertree.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ def OnLayerContextMenu(self, event):
wx.EVT_MENU,
self.OnSetCompRegFromMap,
id=self.popupID['region'])
# raster align

# raster align
if ltype and ltype == "raster" and len(selected) == 1:
item = wx.MenuItem(
self.popupMenu,
Expand Down Expand Up @@ -1654,8 +1654,10 @@ def OnLayerChecked(self, event):
digitToolbar
and digitToolbar.GetLayer() !=
mapLayer):
# ignore when map layer is edited
self.Map.ChangeLayerActive(mapLayer, checked)
# layer is maplayer type
if mapLayer:
# ignore when map layer is edited
self.Map.ChangeLayerActive(mapLayer, checked)
self.lmgr.WorkspaceChanged()
child = self.GetNextSibling(child)
else:
Expand Down Expand Up @@ -2039,15 +2041,15 @@ def GetOptData(self, dcmd, layer, params, propwin):
if mapLayer.type == 'raster':
if mapWin.IsLoaded(layer):
mapWin.UnloadRaster(layer)

mapWin.LoadRaster(layer)

elif mapLayer.type == 'raster_3d':
if mapWin.IsLoaded(layer):
mapWin.UnloadRaster3d(layer)

mapWin.LoadRaster3d(layer)

elif mapLayer.type == 'vector':
if mapWin.IsLoaded(layer):
mapWin.UnloadVector(layer)
Expand All @@ -2056,7 +2058,7 @@ def GetOptData(self, dcmd, layer, params, propwin):
mapWin.LoadVector(layer, points=True)
if (vInfo['lines'] + vInfo['boundaries']) > 0:
mapWin.LoadVector(layer, points=False)

# reset view when first layer loaded
nlayers = len(
mapWin.Map.GetListOfLayers(
Expand Down

0 comments on commit 2509f45

Please sign in to comment.