view gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp @ 698:d7b005107443

Adapted background layer config gnv/trunk@929 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Hans Plum <hans.plum@intevation.de>
date Wed, 14 Apr 2010 17:57:26 +0000
parents d2582f75b144
children cb1bae26e7ae
line wrap: on
line source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%
    String serverPath  = (String) request.getAttribute("mapserver");
    String mapfilePath = (String) request.getAttribute("mapfile");
    String layerName   = (String) request.getAttribute("layer");
    String timeToLive  = (String) request.getAttribute("ttl");
%>

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>
            <bean:message key="gnviewer.app.title"/>
        </title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
        <meta http-equiv="Content-Script-Type" content="text/javascript"/>
        <meta http-equiv="Content-Style-Type" content="text/css"/>
        <meta http-equiv="Expires" content="Mon, 01 Jan 1990 00:00:01 GMT"/>
        <meta http-equiv="pragma" content="no-cache"/>
        <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="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;
            var map, layer;

            function init() {
                <%if(request.getAttribute("wms_published") != null){ %>
                map        = new OpenLayers.Map('map');
                var server = '<%=serverPath%>?MAP=<%=mapfilePath%>';
                var back1 = new OpenLayers.Layer.WMS(
                    "Background1",
                    "http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer?",
                    {
                        layers: '0',
                        format: 'image/png',
                        transparent: false
                    },
                    {
                        isBaseLayer: 'true',
                        singleTile: 'true'
                    }
                );

                layer      = new OpenLayers.Layer.WMS(
                    "MyWMS",
                    server,
                    {
                        layers: '<%=layerName%>',
                        format: 'image/png',
                        transparent: 'true'
                    },
                    {
                        singleTile: 'true'
                    }
                );

                map.addLayers([back1, layer]);
                map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
                <%}%>

                initHeight();
            }

            function toggle(element) {
                var ele = document.getElementById(element);
                var vis = ele.style.visibility;
                if (vis != "visible") {
                    ele.style.visibility = "visible";
                }
                else {
                    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>

    <body id="gnviewerbody" onLoad="init()">
    <div id="overlay"></div>
    <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute">
        <div id="overlayContent">
            <p>
                <bean:message key="gnviewer.productselection.overlay.title"/>
            </p>
        </div>
    </div>
    <div id="page">
        <div id="headerElement">
            <jsp:include page="header.jsp" />
        </div>
        <div id="contentElement" class="contentElement">
            <jsp:include page="index.jsp" />
            <%if(request.getAttribute("wms_published") != null){ %>
            <div class="outerMap">
                <div id="wms">
                    <table>
                        <tr>
                            <td class="parameter"><bean:message key="gnviewer.wms.server.path"/>:</td>
                            <td class="wmsvalue"><%=serverPath%>?MAP=<%=mapfilePath%></td>
                        </tr>
                        <tr>
                            <td class="parameter"><bean:message key="gnviewer.wms.server.layer"/>:</td>
                            <td class="wmsvalue"><%=layerName%></td>
                        </tr>
                        <tr>
                            <td class="parameter"><bean:message key="gnviewer.wms.layer.ttl"/>:</td>
                            <td class="wmsvalue"><%=timeToLive%></td>
                        </tr>
                    </table>
                </div>
                <div id="map"></div>
            </div>
            <%}%>
         </div>
         <br>
         <div id="footerElement">
            <jsp:include page="footer.jsp" />
        </div>
    </div>
    </body>
</html>

http://dive4elements.wald.intevation.org