Last change
on this file since 6371 was
6371,
checked in by dkearney, 8 years ago
|
merging changes from trunk into multichoice branch
|
File size:
1.2 KB
|
Line | |
---|
1 | package require Tk |
---|
2 | package require Rappture |
---|
3 | package require RapptureGUI |
---|
4 | |
---|
5 | Rappture::resources::load |
---|
6 | |
---|
7 | set commondir [file join [file dirname [info script]] .. common] |
---|
8 | source [file join $commondir geovis_settings.tcl] |
---|
9 | |
---|
10 | set width 400 |
---|
11 | set height 300 |
---|
12 | wm geometry . ${width}x${height} |
---|
13 | update |
---|
14 | |
---|
15 | set mapviewer [Rappture::MapViewer .g] |
---|
16 | |
---|
17 | pack .g -expand yes -fill both |
---|
18 | |
---|
19 | # create a Gdal layer from a local geotiff |
---|
20 | # here we use the local:// prefix to specify that the |
---|
21 | # tif file needs to be transferred from the # client to the server. |
---|
22 | |
---|
23 | array set gdalParams { |
---|
24 | url {/usr/share/geovis/world.tif} |
---|
25 | } |
---|
26 | array set layerParams { |
---|
27 | label "Base Layer" |
---|
28 | description "geotiff" |
---|
29 | opacity 1.0 |
---|
30 | } |
---|
31 | |
---|
32 | array set camera { |
---|
33 | xmin 20 |
---|
34 | xmax 40 |
---|
35 | ymin -15 |
---|
36 | ymax 15 |
---|
37 | srs wgs84 |
---|
38 | } |
---|
39 | |
---|
40 | # create a map object |
---|
41 | set map [Rappture::Map #auto] |
---|
42 | |
---|
43 | # add all layers to the map object |
---|
44 | $map addLayer image \ |
---|
45 | test [array get layerParams] \ |
---|
46 | gdal [array get gdalParams] |
---|
47 | |
---|
48 | $map setCamera [array get camera] |
---|
49 | |
---|
50 | # add a map to the vis client |
---|
51 | $mapviewer scale $map |
---|
52 | $mapviewer add $map |
---|
53 | |
---|
54 | after 10000 { |
---|
55 | puts stderr "camera zoom extent" |
---|
56 | $mapviewer camera zoom extent -64 40 -60 50 5 wgs84 |
---|
57 | } |
---|
58 | after 20000 { |
---|
59 | puts stderr "Reset camera" |
---|
60 | $mapviewer camera reset |
---|
61 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.