Mercurial > dive4elements > gnv-client
comparison gnv/src/main/webapp/scripts/layers.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 | |
children | 556e16cc4da5 |
comparison
equal
deleted
inserted
replaced
970:d91ffd0e8239 | 971:a0e6566cd111 |
---|---|
1 | |
2 <%@page import="java.util.Iterator"%> | |
3 <%@page import="de.intevation.gnv.artifactdatabase.objects.map.Layer"%> | |
4 <%@page import="de.intevation.gnv.artifactdatabase.objects.map.MapService"%> | |
5 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> | |
6 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%>/** | |
7 * This function is called while initializing the application. You are allowed | |
8 * to change/add/remove layers. But be are of the comments inline this code! | |
9 */ | |
10 function initLayers() { | |
11 /** | |
12 * XXX This application needs a layer that is stored in a variable called | |
13 * 'layer'. So do not change the name of this variable. Just change the WMS | |
14 * layer itself. | |
15 */ | |
16 layer = new OpenLayers.Layer.WMS.Untiled( | |
17 "Background1", | |
18 "http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer?", | |
19 { | |
20 layers: '0', | |
21 format: 'image/png', | |
22 transparent: false | |
23 }, | |
24 { | |
25 isBaseLayer: true | |
26 } | |
27 | |
28 ); | |
29 /** | |
30 * XXX This application needs an ARRAY that stores some layers (or a single | |
31 * layer). Do not change the name of the following variable 'layers'. | |
32 */ | |
33 layers = []; | |
34 layers[0] = layer; | |
35 | |
36 <% | |
37 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); | |
38 MapService localMapService = sm.getLocalMapService(); | |
39 Iterator<Layer> it = localMapService.getLayer().iterator(); | |
40 int i = 1; | |
41 while (it.hasNext()){ | |
42 Layer layer = it.next(); | |
43 %> | |
44 layer<%=i%> = new OpenLayers.Layer.WMS.Untiled( | |
45 "<%=layer.getID() %>", | |
46 "<%=localMapService.getURL() %>", | |
47 { | |
48 layers: '<%=layer.getName()%>', | |
49 format: 'image/png', | |
50 transparent: true | |
51 }, | |
52 { | |
53 isBaseLayer: false | |
54 } | |
55 | |
56 ); | |
57 layers[<%=i%>] = layer<%=i++%>; | |
58 <%}%> | |
59 | |
60 } |