diff gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp @ 971:a0e6566cd111

Integrated Openlayers using ext and geoext into the GNV-WebClient gnv/trunk@1139 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 01 Jun 2010 12:55:24 +0000
parents 5f29bfeb61bd
children 1bb54da8c8ed
line wrap: on
line diff
--- a/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp	Thu May 27 16:51:52 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp	Tue Jun 01 12:55:24 2010 +0000
@@ -1,13 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%>
+<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%>
 <%@ 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");
+    SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request);
 %>
-
 <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
         <title>
@@ -20,65 +22,28 @@
         <meta http-equiv="pragma" content="no-cache"/>
         <meta http-equiv="cache-control" content="no-cache"/>
         <meta name="robots" content="noindex"/>
+        
+        <link rel="stylesheet" type="text/css" href="scripts/ext/ext-2.3.0/resources/css/ext-all.css"></link>
+        <link rel="stylesheet" type="text/css" href="scripts/geoext/geoext-0.6/resources/css/geoext-all.css"></link>
+        <link rel="stylesheet" type="text/css" href="scripts/openlayers/OpenLayers-2.9/theme/default/style.css"></link>
         <link href="styles/gnv.css" rel="stylesheet" type="text/css"/>
-        <script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script>
-        <script type="text/javascript">
-            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%>';
-                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);
-                <%}%>
-            }
-
-            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";
-                }
-            }
-
-        </script>
+        
+        <script type="text/javascript" src="scripts/ext/ext-2.3.0/adapter/ext/ext-base.js"></script>
+        <script type="text/javascript" src="scripts/ext/ext-2.3.0/ext-all.js"></script>
+        <script type="text/javascript" src="scripts/openlayers/OpenLayers-2.9/OpenLayers.js"></script>
+        <script type="text/javascript" src="scripts/geoext/geoext-0.6/script/GeoExt.js"></script>
+        <script type="text/javascript" src="<%=response.encodeURL("scripts/layers.jsp?uid="+System.currentTimeMillis())%>"></script>
+        <script type="text/javascript" src="<%=response.encodeURL("scripts/viewport.jsp?uid="+System.currentTimeMillis())%>"></script>
+         
+         <!-- save necessary variables here -->
+         <script type="text/javascript">
+             var options, layer, extent, map, mapPanel, infoControls;
+             var controls,layers, mouseLoc, grid;
+             var infoActive = false;
+         </script>
     </head>
 
-    <body id="gnviewerbody" onLoad="init()">
+    <body id="gnviewerbody">
     <div id="overlay"></div>
     <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute;visibility:hidden;">
         <div id="overlayContent">
@@ -94,7 +59,7 @@
         <div id="contentElement" class="contentElement">
             <jsp:include page="index.jsp" />
          </div>
-         <br>
+         <br/>
          <div id="footerElement">
             <jsp:include page="footer.jsp" />
         </div>

http://dive4elements.wald.intevation.org