Mercurial > dive4elements > gnv-client
diff 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 |
line wrap: on
line diff
--- a/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp Tue Apr 13 17:55:32 2010 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp Wed Apr 14 16:05:32 2010 +0000 @@ -21,9 +21,10 @@ <meta http-equiv="cache-control" content="no-cache"/> <meta name="robots" content="noindex"/> <link href="styles/default.css" rel="stylesheet" type="text/css"/> - <script type="text/javascript" src="scripts/gnviewer.js"></script> - <script src="http://www.openlayers.org/api/OpenLayers.js"></script> + <script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script> + <script type="text/javascript" src="scripts/jquery-1.4.2.min.js"></script> <script type="text/javascript"> + jQuery.noConflict(); var lon = 5; var lat = 55; var zoom = 5; @@ -33,26 +34,55 @@ <%if(request.getAttribute("wms_published") != null){ %> map = new OpenLayers.Map('map'); var server = '<%=serverPath%>?MAP=<%=mapfilePath%>'; - layer = new OpenLayers.Layer.WMS( - "MyWMS", - server, + var back1 = new OpenLayers.Layer.WMS( + "Background1", + "http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer?", { - layers: '<%=layerName%>', - format: 'image/png' + layers: '16', + format: 'image/png', + transparent: false + }, + { + isBaseLayer: 'true', + singleTile: 'true' + } + ); + + var back2 = new OpenLayers.Layer.WMS( + "Background1", + "http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer?", + { + layers: '4', + format: 'image/png', + transparent: true }, { singleTile: 'true' } ); - map.addLayer(layer); + layer = new OpenLayers.Layer.WMS( + "MyWMS", + server, + { + layers: '<%=layerName%>', + format: 'image/png', + transparent: 'true' + }, + { + singleTile: 'true' + } + ); + + map.addLayers([back1, back2, layer]); map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); <%}%> + + initHeight(); } function toggle(element) { var ele = document.getElementById(element); - console.log("Element: " + ele.style.visibility); var vis = ele.style.visibility; if (vis != "visible") { ele.style.visibility = "visible"; @@ -61,6 +91,18 @@ ele.style.visibility = "hidden"; } } + + /** + * Calculate the content's height (content = window -header - footer). + */ + function initHeight() { + var winHeight = window.innerHeight; + var headerHeight = jQuery("headerElement").innerHeight(); + var footerHeight = jQuery("footerElement").innerHeight(); + var height = winHeight - headerHeight - footerHeight; + jQuery("contentElement").innerHeight(height); + jQuery(window).resize(initHeight); + } </script> </head> @@ -77,7 +119,7 @@ <div id="headerElement"> <jsp:include page="header.jsp" /> </div> - <div id="contentElement" class="contentElement bgblue2"> + <div id="contentElement" class="contentElement"> <jsp:include page="index.jsp" /> <%if(request.getAttribute("wms_published") != null){ %> <div class="outerMap">