[GRASS-SVN] r60104 - in grass/trunk/gui/wxpython: core mapdisp mapwin
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon May 5 02:52:45 PDT 2014
Author: hamish
Date: 2014-05-05 02:52:45 -0700 (Mon, 05 May 2014)
New Revision: 60104
Modified:
grass/trunk/gui/wxpython/core/render.py
grass/trunk/gui/wxpython/mapdisp/frame.py
grass/trunk/gui/wxpython/mapwin/decorations.py
Log:
Vaclav: add support for 3D raster legends (#2083)
Modified: grass/trunk/gui/wxpython/core/render.py
===================================================================
--- grass/trunk/gui/wxpython/core/render.py 2014-05-05 09:45:45 UTC (rev 60103)
+++ grass/trunk/gui/wxpython/core/render.py 2014-05-05 09:52:45 UTC (rev 60104)
@@ -358,7 +358,7 @@
@param id overlay id (for PseudoDC)
@param type overlay type ('barscale', 'legend', etc.)
@param cmd GRASS command to render overlay,
- given as list, e.g. ['d.legend', 'map=elevation at PERMANENT']
+ given as list, e.g. ['d.legend', 'rast=elevation at PERMANENT']
@param Map render.Map instance
@param active layer is active, will be rendered only if True
@param hidden layer is hidden, won't be listed in Layer Manager if True
Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py 2014-05-05 09:45:45 UTC (rev 60103)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py 2014-05-05 09:52:45 UTC (rev 60104)
@@ -1072,15 +1072,15 @@
for i, legendParam in enumerate(self.legend.cmd[1:]):
idx = i + 1
param, val = legendParam.split('=')
- if param == 'map':
- self.legend.cmd[idx] = 'map={rast}'.format(rast=layer.maplayer.name)
+ if param == 'rast':
+ self.legend.cmd[idx] = 'rast={rast}'.format(rast=layer.maplayer.name)
isMap = True
elif param in ('use', 'range'):
# clear range or use to avoid problems
del self.legend.cmd[idx]
if not isMap: # for the first time
- self.legend.cmd.append('map=%s' % layer.maplayer.name)
+ self.legend.cmd.append('rast=%s' % layer.maplayer.name)
break
if not showDialog and self.legend.CmdIsValid():
Modified: grass/trunk/gui/wxpython/mapwin/decorations.py
===================================================================
--- grass/trunk/gui/wxpython/mapwin/decorations.py 2014-05-05 09:45:45 UTC (rev 60103)
+++ grass/trunk/gui/wxpython/mapwin/decorations.py 2014-05-05 09:52:45 UTC (rev 60104)
@@ -229,9 +229,14 @@
return x, y
def CmdIsValid(self):
+ inputs = 0
for param in self._cmd:
param = param.split('=')
- if param[0] == 'map' and len(param) == 2:
+ if param[0] == 'rast' and len(param) == 2:
+ inputs += 1
+ elif param[0] == 'rast3d' and len(param) == 2:
+ inputs += 1
+ if inputs == 1:
return True
return False
More information about the grass-commit
mailing list