1 | package require RapptureGUI |
---|
2 | |
---|
3 | set commondir [file join [file dirname [info script]] .. common] |
---|
4 | source [file join $commondir geovis_settings.tcl] |
---|
5 | |
---|
6 | |
---|
7 | set width 400 |
---|
8 | set height 300 |
---|
9 | wm geometry . ${width}x${height} |
---|
10 | update |
---|
11 | |
---|
12 | Rappture::MapViewer::SetServerList $GEOVIS_SERVERS |
---|
13 | set s [Rappture::MapViewer .g [list localhost:2015]] |
---|
14 | |
---|
15 | pack .g -expand yes -fill both |
---|
16 | |
---|
17 | # create xyz layer |
---|
18 | set xyzdp [Rappture::GeoMapDataProviderXYZ #auto \ |
---|
19 | {http://otile[1234].mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg} \ |
---|
20 | -cache false] |
---|
21 | set l1 [Rappture::GeoMapLayerImage #auto $xyzdp] |
---|
22 | |
---|
23 | |
---|
24 | # create a colorramp layer |
---|
25 | set colormap { |
---|
26 | 0.00 0 0 1 1 |
---|
27 | 0.25 0 1 1 1 |
---|
28 | 0.50 0 1 0 1 |
---|
29 | 0.75 1 1 0 1 |
---|
30 | 1.00 1 0 0 1 |
---|
31 | } |
---|
32 | set crdp [Rappture::GeoMapDataProviderColorramp #auto \ |
---|
33 | {file:///usr/share/geovis/landuse/outlandish.tif} \ |
---|
34 | -colormap $colormap] |
---|
35 | set l2 [Rappture::GeoMapLayerImage #auto $crdp] |
---|
36 | $l2 configure -coverage true |
---|
37 | |
---|
38 | |
---|
39 | # create an OGR Line layer |
---|
40 | set ogrdp [Rappture::GeoMapDataProviderOGR #auto \ |
---|
41 | line {file:///data/mygeohub/tools/landuse/afr_countries.shp}] |
---|
42 | set l3 [Rappture::GeoMapLayer #auto $ogrdp] |
---|
43 | |
---|
44 | |
---|
45 | # create a map object |
---|
46 | set m [Rappture::Map #auto] |
---|
47 | |
---|
48 | # ------------------------------------------------- |
---|
49 | # launch the mapviewer |
---|
50 | # show individual layers of the map at 10 second intervals |
---|
51 | |
---|
52 | after 10000 { |
---|
53 | # add a layer to the map object |
---|
54 | set l1name [ \ |
---|
55 | $m layer add -format blt_tree [ \ |
---|
56 | $l1 export -format blt_tree]] |
---|
57 | |
---|
58 | # add a map to the vis client |
---|
59 | $s scale $m |
---|
60 | $s add $m |
---|
61 | } |
---|
62 | |
---|
63 | after 15000 { |
---|
64 | # remove the map from the viewer |
---|
65 | $s remove $m |
---|
66 | |
---|
67 | # remove the OSM layer from the map |
---|
68 | $m layer delete $l1name |
---|
69 | |
---|
70 | # add the colorramp layer to the map |
---|
71 | set l2name [ \ |
---|
72 | $m layer add -format blt_tree [ \ |
---|
73 | $l2 export -format blt_tree]] |
---|
74 | |
---|
75 | # add the map back to the viewer |
---|
76 | $s scale $m |
---|
77 | $s add $m |
---|
78 | } |
---|
79 | |
---|
80 | after 20000 { |
---|
81 | # remove the map from the viewer |
---|
82 | $s remove $m |
---|
83 | |
---|
84 | # remove the colorramp layer from the map |
---|
85 | $m layer delete $l2name |
---|
86 | |
---|
87 | # add the line feature layer to the map |
---|
88 | set l3name [ \ |
---|
89 | $m layer add -format blt_tree [ \ |
---|
90 | $l3 export -format blt_tree]] |
---|
91 | |
---|
92 | # add the map back to the viewer |
---|
93 | $s scale $m |
---|
94 | $s add $m |
---|
95 | } |
---|
96 | |
---|
97 | # build up the map layer by layer at 5 second intervals |
---|
98 | |
---|
99 | after 25000 { |
---|
100 | # remove the map from the viewer |
---|
101 | $s remove $m |
---|
102 | |
---|
103 | # remove the line feature layer |
---|
104 | $m layer delete $l3name |
---|
105 | |
---|
106 | # add the OSM layers to the map |
---|
107 | $m layer add -format blt_tree [$l1 export -format blt_tree] |
---|
108 | |
---|
109 | # add the map back to the viewer |
---|
110 | $s scale $m |
---|
111 | $s add $m |
---|
112 | } |
---|
113 | |
---|
114 | |
---|
115 | after 30000 { |
---|
116 | # add the colorramp layer to the map |
---|
117 | $m layer add -format blt_tree [$l2 export -format blt_tree] |
---|
118 | |
---|
119 | # add the map back to the viewer |
---|
120 | $s scale $m |
---|
121 | $s add $m |
---|
122 | } |
---|
123 | |
---|
124 | after 35000 { |
---|
125 | # add the line feature layer to the map |
---|
126 | $m layer add -format blt_tree [$l3 export -format blt_tree] |
---|
127 | |
---|
128 | # add the map back to the viewer |
---|
129 | $s scale $m |
---|
130 | $s add $m |
---|
131 | } |
---|
132 | |
---|