1 |
# Copyright (C) 2003, 2004 by Intevation GmbH |
# Copyright (C) 2003, 2004 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Jan-Oliver Wagner <[email protected]> |
# Jan-Oliver Wagner <[email protected]> (2003, 2004) |
4 |
|
# Bernhard Herzog <[email protected]> (2004) |
5 |
|
# Martin Schulze <[email protected]> (2004) |
6 |
# |
# |
7 |
# This program is free software under the GPL (>=v2) |
# This program is free software under the GPL (>=v2) |
8 |
# Read the file COPYING coming with Thuban for details. |
# Read the file COPYING coming with Thuban for details. |
18 |
""" |
""" |
19 |
|
|
20 |
__version__ = "$Revision$" |
__version__ = "$Revision$" |
21 |
|
# $Source$ |
22 |
|
# $Id$ |
23 |
|
|
24 |
import os, sys |
import os, sys |
25 |
import xml.dom.minidom |
import xml.dom.minidom |
30 |
from Thuban.Model.proj import Projection |
from Thuban.Model.proj import Projection |
31 |
from Thuban.Model.extension import Extension |
from Thuban.Model.extension import Extension |
32 |
from Thuban.UI.command import registry, Command |
from Thuban.UI.command import registry, Command |
33 |
import Thuban.UI.mainwindow |
from Thuban.UI.mainwindow import main_menu, layer_properties_dialogs |
34 |
from Thuban import _ |
from Thuban import _ |
35 |
import Thuban.UI.baserenderer |
import Thuban.UI.baserenderer |
36 |
|
|
54 |
ymax = (offy - 0) / scale |
ymax = (offy - 0) / scale |
55 |
|
|
56 |
img, format = layer.GetMapImg(width, height, (xmin, ymin, xmax, ymax)) |
img, format = layer.GetMapImg(width, height, (xmin, ymin, xmax, ymax)) |
57 |
renderer.draw_raster_data(img, format) |
|
58 |
|
data = (width, height, (img, None, None)) |
59 |
|
|
60 |
|
renderer.draw_raster_data(layer, 0,0, data, format) |
61 |
|
|
62 |
return () |
return () |
63 |
|
|
64 |
Thuban.UI.baserenderer.add_renderer_extension(WMSLayer, render_wms_layer) |
Thuban.UI.baserenderer.add_renderer_extension(WMSLayer, render_wms_layer) |
65 |
|
from properties import wmsProperties |
66 |
|
layer_properties_dialogs.add(WMSLayer, wmsProperties) |
67 |
|
|
68 |
|
|
69 |
class SelectWMSServer(wxDialog): |
class SelectWMSServer(wxDialog): |
152 |
helptext = _('Add a WMS Layer'))) |
helptext = _('Add a WMS Layer'))) |
153 |
|
|
154 |
# find the experimental menu (create it anew if not found) |
# find the experimental menu (create it anew if not found) |
155 |
main_menu = Thuban.UI.mainwindow.main_menu |
experimental_menu = main_menu.FindOrInsertMenu('experimental', |
156 |
experimental_menu = main_menu.find_menu('experimental') |
_('Experimenta&l')) |
|
if experimental_menu is None: |
|
|
experimental_menu = main_menu.InsertMenu('experimental', _('Experimenta&l')) |
|
157 |
|
|
158 |
# finally add the new entry to the experimental menu |
# finally add the new entry to the experimental menu |
159 |
experimental_menu.InsertItem('wms') |
experimental_menu.InsertItem('wms') |