source: branches/multichoice/examples/mapviewer/xyz/xyz_example.tcl @ 6371

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 
1package require Tk
2package require Rappture
3package require RapptureGUI
4
5Rappture::resources::load
6
7set commondir [file join [file dirname [info script]] .. common]
8source [file join $commondir geovis_settings.tcl]
9
10set width 400
11set height 300
12wm geometry . ${width}x${height}
13update
14
15set mapviewer [Rappture::MapViewer .g]
16
17pack .g -expand yes -fill both
18
19# create an XYZ world layer
20array set dp1 {
21    url {http://otile[1234].mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg}
22}
23array 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
30array set dp2 {
31    url {http://[abc].tile.openweathermap.org/map/precipitation/{z}/{x}/{y}.png}
32}
33array set l2 {
34    label "OpenWeatherMap Precip"
35    description "Precip layer from OWM"
36    opacity 0.7
37}
38
39# create a map object
40set 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.