comparison gnv/src/main/webapp/WEB-INF/jsp/mainlayout.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 f2ba58011a2d
children a634d5ee961d
comparison
equal deleted inserted replaced
571:f2ba58011a2d 572:3f7bbc6dc751
41 " 4.2686 58.8996, " + 41 " 4.2686 58.8996, " +
42 " 0.0219 58.5768, " + 42 " 0.0219 58.5768, " +
43 "-1.5763 58.3616))"; 43 "-1.5763 58.3616))";
44 } 44 }
45 </script> 45 </script>
46 <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
47 <script type="text/javascript">
48 var lon = 5;
49 var lat = 55;
50 var zoom = 5;
51 var map, layer;
52
53 function init() {
54 if (getURLParam("target") == "wms") {
55 map = new OpenLayers.Map('map');
56 layer = new OpenLayers.Layer.WMS(
57 "MyWMS",
58 "http://denmark.atlas/cgi-bin/mapserv-gp?MAP=/opt/artifacts/mapfiles/mapfile.map",
59 {
60 layers: getURLParam("layer")
61 },
62 {
63 singleTile: 'true'
64 }
65 );
66
67 map.addLayer(layer);
68 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
69 }
70 }
71
72 function getURLParam(strParamName){
73 var strReturn = "";
74 var strHref = window.location.href;
75
76 if ( strHref.indexOf("?") > -1 ){
77 var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
78 var aQueryString = strQueryString.split("&");
79
80 for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
81 if (aQueryString[iParam].indexOf(strParamName + "=") > -1 ) {
82 var aParam = aQueryString[iParam].split("=");
83 strReturn = aParam[1];
84 break;
85 }
86 }
87 }
88
89 return strReturn;
90 }
91 </script>
92 </head> 46 </head>
93 47
94 <body id="gnviewerbody" onLoad="init()"> 48 <body id="gnviewerbody">
95 <div id="overlay"></div> 49 <div id="overlay"></div>
96 <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute"> 50 <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute">
97 <div id="overlayContent"> 51 <div id="overlayContent">
98 <p> 52 <p>
99 <bean:message key="gnviewer.productselection.overlay.title"/> 53 <bean:message key="gnviewer.productselection.overlay.title"/>

http://dive4elements.wald.intevation.org