source: trunk/examples/mapviewer/gdal/gdal_example.tcl @ 6209

Last change on this file since 6209 was 6209, checked in by dkearney, 9 years ago

adding mapviewer examples from rappture-bat

File size: 925 bytes
Line 
1package require Rappture
2package require RapptureGUI
3
4Rappture::resources::load
5
6set commondir [file join [file dirname [info script]] .. common]
7source [file join $commondir geovis_settings.tcl]
8
9set width 400
10set height 300
11wm geometry . ${width}x${height}
12update
13
14set mapviewer [Rappture::MapViewer .g]
15
16pack .g -expand yes -fill both
17
18# create a Gdal layer from a local geotiff
19# here we use the local:// prefix to specify that the
20# tif file needs to be transferred from the # client to the server.
21
22array set gdalParams {
23    url {local://world.tif}
24}
25array set layerParams {
26    label "UTM GeoTIFF Layer"
27    description "geotiff from gdal website"
28    opacity 1.0
29}
30
31# create a map object
32set map [Rappture::Map #auto]
33
34# add all layers to the map object
35$map addLayer image \
36    test [array get layerParams] \
37    gdal [array get gdalParams]
38
39# add a map to the vis client
40$mapviewer scale $map
41$mapviewer add $map
Note: See TracBrowser for help on using the repository browser.