comparison gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp @ 572:3f7bbc6dc751

Sourced JavaScript script tags for loading and rendering an OpenLayers client out to an own jsp page. gnv/trunk@701 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 23 Feb 2010 15:26:50 +0000
parents
children b31e81f35b64
comparison
equal deleted inserted replaced
571:f2ba58011a2d 572:3f7bbc6dc751
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
4 <html xmlns="http://www.w3.org/1999/xhtml">
5 <head>
6 <title>
7 <bean:message key="gnviewer.app.title"/>
8 </title>
9 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
10 <meta http-equiv="Content-Script-Type" content="text/javascript"/>
11 <meta http-equiv="Content-Style-Type" content="text/css"/>
12 <meta http-equiv="Expires" content="Mon, 01 Jan 1990 00:00:01 GMT"/>
13 <meta http-equiv="pragma" content="no-cache"/>
14 <meta http-equiv="cache-control" content="no-cache"/>
15 <meta name="robots" content="noindex"/>
16 <link href="styles/default.css" rel="stylesheet" type="text/css"/>
17 <script type="text/javascript" src="scripts/gnviewer.js"></script>
18 <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
19 <script type="text/javascript">
20 var lon = 5;
21 var lat = 55;
22 var zoom = 5;
23 var map, layer;
24
25 function init() {
26 if (getURLParam("target") == "wms") {
27 map = new OpenLayers.Map('map');
28 layer = new OpenLayers.Layer.WMS(
29 "MyWMS",
30 "http://denmark.atlas/cgi-bin/mapserv-gp?MAP=/opt/artifacts/mapfiles/mapfile.map",
31 {
32 layers: getURLParam("layer")
33 },
34 {
35 singleTile: 'true'
36 }
37 );
38
39 map.addLayer(layer);
40 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
41 }
42 }
43
44 function getURLParam(strParamName){
45 var strReturn = "";
46 var strHref = window.location.href;
47
48 if ( strHref.indexOf("?") > -1 ){
49 var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
50 var aQueryString = strQueryString.split("&");
51
52 for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
53 if (aQueryString[iParam].indexOf(strParamName + "=") > -1 ) {
54 var aParam = aQueryString[iParam].split("=");
55 strReturn = aParam[1];
56 break;
57 }
58 }
59 }
60
61 return strReturn;
62 }
63 </script>
64 </head>
65
66 <body id="gnviewerbody" onLoad="init()">
67 <div id="overlay"></div>
68 <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute">
69 <div id="overlayContent">
70 <p>
71 <bean:message key="gnviewer.productselection.overlay.title"/>
72 </p>
73 </div>
74 </div>
75 <div id="page">
76 <jsp:include page="header.jsp" />
77 <jsp:include page="index.jsp" />
78 <jsp:include page="footer.jsp" />
79 </div>
80 </body>
81 </html>

http://dive4elements.wald.intevation.org