Explorar el Código

wxGUI:map composer - fixed https://trac.osgeo.org/grass/ticket/1483

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49005 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová hace 13 años
padre
commit
5c7471fc00
Se han modificado 1 ficheros con 14 adiciones y 7 borrados
  1. 14 7
      gui/wxpython/gui_modules/psmap_dialogs.py

+ 14 - 7
gui/wxpython/gui_modules/psmap_dialogs.py

@@ -2602,24 +2602,31 @@ class RasterPanel(wx.Panel):
         
     def update(self):
         #draw raster
-        map = self.instruction.FindInstructionByType('map')
+        mapInstr = self.instruction.FindInstructionByType('map')
+        if not mapInstr: # no map frame
+            GMessage(message = _("Please, create map frame first."))
+            return
+            
         if self.rasterNoRadio.GetValue() or not self.rasterSelect.GetValue():
             self.rasterDict['isRaster'] = False
             self.rasterDict['raster'] = None
-            map['drawMap'] = False
+            mapInstr['drawMap'] = False
             if self.id in self.instruction:
                 del self.instruction[self.id]
 
         else:
             self.rasterDict['isRaster'] = True
             self.rasterDict['raster'] = self.rasterSelect.GetValue()
-            if self.rasterDict['raster'] != map['drawMap']:
-                map['drawMap'] = False
-            
-            if self.id not in self.instruction:
+            if self.rasterDict['raster'] != mapInstr['drawMap']:
+                mapInstr['drawMap'] = False
+
+            raster = self.instruction.FindInstructionByType('raster')
+            if not raster:
                 raster = Raster(self.id)
                 self.instruction.AddInstruction(raster)
-            self.instruction[self.id].SetInstruction(self.rasterDict)
+                self.instruction[self.id].SetInstruction(self.rasterDict)
+            else:
+                self.instruction[raster.id].SetInstruction(self.rasterDict)
             
         if 'map' in self.mainDialog.parent.openDialogs:
             self.mainDialog.parent.openDialogs['map'].updateDialog()