Mercurial > dive4elements > gnv-client
annotate gnv/src/main/webapp/scripts/olutils.jsp @ 990:56b22bc68dfa
Added error messages for Java heap size errors (issue177).
gnv/trunk@1190 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 10 Jun 2010 09:54:58 +0000 |
parents | e3301755bd3c |
children | f55692e3e0ce |
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 }); |
989
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
100 copy.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
|
101 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
|
102 } |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
103 } |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
104 |
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
|
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 |
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 // 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
|
109 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
|
110 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
|
111 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
|
112 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
|
113 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
|
114 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 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
|
116 } |
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 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
|
118 } |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
119 |
989
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
120 function showWarning(){ |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
121 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
|
122 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
|
123 return; |
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 } |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
126 |
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
|
127 |
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 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
|
129 var ele = Ext.Element.get('capfield'); |
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 |
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 url = ele.getValue(); |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
132 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
|
133 var request = "REQUEST=GetCapabilities"; |
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, 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
|
135 url = urlAppend(url, request); |
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({ |
42da41835b54
Rename olutils.js to olutils.jsp to enable possibility of i18n in this file.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
138 url: 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
|
139 }); |
989
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
140 store.load({ |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
141 callback: showWarning |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
142 }); |
e3301755bd3c
Improved the workflow for inserting new layer into the client.
Tim Englich <tim.englich@intevation.de>
parents:
987
diff
changeset
|
143 |
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
|
144 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
|
145 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
|
146 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
|
147 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
|
148 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
|
149 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
|
150 // 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
|
151 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
|
152 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
|
153 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
|
154 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
|
155 { |
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 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
|
157 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
|
158 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
|
159 }, |
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 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
|
162 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
|
163 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
|
164 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
|
165 }]), |
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 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
|
167 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
|
168 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
|
169 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
|
170 }] |
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 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
|
176 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
|
177 |
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 // 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
|
179 //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
|
180 //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
|
181 //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
|
182 //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
|
183 //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
|
184 } |
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 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
|
187 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
|
188 |
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 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
|
190 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
|
191 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
|
192 |
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 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
|
194 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
|
195 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
|
196 |
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 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
|
198 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
|
199 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
|
200 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
|
201 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
|
202 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
|
203 |
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 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
|
205 } |