Mercurial > dive4elements > gnv-client
comparison gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp @ 570:cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
gnv/trunk@698 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 22 Feb 2010 18:04:55 +0000 |
parents | b5733f9f386b |
children | f2ba58011a2d |
comparison
equal
deleted
inserted
replaced
569:9a5e50e7afaa | 570:cbd397712ecf |
---|---|
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 console.log("LAYER NAME: " + getURLParam("layer")); | |
56 map = new OpenLayers.Map('map'); | |
57 layer = new OpenLayers.Layer.WMS( | |
58 "MyWMS", | |
59 "http://denmark.atlas/cgi-bin/mapserv-gp?MAP=/opt/artifacts/mapfiles/mapfile.map", | |
60 { | |
61 layers: getURLParam("layer") | |
62 }, | |
63 { | |
64 singleTile: 'true' | |
65 } | |
66 ); | |
67 | |
68 map.addLayer(layer); | |
69 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); | |
70 } | |
71 } | |
72 | |
73 function getURLParam(strParamName){ | |
74 var strReturn = ""; | |
75 var strHref = window.location.href; | |
76 | |
77 if ( strHref.indexOf("?") > -1 ){ | |
78 var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase(); | |
79 var aQueryString = strQueryString.split("&"); | |
80 | |
81 for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){ | |
82 if (aQueryString[iParam].indexOf(strParamName + "=") > -1 ) { | |
83 var aParam = aQueryString[iParam].split("="); | |
84 strReturn = aParam[1]; | |
85 break; | |
86 } | |
87 } | |
88 } | |
89 | |
90 return strReturn; | |
91 } | |
92 </script> | |
46 </head> | 93 </head> |
47 | 94 |
48 <body id="gnviewerbody"> | 95 <body id="gnviewerbody" onLoad="init()"> |
49 <div id="overlay"></div> | 96 <div id="overlay"></div> |
50 <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute"> | 97 <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute"> |
51 <div id="overlayContent"> | 98 <div id="overlayContent"> |
52 <p> | 99 <p> |
53 <bean:message key="gnviewer.productselection.overlay.title"/> | 100 <bean:message key="gnviewer.productselection.overlay.title"/> |