jschuengel: thuban/Extensions/umn_mapserver mf_import.py,1.8,1.9
cvs@intevation.de
cvs at intevation.de
Wed Jul 28 14:44:28 CEST 2004
Author: jschuengel
Update of /thubanrepository/thuban/Extensions/umn_mapserver
In directory doto:/tmp/cvs-serv25094
Modified Files:
mf_import.py
Log Message:
(import_mapfile): Changed the code for setting the extent in thuban. Now the extent is set to the given extent from the mapfile.
Fixed a logical mistake. Now the extent is set when realy a layer is loaded, and not if one is selected to load.
Index: mf_import.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/umn_mapserver/mf_import.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- mf_import.py 22 Jul 2004 12:38:38 -0000 1.8
+++ mf_import.py 28 Jul 2004 12:44:26 -0000 1.9
@@ -393,9 +393,12 @@
# set the visible status
layer.SetVisible(maplayer.get_status())
+ #add the projection if exists
+ set_projection_to_tb(layer, maplayer)
+
# associate the maplayer object to the layer in thuban.
layer.extension_umn_layerobj = maplayer
-
+
#add the projection if exists
set_projection_to_tb(layer, maplayer)
@@ -499,18 +502,17 @@
# them later and export it.
for nr in range(len(mapobj.get_layers())-1, -1, -1):
mapobj.remove_layer(nr)
-
+
# add the map object to thuban, to use it later
- tb_map.extension_umn_mapobj = mapobj
+ tb_map.extension_umn_mapobj = mapobj
# show a message how many layer were loaded into thuban
# if the number of layers is not null
- if numlayers != 0:
- # fit the new map to the window
- context.mainwindow.canvas.FitMapToWindow()
+ if layer_count != 0:
# get the extent from the map and set it in thuban
- #extentrect = mapobj.get_extent().get_rect()
- #context.mainwindow.canvas.FitRectToWindow(extentrect)
+ extentrect = mapobj.get_extent().get_rect()
+ # fit the new map extent to the window
+ context.mainwindow.canvas.FitRectToWindow(extentrect)
context.mainwindow.RunMessageBox(_('Layer loaded'),
_("%s Layer loaded into Thuban") % layer_count)
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)