comparison gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp @ 697:d2582f75b144

Improved design and added new wms layers as background for 'Horizontalschnitte'. gnv/trunk@928 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 14 Apr 2010 16:05:32 +0000
parents 883b366e3b15
children d7b005107443
comparison
equal deleted inserted replaced
696:ae1e616ecf94 697:d2582f75b144
19 <meta http-equiv="Expires" content="Mon, 01 Jan 1990 00:00:01 GMT"/> 19 <meta http-equiv="Expires" content="Mon, 01 Jan 1990 00:00:01 GMT"/>
20 <meta http-equiv="pragma" content="no-cache"/> 20 <meta http-equiv="pragma" content="no-cache"/>
21 <meta http-equiv="cache-control" content="no-cache"/> 21 <meta http-equiv="cache-control" content="no-cache"/>
22 <meta name="robots" content="noindex"/> 22 <meta name="robots" content="noindex"/>
23 <link href="styles/default.css" rel="stylesheet" type="text/css"/> 23 <link href="styles/default.css" rel="stylesheet" type="text/css"/>
24 <script type="text/javascript" src="scripts/gnviewer.js"></script> 24 <script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script>
25 <script src="http://www.openlayers.org/api/OpenLayers.js"></script> 25 <script type="text/javascript" src="scripts/jquery-1.4.2.min.js"></script>
26 <script type="text/javascript"> 26 <script type="text/javascript">
27 jQuery.noConflict();
27 var lon = 5; 28 var lon = 5;
28 var lat = 55; 29 var lat = 55;
29 var zoom = 5; 30 var zoom = 5;
30 var map, layer; 31 var map, layer;
31 32
32 function init() { 33 function init() {
33 <%if(request.getAttribute("wms_published") != null){ %> 34 <%if(request.getAttribute("wms_published") != null){ %>
34 map = new OpenLayers.Map('map'); 35 map = new OpenLayers.Map('map');
35 var server = '<%=serverPath%>?MAP=<%=mapfilePath%>'; 36 var server = '<%=serverPath%>?MAP=<%=mapfilePath%>';
36 layer = new OpenLayers.Layer.WMS( 37 var back1 = new OpenLayers.Layer.WMS(
37 "MyWMS", 38 "Background1",
38 server, 39 "http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer?",
39 { 40 {
40 layers: '<%=layerName%>', 41 layers: '16',
41 format: 'image/png' 42 format: 'image/png',
43 transparent: false
44 },
45 {
46 isBaseLayer: 'true',
47 singleTile: 'true'
48 }
49 );
50
51 var back2 = new OpenLayers.Layer.WMS(
52 "Background1",
53 "http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer?",
54 {
55 layers: '4',
56 format: 'image/png',
57 transparent: true
42 }, 58 },
43 { 59 {
44 singleTile: 'true' 60 singleTile: 'true'
45 } 61 }
46 ); 62 );
47 63
48 map.addLayer(layer); 64 layer = new OpenLayers.Layer.WMS(
65 "MyWMS",
66 server,
67 {
68 layers: '<%=layerName%>',
69 format: 'image/png',
70 transparent: 'true'
71 },
72 {
73 singleTile: 'true'
74 }
75 );
76
77 map.addLayers([back1, back2, layer]);
49 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 78 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
50 <%}%> 79 <%}%>
80
81 initHeight();
51 } 82 }
52 83
53 function toggle(element) { 84 function toggle(element) {
54 var ele = document.getElementById(element); 85 var ele = document.getElementById(element);
55 console.log("Element: " + ele.style.visibility);
56 var vis = ele.style.visibility; 86 var vis = ele.style.visibility;
57 if (vis != "visible") { 87 if (vis != "visible") {
58 ele.style.visibility = "visible"; 88 ele.style.visibility = "visible";
59 } 89 }
60 else { 90 else {
61 ele.style.visibility = "hidden"; 91 ele.style.visibility = "hidden";
62 } 92 }
93 }
94
95 /**
96 * Calculate the content's height (content = window -header - footer).
97 */
98 function initHeight() {
99 var winHeight = window.innerHeight;
100 var headerHeight = jQuery("headerElement").innerHeight();
101 var footerHeight = jQuery("footerElement").innerHeight();
102 var height = winHeight - headerHeight - footerHeight;
103 jQuery("contentElement").innerHeight(height);
104 jQuery(window).resize(initHeight);
63 } 105 }
64 </script> 106 </script>
65 </head> 107 </head>
66 108
67 <body id="gnviewerbody" onLoad="init()"> 109 <body id="gnviewerbody" onLoad="init()">
75 </div> 117 </div>
76 <div id="page"> 118 <div id="page">
77 <div id="headerElement"> 119 <div id="headerElement">
78 <jsp:include page="header.jsp" /> 120 <jsp:include page="header.jsp" />
79 </div> 121 </div>
80 <div id="contentElement" class="contentElement bgblue2"> 122 <div id="contentElement" class="contentElement">
81 <jsp:include page="index.jsp" /> 123 <jsp:include page="index.jsp" />
82 <%if(request.getAttribute("wms_published") != null){ %> 124 <%if(request.getAttribute("wms_published") != null){ %>
83 <div class="outerMap"> 125 <div class="outerMap">
84 <div id="wms"> 126 <div id="wms">
85 <table> 127 <table>

http://dive4elements.wald.intevation.org