/[thuban]/branches/WIP-pyshapelib-bramz/Extensions/wms/wms.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Extensions/wms/wms.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2154 by joey, Sat Apr 10 19:07:59 2004 UTC revision 2172 by joey, Tue Apr 13 17:38:26 2004 UTC
# Line 37  from Thuban.Model.resource import get_sy Line 37  from Thuban.Model.resource import get_sy
37       EPSG_DEPRECATED_PROJ_FILE       EPSG_DEPRECATED_PROJ_FILE
38  from Thuban.UI.command import registry, Command  from Thuban.UI.command import registry, Command
39  import Thuban.UI.mainwindow  import Thuban.UI.mainwindow
40    from Thuban.UI.common import ThubanBeginBusyCursor, ThubanEndBusyCursor
41  from Thuban import _  from Thuban import _
42  import Thuban.UI.baserenderer  import Thuban.UI.baserenderer
43    
# Line 83  class WMSLayer(BaseLayer): Line 84  class WMSLayer(BaseLayer):
84          self.capabilities = None          self.capabilities = None
85    
86          # Change the cursor to demonstrate that we're busy but working          # Change the cursor to demonstrate that we're busy but working
87          wxBeginBusyCursor()          ThubanBeginBusyCursor()
88          self.capabilities = WMSCapabilities(url)          self.capabilities = WMSCapabilities(url)
89          wxEndBusyCursor()          ThubanEndBusyCursor()
90    
91          # name of the top layer of the remote map          # name of the top layer of the remote map
92          foo = self.capabilities.getLayers()          foo = self.capabilities.getLayers()
# Line 130  class WMSLayer(BaseLayer): Line 131  class WMSLayer(BaseLayer):
131              self.error_msg = _('EPSG projection code %s not found!\n'\              self.error_msg = _('EPSG projection code %s not found!\n'\
132                                 'Setting projection to "None".\n'\                                 'Setting projection to "None".\n'\
133                                 'Please set an appropriate projection yourself.'\                                 'Please set an appropriate projection yourself.'\
134                                 % epsg_id)                                 % top_srs)
135    
136          # pre-determine the used format          # pre-determine the used format
137          self.wmsformat, self.format = \          self.wmsformat, self.format = \
# Line 200  class WMSLayer(BaseLayer): Line 201  class WMSLayer(BaseLayer):
201          image/wbmp or WBMP which refers to WAP bitmap format and is          image/wbmp or WBMP which refers to WAP bitmap format and is
202          not supported by the included render engine.          not supported by the included render engine.
203          """          """
204          prio = ['png', 'jpeg', 'jpg', 'tif', 'gif', 'bmp']          prio = ['jpeg', 'bmp']
205          for p in prio:          for p in prio:
206              for f in formats:              for f in formats:
207                  if f.lower().find(p) > -1:                  if f.lower().find(p) > -1:
# Line 214  class WMSLayer(BaseLayer): Line 215  class WMSLayer(BaseLayer):
215                        'maxx': bbox[2], 'maxy': bbox[3] }                        'maxx': bbox[2], 'maxy': bbox[3] }
216    
217          # Change the cursor to demonstrate that we're busy but working          # Change the cursor to demonstrate that we're busy but working
218          wxBeginBusyCursor()          ThubanBeginBusyCursor()
219    
220          wmsclient = WMSClient()          wmsclient = WMSClient()
221    
# Line 223  class WMSLayer(BaseLayer): Line 224  class WMSLayer(BaseLayer):
224          wms_response = wmsclient.getMap(self.url, self.wmsformat, width, height,          wms_response = wmsclient.getMap(self.url, self.wmsformat, width, height,
225                                     epsg_id, bbox_dict,                                     epsg_id, bbox_dict,
226                                     [self.layer_name], version = self.capabilities.getVersion())                                     [self.layer_name], version = self.capabilities.getVersion())
227          wxEndBusyCursor()          ThubanEndBusyCursor()
228          return wms_response, self.format          return wms_response, self.format
229    
230    
# Line 300  def wms_dialog(context): Line 301  def wms_dialog(context):
301    
302      if dialog.ShowModal() == wxID_OK:      if dialog.ShowModal() == wxID_OK:
303          url = dialog.url          url = dialog.url
304            if len(url) == 0:
305                url = None
306      else:      else:
307          url = None          url = None
308      dialog.Destroy()      dialog.Destroy()

Legend:
Removed from v.2154  
changed lines
  Added in v.2172

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26