Project

General

Profile

« Previous | Next » 

Revision 2940

Added by anderson over 18 years ago

Now this page is in an expandable drawer.

View differences:

src/spatial/rendering/mapbuilder/africa_frame.html
5 5
<head>
6 6
<title>Metacat Spatial Option Demo</title>
7 7

  
8
<link rel="stylesheet" href="../../../../style.css" type="text/css"/>
9
<link rel="stylesheet" href="../../lib/skin/default/html.css" type="text/css"/>
8 10

  
9
<link rel="stylesheet" href="../../../../style.css" type="text/css">
10
<link rel="stylesheet" href="../../lib/skin/default/html.css" type="text/css">
11
<!--
12
<link href="./knb/style/skins/knb/knb.css" type="text/css" rel="stylesheet">
13
<script src="./knb/style/skins/knb/knb.js" type="text/JavaScript" language="Javascript"></script>
14
<script src="./knb/style/common/branding.js" type="text/JavaScript" language="Javascript"></script><script language="JavaScript">
11
<link href="./knp/style/skins/knp/knp.css" type="text/css" rel="stylesheet"/>
12
<script src="./knp/style/skins/knp/knp.js" type="text/JavaScript" language="Javascript"></script>
13

  
14
<link href="http://nebulous.msi.ucsb.edu:9999/knp/style/skins/knp/map.css" type="text/css" rel="stylesheet"/>
15

  
16
<script src="http://nebulous.msi.ucsb.edu:9999/knp/style/common/prototype.js" type="text/JavaScript" language="Javascript"></script>
17
<script src="http://nebulous.msi.ucsb.edu:9999/knp/style/common/effects.js" type="text/JavaScript" language="Javascript"></script>
18

  
19
<script language="JavaScript">
15 20
          function submitform(action,form_ref) {
16 21
            form_ref.action.value=action;
17 22
            form_ref.sessionid.value="";
18
            form_ref.qformat.value="knb";
23
            form_ref.qformat.value="knp";
19 24
            form_ref.submit();
20 25
          }
21 26
</script>
22
-->
23 27

  
24 28
<script type="text/javascript">
25
      // URL of Mapbuilder configuration file.
26
      var mbConfigUrl='africa_frame_config.xml';
27
    </script>
29
  var mbConfigUrl="africa_frame_config.xml";
30
</script>
28 31
<script type="text/javascript" src="../../lib/Mapbuilder.js"></script>
32

  
33

  
34
<script language="JavaScript">
35
function show_map() {
36
	Element.show('mapControlHide')
37
	Element.hide('mapControlShow')
38

  
39
	// reset the map position in the iframe
40
	$("mapContainer").setAttribute("style", "right:-212px;");
41

  
42
	// expand the iframe
43
	var frm = top.getMapFrame();
44
	frm.setAttribute("style", "width:295px;right:0;");
45

  
46
	var element = $('mapContainer')
47
	new Effect.Move(element, { x: -212, y: 0, duration: 0.2})
48

  
49
	//setTimeout('$("mapContainer").setAttribute("style", "position:absolute;left:0;")', 300);
50

  
51
	//alert('moved');
52
	//do_move_anim(-260);
53
}
54

  
55
/*
56
 * Don't animate.  Just shrink the outer frame and make left:0.
57
 */
58
function hide_map() {
59
	Element.show('mapControlShow')
60
	Element.hide('mapControlHide')
61
	var element = $('mapContainer')
62
	//new Effect.Move(element, { x: 260, y: 0, duration: 0.1})
63
	$("mapContainer").setAttribute("style", "left:0px;");
64

  
65

  
66

  
67
	//alert('moved');
68
	//setTimeout('getElementsByClassName(top.document, "iframe", "iframeMap")[0].setAttribute("style", "width:35px;right:0;")', 200);
69

  
70
	// shrink the iframe
71
	var frm = top.getMapFrame();
72
	frm.setAttribute("style", "width:35px;right:-3px;");
73

  
74

  
75
	//alert('closed');
76
	//alert('now');
77
	//setTimeout('$("mapContainer").setAttribute("style", "left:0;")', 400);
78
	//$("mapContainer").setAttribute("style", "right:-212px;");
79
	//alert($("mapContainer").getAttribute("style"));
80
	//alert('adjusted');
81

  
82
	//do_move_anim(260);
83
}
84

  
85

  
86
//
87
// animate the drawer
88
//
89
function do_move_anim(xdelta) {
90

  
91
	var element = $('mapContainer')
92
	var old_right = Element.getStyle(element, 'right')
93
	//alert("right:" + old_right);
94
	old_right = old_right.substring(0,old_right.indexOf("px"));
95
	var new_right = old_right + xdelta;
96
	new_right = new_right + "px";
97
	new_right = "0px";
98
	var new_left;
99

  
100
	if (xdelta > 0) {
101
		// hide
102
		new_left = "0px";
103
		new_right = "0px";
104
	} else {
105
		// show
106
		new_left = "0px";
107
		new_right = "0px";
108
	}
109

  
110
	var newStyle = {
111
		left: new_left,
112
		right: new_right};
113
	Element.setStyle(element, newStyle);
114
		
115

  
116
	//alert(xdelta + ": " + Element.getStyle(element, 'left') + "=l R=" + Element.getStyle(element, 'right'));
117
/*
118
*/
119
	//new Effect.Move(element, { x: xdelta, y: 0, duration: 0.3})
120

  
121
	/*
122
	new Effect.Move(element, { x: xdelta, y: 0, duration: 0.3, 
123
		afterFinishInternal: function(effect) { with(Element) {
124
			undoPositioned(effect.element); setStyle(effect.element, newStyle);	}}})
125
	new Effect.Move(element, { x: xdelta, y: 0, duration: 0.3, 
126
		afterFinishInternal: function(effect) { with(Element) {
127
			setStyle(effect.element, newStyle);	}}})
128
			*/
129

  
130
	//Element.setStyle(element, newStyle);
131

  
132

  
133

  
134
	//alert(Element.getStyle(element, 'left') + "=l R=" + Element.getStyle(element, 'right'));
135
}
136

  
137
function getElementsByClassName(oElm, strTagName, strClassName){
138
    var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
139
    var arrReturnElements = new Array();
140
    strClassName = strClassName.replace(/\-/g, "\\-");
141
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
142
    var oElement;
143
    for(var i=0; i<arrElements.length; i++){
144
        oElement = arrElements[i];      
145
        if(oRegExp.test(oElement.className)){
146
            arrReturnElements.push(oElement);
147
        }   
148
    }
149
    return (arrReturnElements)
150
}
151

  
152

  
153

  
154
</script>
29 155
</head>
30 156
<!--
31 157
 <body onload="document.location='../../../wms/GetCapabilities'">
32 158
 -->
33 159
<body onload="mbDoLoad()">
34 160

  
35
<table border="0">
161
<div id="mapContainer">
162

  
163
<table border="0" cellpadding="0" cellspacing="0">
36 164
	<tr>
37
    <td rowspan="2" valign="top" />
38
		<table border="0">
39
			<tr> 
40
			</tr>
165
    <td style="border-width:0;">
166
		<div id="mapControl">
167
			<div id="mapControlShow" style="display:none"><a href="#" onclick="show_map();return false;">&nbsp;</a></div>
168
			<div id="mapControlHide"><a href="#" onclick="hide_map();return false;">&nbsp;</a></div>
169
		</div>
170
    </td>
171
    <td valign="top">
172
		<table border="0" style="border: 1px solid #525d76;">
41 173
			<tr>
42 174
				<td colspan="2" id="mainMapPane" style="background-color: white;" />
43 175
			</tr>
44 176
			<tr align="left">
177
				<td>
45 178

  
46
        <table border="0">
47
          <tr>
48
            <!-- <td align="center" id="mapScaleText"/>
49
				    <td colspan="1"></td>
50
            <td align="center" id="cursorTrack" /> -->
51
          </tr>
52
      			<tr> <td id="locatorMap" style="display:none"/> </tr>
53
      			<tr> <td id="mainButtonBar" />  </tr>
54
      			<tr> <td id="legend" valign="top"/> </tr> 
55
      			<tr> <td colspan="3" id="featureList" /> </tr>
56
        </table>
179
				<table border="0">
180
				  <tr>
181
					<!--<td align="center" id="mapScaleText"/>
182
							<td colspan="1"></td>
183
					<td align="center" id="cursorTrack" />-->
184
				  </tr>
185
						<tr> <td id="locatorMap" style="display:none"/> </tr>
186
						<tr> <td id="mainButtonBar" />  </tr>
187
						<tr> <td id="legend" valign="top"/> </tr> 
188
						<tr> <td colspan="3" id="featureList" /> </tr>
189
				</table>
190

  
191
				</td>
57 192
			</tr>
58 193
      
59
      
60 194
		</table>
61 195
		</td>
62 196
	</tr>
63 197
</table>
198
</div>
64 199

  
65 200
<div id="debug"></div>
66 201

  

Also available in: Unified diff