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.1 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 an XYZ world layer |
---|
20 | array set dp1 { |
---|
21 | url {http://otile[1234].mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg} |
---|
22 | } |
---|
23 | array set l1 { |
---|
24 | label "OSM Map" |
---|
25 | description "MapQuest OpenStreetMap Street base layer" |
---|
26 | opacity 1.0 |
---|
27 | } |
---|
28 | |
---|
29 | # create a XYZ Precip layer |
---|
30 | array set dp2 { |
---|
31 | url {http://[abc].tile.openweathermap.org/map/precipitation/{z}/{x}/{y}.png} |
---|
32 | } |
---|
33 | array set l2 { |
---|
34 | label "OpenWeatherMap Precip" |
---|
35 | description "Precip layer from OWM" |
---|
36 | opacity 0.7 |
---|
37 | } |
---|
38 | |
---|
39 | # create a map object |
---|
40 | set map [Rappture::Map #auto] |
---|
41 | |
---|
42 | # add all layers to the map object |
---|
43 | $map addLayer image \ |
---|
44 | l1 [array get l1] \ |
---|
45 | xyz [array get dp1] |
---|
46 | $map addLayer image \ |
---|
47 | l2 [array get l2] \ |
---|
48 | xyz [array get dp2] |
---|
49 | |
---|
50 | # add a map to the vis client |
---|
51 | $mapviewer scale $map |
---|
52 | $mapviewer add $map |
---|
Note: See
TracBrowser
for help on using the repository browser.