Last change
on this file since 6209 was
6209,
checked in by dkearney, 8 years ago
|
adding mapviewer examples from rappture-bat
|
File size:
1.6 KB
|
Line | |
---|
1 | package require Rappture |
---|
2 | package require RapptureGUI |
---|
3 | |
---|
4 | Rappture::resources::load |
---|
5 | |
---|
6 | set commondir [file join [file dirname [info script]] .. common] |
---|
7 | source [file join $commondir geovis_settings.tcl] |
---|
8 | |
---|
9 | set width 400 |
---|
10 | set height 300 |
---|
11 | wm geometry . ${width}x${height} |
---|
12 | update |
---|
13 | |
---|
14 | set mapviewer [Rappture::MapViewer .g] |
---|
15 | |
---|
16 | pack .g -expand yes -fill both |
---|
17 | |
---|
18 | # create a OSGeo WMS layer |
---|
19 | array set dp1 { |
---|
20 | url {http://vmap0.tiles.osgeo.org/wms/vmap0} |
---|
21 | layers "basic" |
---|
22 | format "jpeg" |
---|
23 | transparent false |
---|
24 | } |
---|
25 | array set l1 { |
---|
26 | label "OSGeo WMS Layer" |
---|
27 | description "base layer from OSGeo" |
---|
28 | opacity 1.0 |
---|
29 | } |
---|
30 | |
---|
31 | # create a Population Density 2000 layer |
---|
32 | array set dp4 { |
---|
33 | url {http://sedac.ciesin.columbia.edu/geoserver/wms} |
---|
34 | layers "gpw-v3:gpw-v3-population-density_2000" |
---|
35 | format "png" |
---|
36 | transparent true |
---|
37 | } |
---|
38 | array set l4 { |
---|
39 | label "Population Density 2000" |
---|
40 | description "Columbia Population Density 2000 Data" |
---|
41 | opacity 0.9 |
---|
42 | } |
---|
43 | |
---|
44 | # create a crop climate layer |
---|
45 | array set dp5 { |
---|
46 | url {http://sedac.ciesin.columbia.edu/geoserver/wms} |
---|
47 | layers "crop-climate:crop-climate-effects-climate-global-food-production" |
---|
48 | format "png" |
---|
49 | transparent true |
---|
50 | } |
---|
51 | array set l5 { |
---|
52 | label "Crop Climate" |
---|
53 | description "Columbia Crop Climate Data" |
---|
54 | opacity 0.5 |
---|
55 | } |
---|
56 | |
---|
57 | # create a map object |
---|
58 | set map [Rappture::Map #auto] |
---|
59 | |
---|
60 | # add all layers to the map object |
---|
61 | $map addLayer image \ |
---|
62 | l1 [array get l1] \ |
---|
63 | wms [array get dp1] |
---|
64 | |
---|
65 | $map addLayer image \ |
---|
66 | l4 [array get l4] \ |
---|
67 | wms [array get dp4] |
---|
68 | |
---|
69 | $map addLayer image \ |
---|
70 | l5 [array get l5] \ |
---|
71 | wms [array get dp5] |
---|
72 | |
---|
73 | # add a map to the vis client |
---|
74 | $mapviewer scale $map |
---|
75 | $mapviewer add $map |
---|
Note: See
TracBrowser
for help on using the repository browser.