joey: thuban/Extensions/wms layer.py,1.3,1.4

cvs@intevation.de cvs at intevation.de
Thu Apr 15 18:06:26 CEST 2004


Author: joey

Update of /thubanrepository/thuban/Extensions/wms
In directory doto:/tmp/cvs-serv3794

Modified Files:
	layer.py 
Log Message:
Move away from using only one layer to using a list of layers
(unsorted at the moment, though).  Added two convenience methods for
retrieving and setting the list of visible layers (get/setVisibleLayers)

Index: layer.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/wms/layer.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- layer.py	15 Apr 2004 08:52:47 -0000	1.3
+++ layer.py	15 Apr 2004 16:06:24 -0000	1.4
@@ -101,7 +101,7 @@
         self.bbox = None
         self.latlonbbox = None
         self.error_msg = None
-        self.layer_name = None
+        self.wms_layers = []
         self.capabilities = None
 
         # Change the cursor to demonstrate that we're busy but working
@@ -116,7 +116,7 @@
                                '%s') % url
             return
         top_layer = foo[0]
-        self.layer_name = top_layer
+        self.wms_layers = [top_layer]
 
         # first projection of the top layer
         foo = self.capabilities.getLayerSRS(top_layer)
@@ -294,6 +294,22 @@
         self.wmsformat = format
 
 
+    def getVisibleLayers(self):
+        """
+        Return the list of names for all visible layers
+
+        """
+        return self.wms_layers
+
+
+    def setVisibleLayers(self, layers):
+        """
+        Set the list of names for all visible layers
+
+        """
+        self.wms_layers = layers
+
+
     def GetMapImg(self, width, height, bbox):
         """
         Retrieve a new map from the WMS server and return it
@@ -317,6 +333,6 @@
 
         wms_response = wmsclient.getMap(self.url, self.wmsformat, width, height,
                                    epsg_id, bbox_dict,
-                                   [self.layer_name], version = self.capabilities.getVersion())
+                                   self.wms_layers, version = self.capabilities.getVersion())
         ThubanEndBusyCursor()
         return wms_response, self.format





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)