source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/viewItems.kid @ 3547

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/viewItems.kid@3547
Revision 3547, 3.7 KB checked in by cbyrom, 13 years ago (diff)

Adjust js code to allow WMC documents to be displayed as tree view nodes

  • with their layers being displayed upon expansion + display the layers

when these children are selected.

Line 
1<html py:extends="'ndgPage.kid','meta.kid'" xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#">
2<head>
3<link type="text/css" rel="stylesheet" href="/layout/ddc_style.css"/>
4<link type="text/css" rel="stylesheet" href="/layout/ddc_vis.css"/>
5
6<!-- BEGIN: Yahoo Interface Library -->
7<link type="text/css" rel="stylesheet"
8        href="/js/yui/treeview/assets/skins/sam/treeview.css"/>
9         
10<!-- Dependency source files --> 
11<script src = "js/yui/yahoo/yahoo-min.js" ></script> 
12<script src = "js/yui/event/event-min.js" ></script> 
13 
14<!-- TreeView source file --> 
15<script src = "js/yui/treeview/treeview-min.js" ></script> 
16
17<!-- TreeView Menu Style -->
18<link rel="stylesheet" type="text/css" href="/js/yui/treeview/assets/treeview-menu.css"/> 
19<!-- END: Yahoo Interface Library -->
20
21<!-- BEGIN: WMSC library -->
22<link type="text/css" rel="stylesheet" href="/layout/control.css"/>
23
24<script src="js/wmsc.js"></script>
25<script src="js/prototype.js"></script>
26<script src="js/xpath.js"></script>
27<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
28<script src="js/openlayers-x.js"></script>
29<script src="js/capabilities.js"></script>
30<script src="js/wmscControl.js"></script>
31<script src="js/vis-app.js"></script>
32      <script src="js/OLMapBox.js"/>
33<!-- END: WMSC library -->
34
35<!-- DDC specialisation of WMSC -->
36<script src="js/ddc-control.js"></script>
37
38<script type="text/javascript">
39
40// Hook into application for debugging.   
41var app = null;
42var control = null;
43
44function init()
45{
46    control = new WMSC.Control('layerTree', 'layerLeaves', 'dims');
47    <for py:for="i in session['viewItems']" class="dataset" py:strip="True">
48        <span py:if="i.wmcURL" py:strip="True">
49                control.addWebMapContext('viewItems', '${i.wmcURL}');
50            </span>
51    </for>
52
53    app = new WMSC.VisApp('map', control);
54    control.events.register('changeWMS', null, updateDescription);
55}
56
57function cleanup()
58{
59    app.destroy();
60}
61
62function updateDescription()
63{
64    $('description').innerHTML = control.getStateDescription().join('<br/>');
65}
66
67</script>
68
69<replace py:replace="pagehead()"/>
70</head>
71
72<body onload="init()" onunload="cleanup()">
73        <div id="entirepage">
74    <div py:replace="header()"/>
75        <div py:replace="PageTabs('View')"/>
76    <div py:replace="searchOneLine()"/>
77
78<div id="visBody">
79<table>
80  <tr>
81    <td>
82        <div id="mapBox">
83                        <div id="map"></div>
84                        <div id="legend"></div>
85                </div>
86    </td>
87    <td valign="top">
88      <div class="optDiv">
89        <b>Selection Description</b>
90        <div id="description">
91          Complete your selection below to view.
92        </div>
93      </div>
94      <div class="optDiv">
95        <b>Domain</b>
96        <div id="dims"></div>
97      </div>
98      <div class="optDiv">
99        <form id="figureForm">
100          <b>Plot type</b><br/>
101          <input type="radio" name="figType" value="colour" checked="1"/>Colour<br/>
102          <input type="radio" name="figType" value="bw"/>B/W Contour<br/>
103          <b>Format</b><br/>
104          <select name="figFormat">
105            <option value="image/png" name="figFormat" selected="1"> PNG </option>
106            <option value="image/jpeg" name="figFormat"> JPEG </option>
107            <option value="application/postscript" name="figFormat"> EPS </option>
108            <option value="image/svg+xml" name="figFormat"> SVG </option>
109          </select>
110          <input type="button" value="Make Figure"
111                onclick="app.makeFigure(this.parentNode.figType, this.parentNode.figFormat)"/>
112        </form>
113      </div>
114    </td>
115  </tr>
116</table>
117
118<table class="controlTable">
119<tr class="controlHeadings">
120<th>Dataset</th><th>Field</th>
121</tr>
122<tr>
123<td class="controlPanel"><div class="controlContent" id="layerTree">
124        Please wait while datasets load</div>
125</td>
126<td class="controlPanel">
127        <div class="controlContent" id="layerLeaves">
128                Select a dataset to view available fields
129        </div>
130</td>
131</tr>
132</table>
133
134</div>
135</div>
136</body>
137</html>
Note: See TracBrowser for help on using the repository browser.