Mercurial > dive4elements > gnv-client
comparison gnv/src/main/webapp/scripts/viewport.jsp @ 980:80a5cde45d12
Added i18n support to the mapclient.
gnv/trunk@1158 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 04 Jun 2010 11:45:39 +0000 |
parents | 5779220ebb80 |
children | cd9414538f10 |
comparison
equal
deleted
inserted
replaced
979:96db238fc5ab | 980:80a5cde45d12 |
---|---|
1 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> | |
2 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> | |
1 OpenLayers.ProxyHost= "/cgi-bin/proxy.cgi?url="; | 3 OpenLayers.ProxyHost= "/cgi-bin/proxy.cgi?url="; |
4 OpenLayers.Lang.setCode('<%=SessionModelFactory.getInstance().getSessionModel(request).getCurrentLocale().getLanguage() %>'); | |
2 Ext.BLANK_IMAGE_URL = "scripts/openlayers/OpenLayers-2.9/theme/default/img/blank.gif"; | 5 Ext.BLANK_IMAGE_URL = "scripts/openlayers/OpenLayers-2.9/theme/default/img/blank.gif"; |
3 | 6 |
4 /** | 7 /** |
5 * XXX | 8 * XXX |
6 * Change specific attributes for map, wfs-t, etc here. Do not change these | 9 * Change specific attributes for map, wfs-t, etc here. Do not change these |
36 | 39 |
37 // add controls | 40 // add controls |
38 | 41 |
39 | 42 |
40 var nav = new OpenLayers.Control.NavigationHistory(); | 43 var nav = new OpenLayers.Control.NavigationHistory(); |
44 nav.previous.title = "<bean:message key="gnviewer.mapclient.controls.nav.previous.title"/>"; | |
45 nav.next.title = "<bean:message key="gnviewer.mapclient.controls.nav.next.title"/>"; | |
41 map.addControl(nav); | 46 map.addControl(nav); |
42 | 47 |
43 panel = new OpenLayers.Control.Panel(); | 48 panel = new OpenLayers.Control.Panel(); |
44 controls = { | 49 controls = { |
45 previous: nav.previous, | 50 previous: nav.previous, |
46 next : nav.next, | 51 next : nav.next, |
47 navigate: new OpenLayers.Control.MouseDefaults( | 52 navigate: new OpenLayers.Control.MouseDefaults( |
48 { | 53 { |
49 displayClass: 'olControlPan', | 54 displayClass: 'olControlPan', |
50 title:'Verschieben der Karte' | 55 title:'<bean:message key="gnviewer.mapclient.controls.navigate.title"/>' |
51 } | 56 } |
52 ), | 57 ), |
53 zoombox: new OpenLayers.Control.ZoomBox( | 58 zoombox: new OpenLayers.Control.ZoomBox( |
54 { | 59 { |
55 displayClass: 'olControlZoomBox', | 60 displayClass: 'olControlZoomBox', |
56 title: 'Zum Zoomen ziehen Sie eine Box auf, indem Sie klicken und ziehen' | 61 title: '<bean:message key="gnviewer.mapclient.controls.zoombox.title"/>' |
57 } | 62 } |
58 ), | 63 ), |
59 info : new OpenLayers.Control.WMSGetFeatureInfo({ | 64 info : new OpenLayers.Control.WMSGetFeatureInfo({ |
60 displayClass: "olControlFeatureInfo", | 65 displayClass: "olControlFeatureInfo", |
61 url: 'http://fluggs.wupperverband.de/wmsconnector/com.esri.wms.Esrimap/WV_WMS', | 66 url: 'http://fluggs.wupperverband.de/wmsconnector/com.esri.wms.Esrimap/WV_WMS', |
62 title: 'Identify features by clicking', | 67 title: '<bean:message key="gnviewer.mapclient.controls.info.title"/>', |
63 queryVisible: true, | 68 queryVisible: true, |
64 eventListeners: { | 69 eventListeners: { |
65 getfeatureinfo: function(event) { | 70 getfeatureinfo: function(event) { |
66 mapPanel.map.addPopup(new OpenLayers.Popup.FramedCloud( | 71 mapPanel.map.addPopup(new OpenLayers.Popup.FramedCloud( |
67 "chicken", | 72 "chicken", |
113 //height: 400, | 118 //height: 400, |
114 autoHeight: true, | 119 autoHeight: true, |
115 store: store, | 120 store: store, |
116 cm: new Ext.grid.ColumnModel([ | 121 cm: new Ext.grid.ColumnModel([ |
117 { | 122 { |
118 header: 'Name', | 123 header: '<bean:message key="gnviewer.mapclient.wms.load.grid.name"/>', |
119 dataIndex: 'name', | 124 dataIndex: 'name', |
120 sortable: true | 125 sortable: true |
121 }, | 126 }, |
122 { | 127 { |
123 id: 'title', | 128 id: 'title', |
124 header: 'Title', | 129 header: '<bean:message key="gnviewer.mapclient.wms.load.grid.title"/>', |
125 dataIndex: 'title', | 130 dataIndex: 'title', |
126 sortable: true | 131 sortable: true |
127 }]), | 132 }]), |
128 renderTo: 'capgrid', | 133 renderTo: 'capgrid', |
129 bbar: [{ | 134 bbar: [{ |
130 text: 'Add Layer', | 135 text: '<bean:message key="gnviewer.mapclient.wms.load.addlayer"/>', |
131 handler: addLayer | 136 handler: addLayer |
132 }] | 137 }] |
133 }); | 138 }); |
134 var cap = new Ext.Panel({ | 139 var cap = new Ext.Panel({ |
135 id: 'wmspanel', | 140 id: 'wmspanel', |
136 border: true, | 141 border: true, |
137 region: 'east', | 142 region: 'east', |
138 title: 'WMS Capabilities', | 143 title: '<bean:message key="gnviewer.mapclient.wms.load.title"/>', |
139 collapsible: false, | 144 collapsible: false, |
140 split: false, | 145 split: false, |
141 contentEl: 'cap', | 146 contentEl: 'cap', |
142 height: 400 | 147 height: 400 |
143 }); | 148 }); |
151 | 156 |
152 var capbutton = new Ext.Button({ | 157 var capbutton = new Ext.Button({ |
153 id: 'capbutton', | 158 id: 'capbutton', |
154 region: 'west', | 159 region: 'west', |
155 handler: updateCapabilities, | 160 handler: updateCapabilities, |
156 text: 'Lade', | 161 text: '<bean:message key="gnviewer.mapclient.wms.load.bt.text"/>', |
157 tooltip: 'Lade GetCapabilities Dokument', | 162 tooltip: '<bean:message key="gnviewer.mapclient.wms.load.bt.tooltip"/>', |
158 renderTo: 'urlbutton' | 163 renderTo: 'urlbutton' |
159 }); | 164 }); |
160 | 165 |
161 | 166 |
162 | 167 |
167 // LayerTree | 172 // LayerTree |
168 var tree = new Ext.tree.TreePanel({ | 173 var tree = new Ext.tree.TreePanel({ |
169 border: true, | 174 border: true, |
170 enableDD: true, | 175 enableDD: true, |
171 region: "east", | 176 region: "east", |
172 title: "LayerTree", | 177 title: "<bean:message key="gnviewer.mapclient.layercontrol"/>", |
173 width: 200, | 178 width: 200, |
174 split: true, | 179 split: true, |
175 collapsible: false, | 180 collapsible: false, |
176 collapseMode: "mini", | 181 collapseMode: "mini", |
177 autoScroll: true, | 182 autoScroll: true, |
180 }), | 185 }), |
181 root: { | 186 root: { |
182 nodeType: "async", | 187 nodeType: "async", |
183 children: [{ | 188 children: [{ |
184 nodeType: "gx_baselayercontainer", | 189 nodeType: "gx_baselayercontainer", |
190 text: "<bean:message key="gnviewer.mapclient.layercontrol.baselayer"/>", | |
185 expanded: true | 191 expanded: true |
186 }, { | 192 }, { |
187 nodeType: "gx_overlaylayercontainer", | 193 nodeType: "gx_overlaylayercontainer", |
194 text: "<bean:message key="gnviewer.mapclient.layercontrol.overlay"/>", | |
188 expanded: true, | 195 expanded: true, |
189 loader: { | 196 loader: { |
190 filter: function(record) { | 197 filter: function(record) { |
191 var layer = record.get("layer"); | 198 var layer = record.get("layer"); |
192 return layer.displayInLayerSwitcher === true && | 199 return layer.displayInLayerSwitcher === true && |
204 // create legend panel | 211 // create legend panel |
205 legendPanel = new GeoExt.LegendPanel({ | 212 legendPanel = new GeoExt.LegendPanel({ |
206 id: 'legendpanel', | 213 id: 'legendpanel', |
207 dynamic: true, | 214 dynamic: true, |
208 border: true, | 215 border: true, |
209 title: 'Legende', | 216 title: '<bean:message key="gnviewer.mapclient.legend"/>', |
210 collapsible: false, | 217 collapsible: false, |
211 split: false, | 218 split: false, |
212 defaults: { | 219 defaults: { |
213 labelCls: 'legend', | 220 labelCls: 'legend', |
214 style: 'padding: 5px' | 221 style: 'padding: 5px' |
215 }, | 222 }, |
216 bodyStyle: 'padding:5px', | 223 bodyStyle: 'padding:5px', |
217 width: 250, | 224 width: 250, |
218 autoScroll: true, | 225 autoScroll: true, |
219 region: 'east' | 226 region: 'east', |
220 //layerStore: mapPanel.layers | |
221 }); | 227 }); |
222 | 228 |
223 | 229 |
224 // use separate panels | 230 // use separate panels |
225 // Create GUI | 231 // Create GUI |
250 | 256 |
251 // The main panel | 257 // The main panel |
252 new Ext.Panel({ | 258 new Ext.Panel({ |
253 renderTo: "mapcontainer", | 259 renderTo: "mapcontainer", |
254 layout: "border", | 260 layout: "border", |
255 width: 700, | 261 height: 400, |
256 height: 420, | |
257 items: [mapPanel, mylegend] | 262 items: [mapPanel, mylegend] |
258 }); | 263 }); |
259 | 264 |
260 }); | 265 }); |