Mercurial > dive4elements > gnv-client
annotate gnv/src/main/webapp/scripts/olutils.jsp @ 1138:2c00570ab3bd
merged doc
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:02 +0200 |
parents | 3665834344a8 |
children |
rev | line source |
---|---|
987
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 function handleMeasurements(event) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 var geometry = event.geometry; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 var units = event.units; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 var order = event.order; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
6 var measure = event.measure; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
7 var element = document.getElementById('measurements'); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 var out = ""; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
10 if(order == 1) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
11 out += "L\u00e4nge: " + measure.toFixed(3) + " " + units; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
12 } else { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
13 out += "Fl\u00e4che: " + measure.toFixed(3) + " " + units + "<sup>2</sup>"; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
14 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 element.innerHTML=out; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 }; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
19 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
20 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 function readWMC(merge) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
22 var layers = mapPanel.layers; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 map = mapPanel.map; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
24 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 var format = new OpenLayers.Format.WMC({'layerOptions': {buffer: 0}}); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 var text = document.getElementById("wmc").value; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
27 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 merge = true; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 if(merge) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
30 try { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
31 map = format.read(text, {map: map}); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 } catch(err) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 document.getElementById("wmc").value = err; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
35 } else { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
36 map.destroy(); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
37 try { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
38 var jsonFormat = new OpenLayers.Format.JSON(); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 var mapOptions = jsonFormat.read(); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 map = format.read(text, {map: mapOptions}); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 } catch(err) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 document.getElementById("wmc").value = err; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
43 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
46 // create MapPanel |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 mapPanel = new GeoExt.MapPanel({ |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
48 border: true, |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 title: "Karte", |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
50 region: "center", |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
51 map: map, |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
52 zoom: 1, |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
53 layers: map.layers |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
54 }); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
55 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
57 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
58 function writeWMC(merge) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
59 var format = new OpenLayers.Format.WMC({'layerOptions': {buffer: 0}}); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
60 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
61 try { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
62 var text = format.write(map); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
63 document.getElementById("wmc").value = text; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
64 } catch(err) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 document.getElementById("wmc").value = err; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
66 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
67 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
68 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
69 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
70 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
71 function toggleGetFeatureInfo(evt) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
72 if (infoActive) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
73 infoControls.click.deactivate(); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
74 infoActive = false; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
75 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
76 else { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
77 infoControls.click.activate(); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
78 infoActive = true; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
79 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
80 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
81 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
82 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
83 function showInfo(evt) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
84 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
85 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
86 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
87 function addLayer() { |
989
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
88 var records = grid.getSelectionModel().getSelections(); |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
89 for (rec in records){ |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
90 |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
91 var record = records[rec]; |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
92 // TODO: Look for something better than object |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
93 if (typeof record == "object"){ |
987
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
94 var copy = record.copy(); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
95 copy.set("layer", record.get("layer")); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
96 copy.get("layer").mergeNewParams({ |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
97 format: "image/png", |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
98 transparent: true |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
99 }); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
100 mapPanel.layers.add(copy); |
989
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
101 } |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
102 } |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
103 |
987
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
104 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
105 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
106 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
107 // this is just copied from OpenLayers.Util |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
108 function urlAppend(url, paramStr) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
109 var newUrl = url; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 if(paramStr) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
111 var parts = (url + " ").split(/[?&]/); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
112 newUrl += (parts.pop() === " " ? |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
113 paramStr : |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
114 parts.length ? "&" + paramStr : "?" + paramStr); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
115 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
116 return newUrl; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
117 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
118 |
989
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
119 function showWarning(){ |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
120 if (store.data.length == 0){ |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
121 Ext.MessageBox.alert("<bean:message key="gnviewer.mapclient.wms.load.grid.error.title"/>", '<bean:message key="gnviewer.mapclient.wms.load.grid.error.message"/>', grid); |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
122 return; |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
123 } |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
124 } |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
125 |
987
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
126 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
127 function updateCapabilities() { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
128 |
1016
3665834344a8
Issue317: Provide a Comboboy with given WMS instead of an Textfield
Tim Englich <tim.englich@intevation.de>
parents:
997
diff
changeset
|
129 var url = capfield.getValue(); |
987
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
130 var service = "SERVICE=WMS"; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
131 var request = "REQUEST=GetCapabilities"; |
1016
3665834344a8
Issue317: Provide a Comboboy with given WMS instead of an Textfield
Tim Englich <tim.englich@intevation.de>
parents:
997
diff
changeset
|
132 var version = "VERSION=1.1.1"; |
987
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
133 url = urlAppend(url, service); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
134 url = urlAppend(url, request); |
1016
3665834344a8
Issue317: Provide a Comboboy with given WMS instead of an Textfield
Tim Englich <tim.englich@intevation.de>
parents:
997
diff
changeset
|
135 url = urlAppend(url, version); |
987
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
136 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
137 store = new GeoExt.data.WMSCapabilitiesStore({ |
1016
3665834344a8
Issue317: Provide a Comboboy with given WMS instead of an Textfield
Tim Englich <tim.englich@intevation.de>
parents:
997
diff
changeset
|
138 url: url, |
3665834344a8
Issue317: Provide a Comboboy with given WMS instead of an Textfield
Tim Englich <tim.englich@intevation.de>
parents:
997
diff
changeset
|
139 layerOptions: {singleTile: true} |
987
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
140 }); |
989
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
141 store.load({ |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
142 callback: showWarning |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
143 }); |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
144 |
987
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
145 grid.destroy(); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
146 grid = new Ext.grid.GridPanel({ |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
147 id: 'wmsgrid', |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
148 collapsible: false, |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
149 split: false, |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
150 border: true, |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
151 // TODO: autoHeight might cause trouble |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
152 autoHeight: true, |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
153 overflow: 'auto', |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
154 store: store, |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
155 cm: new Ext.grid.ColumnModel([ |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
156 { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
157 header: '<bean:message key="gnviewer.mapclient.wms.load.grid.name"/>', |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
158 dataIndex: 'name', |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
159 sortable: true |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
160 }, |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
161 { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
162 id: 'title', |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
163 header: '<bean:message key="gnviewer.mapclient.wms.load.grid.title"/>', |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
164 dataIndex: 'title', |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
165 sortable: true |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
166 }]), |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
167 renderTo: 'capgrid', |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
168 bbar: [{ |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
169 text: '<bean:message key="gnviewer.mapclient.wms.load.addlayer"/>', |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
170 handler: addLayer |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
171 }] |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
172 }); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
173 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
174 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
175 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
176 function editFeature(e) { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
177 var feature = e.feature; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
178 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
179 // TODO SET FEATURE ATTRIBUTES |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
180 //feature.attributes['lawa'] = 999; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
181 //feature.attributes['lawa_id'] = 999; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
182 //feature.attributes['w_gwk_lawa'] = 999; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
183 //feature.attributes['w_wrrl'] = 999; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
184 //feature.attributes['length_fee'] = 999; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
185 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
186 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
187 function updateControls() { |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
188 var controls = panel.controls; |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
189 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
190 controls.remove(drawPointControl); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
191 controls.remove(drawPathControl); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
192 controls.remove(drawPolygonControl); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
193 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
194 panel.destroy(); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
195 panel = new OpenLayers.Control.Panel(); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
196 panel.addControls(controls); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
197 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
198 if (points.getVisibility()) |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
199 panel.addControls(drawPointControl); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
200 if (lines.getVisibility()) |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
201 panel.addControls(drawPathControl); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
202 if (polygons.getVisibility()) |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
203 panel.addControls(drawPolygonControl); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
204 |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
205 map.addControl(panel); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
206 } |
997
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
207 function parseGetFeatureInfoData(event) { |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
208 var contentHTML = "<div>"; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
209 var features = event.features; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
210 var first = true; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
211 for (feat in features){ |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
212 if (feat != 'remove'){ |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
213 var feature = features[feat]; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
214 var attributes = feature.attributes; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
215 if (first){ |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
216 first = false; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
217 }else{ |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
218 contentHTML += "<br/>"; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
219 } |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
220 contentHTML += "<table>"; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
221 for (att in attributes){ |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
222 contentHTML += "<tr><td><b>"+att+":</b></td><td>" + attributes[att] + "</td></tr>"; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
223 } |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
224 contentHTML += "</table>"; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
225 } |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
226 |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
227 } |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
228 contentHTML += "</div>"; |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
229 |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
230 mapPanel.map.addPopup(new OpenLayers.Popup.FramedCloud( |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
231 "chicken", |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
232 mapPanel.map.getLonLatFromPixel(event.xy), |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
233 null, |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
234 contentHTML, |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
235 null, |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
236 true |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
237 )); |
f55692e3e0ce
Modified output of the GetfeatureInfo-request.
Tim Englich <tim.englich@intevation.de>
parents:
989
diff
changeset
|
238 } |