source: cowsclient/tags/1.6.0-py2.6/cowsclient/templates/layertest.html @ 7593

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cowsclient/tags/1.6.0-py2.6/cowsclient/templates/layertest.html@7593
Revision 7593, 1.8 KB checked in by astephen, 10 years ago (diff)

Tagged version updated to be compatible with:

  • python 2.6
  • pylons 1.0
Line 
1<html xmlns:py="http://genshi.edgewall.org/" 
2      xmlns="http://www.w3.org/1999/xhtml"
3      xmlns:xi="http://www.w3.org/2001/XInclude">   
4<xi:include href="utils.html" />
5<head>
6
7
8<script src="$app_globals.server/js/OpenLayers.js" ></script>
9
10<script type="text/javascript" src="$app_globals.server/js/yui/utilities/utilities.js" ></script>
11<script type="text/javascript" src="$app_globals.server/js/yui/dragdrop/dragdrop.js" ></script>
12
13<script src="$app_globals.server/js/dragAndDrop.js"></script>
14
15<script src="$app_globals.server/js/layerList.js"></script>
16
17
18<link type="text/css" rel="stylesheet" href="$app_globals.server/layout/drag_drop_style.css"/>
19
20<script type="text/javascript">
21
22var layerList = null;
23
24function init() {
25    layerList= new LayerList('layer_list');
26}
27
28var ind = 1;
29function add() {
30
31       
32    var visLayer = new OpenLayers.Layer.WMS("DDC-Vis layer",
33            "http://localhost:5000/clim_10/wms",
34            {format: 'image/png', version: '1.3.0', CRS: 'CRS:84',
35            layers: 'tmp',
36            styles:'contour',
37            cmap:'bone',
38            time:'1905-01-15T00:00:00.0'});
39
40    visLayer.id = 'layer_id_' + ind
41    layerList._addLayer(visLayer);
42    ind = ind + 1;
43}
44
45function clearSelection() {
46    layerList._unselectAll();
47}
48
49function remove() {
50    layerList._removeSelectedItem();
51}
52
53function get() {
54    layer = layerList.getSelectedLayer();
55    alert(layer.name + " " + layer.id);
56}
57
58</script>
59
60</head>
61
62<body onload="init()">
63    layer list:
64        <div class="workarea">
65            <ul class="draglist" id="layer_list">
66            </ul>
67        </div>
68        <br />
69        <input type="button" value="add" onClick="add();" />
70        <input type="button" value="clear" onClick="clearSelection();" />
71        <input type="button" value="remove" onClick="remove();" />
72        <input type="button" value="get" onClick="get();" />
73</body>
74</html>
Note: See TracBrowser for help on using the repository browser.