source: trunk/examples/mapviewer/tms/tms_example.tcl @ 6285

Last change on this file since 6285 was 6285, checked in by ldelgass, 9 years ago

Fix examples for running with tclsh

File size: 818 bytes
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 TMS layer
20array set tmsParams {
21    url {http://readymap.org/readymap/tiles/1.0.0/7/}
22}
23array set layerParams {
24    label  "ReadyMap Aerial"
25    description "ReadyMap Satellite/Aerial Imagery"
26}
27
28# create a map object
29set map [Rappture::Map #auto]
30
31# add all layers to the map object
32$map addLayer image \
33    readymap [array get layerParams] \
34    tms [array get tmsParams]
35
36# add a map to the vis client
37$mapviewer scale $map
38$mapviewer add $map
Note: See TracBrowser for help on using the repository browser.