Explorar el Código

wxGUI: link wx.wms (gsoc) for testing

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47317 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa hace 13 años
padre
commit
8b5d8afd9d

BIN
gui/icons/grass/layer-wms-add.png


+ 2 - 0
gui/wxpython/gui_modules/toolbars.py

@@ -1414,6 +1414,8 @@ class LMWorkspaceToolbar(AbstractToolbar):
         icons = Icons['layerManager']
         return self._getToolbarData((('newdisplay', icons["newdisplay"],
                                       self.parent.OnNewDisplay),
+                                     ('newdisplay', icons["newdisplayWMS"],
+                                      self.parent.OnNewDisplayWMS),
                                      (None, ),
                                      ('workspaceNew', icons["workspaceNew"],
                                       self.parent.OnWorkspaceNew),

+ 2 - 0
gui/wxpython/icons/icon.py

@@ -165,6 +165,8 @@ Icons = {
     'layerManager' : {
         'newdisplay'   : MetaIcon(img = iconSet.get('monitor-create', wx.ART_ERROR),
                                   label = _('Start new map display')),
+        'newdisplayWMS' : MetaIcon(img = iconSet.get('layer-wms-add', wx.ART_ERROR),
+                                   label = _('Start new map display (experimental WMS support)')),
         'workspaceNew'  : MetaIcon(img = iconSet.get('create', wx.ART_ERROR),
                                    label = _('Create new workspace (Ctrl+N)')),
         'workspaceOpen' : MetaIcon(img = iconSet.get('open', wx.ART_ERROR),

+ 16 - 0
gui/wxpython/wxgui.py

@@ -1236,6 +1236,22 @@ class GMFrame(wx.Frame):
         # show ATM window
         dbmanager.Show()
         
+    def OnNewDisplayWMS(self, event = None):
+        """!Create new layer tree and map display instance"""
+        self.NewDisplayWMS()
+
+    def NewDisplayWMS(self, show = True):
+        Debug.msg(1, "GMFrame.NewDisplay(): idx=%d" % self.disp_idx)
+        try:
+            from gui_modules.wmsmenu import DisplayWMSMenu
+        except:
+            gcmd.GError(parent = self.parent,
+                        message = _("Experimental WMS support for wxGUI not available. You can install it by %s") % \
+                            'g.extension -s extension=wx.wms')
+            return
+        
+    	DisplayWMSMenu()
+    
     def OnNewDisplay(self, event = None):
         """!Create new layer tree and map display instance"""
         self.NewDisplay()

+ 6 - 0
gui/wxpython/xml/menudata.xml

@@ -735,6 +735,12 @@
 	  <label>GSoC testing</label>
 	  <items>
 	    <menuitem>
+	      <label>WMS</label>
+	      <help>Experimental WMS support for wxGUI</help>
+	      <keywords>display,wms</keywords>
+	      <handler>OnNewDisplayWMS</handler>
+	    </menuitem>
+	    <menuitem>
 	      <label>RStream</label>
 	      <help>GUI for hydrological modelling (r.stream.*)</help>
 	      <keywords>raster,hydrology</keywords>