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 | |
---|
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 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 | |
---|
22 | array set gdalParams { |
---|
23 | url {local://world.tif} |
---|
24 | } |
---|
25 | array set layerParams { |
---|
26 | label "UTM GeoTIFF Layer" |
---|
27 | description "geotiff from gdal website" |
---|
28 | opacity 1.0 |
---|
29 | } |
---|
30 | |
---|
31 | # create a map object |
---|
32 | set 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.