# HG changeset patch # User Tim Englich # Date 1276008551 0 # Node ID e3301755bd3c28ddd796220a02dfc5254cdb56f3 # Parent 556e16cc4da58f55ecbd6760ec7ab512c2fdd24e Improved the workflow for inserting new layer into the client. gnv/trunk@1178 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 556e16cc4da5 -r e3301755bd3c gnv/ChangeLog --- a/gnv/ChangeLog Tue Jun 08 13:57:05 2010 +0000 +++ b/gnv/ChangeLog Tue Jun 08 14:49:11 2010 +0000 @@ -1,3 +1,16 @@ +2010-06-08 Tim Englich + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: + Added localization for the message that will be displayed if no + layer where found. + + * src/main/webapp/scripts/olutils.jsp: + Improved the workflow for inserting new layer into the client. + If no layer are found using the given url an exceptionmessage will be + displayed using an ext-window. + Now it is also possible to add more than one layer at once. + 2010-06-08 Tim Englich * src/main/webapp/scripts/layers.jsp: diff -r 556e16cc4da5 -r e3301755bd3c gnv/src/main/resources/applicationMessages.properties --- a/gnv/src/main/resources/applicationMessages.properties Tue Jun 08 13:57:05 2010 +0000 +++ b/gnv/src/main/resources/applicationMessages.properties Tue Jun 08 14:49:11 2010 +0000 @@ -140,6 +140,8 @@ gnviewer.mapclient.wms.load.grid.title = Titel gnviewer.mapclient.wms.load.bt.text = Laden gnviewer.mapclient.wms.load.bt.tooltip = L\u00e4d das Capabilities Dokument vom angegebenen Server +gnviewer.mapclient.wms.load.grid.error.title = Fehler +gnviewer.mapclient.wms.load.grid.error.message = Unter der angegebenen Url konnten keine Layer ermittelt werden. gnviewer.mapclient.controls.nav.previous.title = Springt zum letzten Kartenausschnitt gnviewer.mapclient.controls.nav.next.title = Springt zum vorherigen Kartenausschnitt gnviewer.mapclient.controls.navigate.title = Verschieben der Karte diff -r 556e16cc4da5 -r e3301755bd3c gnv/src/main/resources/applicationMessages_en.properties --- a/gnv/src/main/resources/applicationMessages_en.properties Tue Jun 08 13:57:05 2010 +0000 +++ b/gnv/src/main/resources/applicationMessages_en.properties Tue Jun 08 14:49:11 2010 +0000 @@ -138,8 +138,10 @@ gnviewer.mapclient.wms.load.grid.title = Title gnviewer.mapclient.wms.load.bt.text = Load gnviewer.mapclient.wms.load.bt.tooltip = Load the Capabilities document from the given destination. +gnviewer.mapclient.wms.load.grid.error.title = Error +gnviewer.mapclient.wms.load.grid.error.message = No layer could be determined under the given url. gnviewer.mapclient.controls.nav.previous.title = Jumps to the last Mapview gnviewer.mapclient.controls.nav.next.title = Jumps to the last Mapview gnviewer.mapclient.controls.navigate.title = Moves the map -gnviewer.mapclient.controls.zoombox.title = Zoom by clicking an moving the mouseto generate a bix +gnviewer.mapclient.controls.zoombox.title = Zoom by clicking an moving the mouse to generate a box gnviewer.mapclient.controls.info.title = Identify features by clicking \ No newline at end of file diff -r 556e16cc4da5 -r e3301755bd3c gnv/src/main/webapp/scripts/olutils.jsp --- a/gnv/src/main/webapp/scripts/olutils.jsp Tue Jun 08 13:57:05 2010 +0000 +++ b/gnv/src/main/webapp/scripts/olutils.jsp Tue Jun 08 14:49:11 2010 +0000 @@ -85,19 +85,23 @@ function addLayer() { - var record = grid.getSelectionModel().getSelected(); - - if (record) { + var records = grid.getSelectionModel().getSelections(); + for (rec in records){ + + var record = records[rec]; + // TODO: Look for something better than object + if (typeof record == "object"){ var copy = record.copy(); copy.set("layer", record.get("layer")); copy.get("layer").mergeNewParams({ format: "image/png", transparent: true }); - + copy.singletile = true; mapPanel.layers.add(copy); - mapPanel.map.zoomToExtent(OpenLayers.Bounds.fromArray(copy.get("llbbox"))); - } + } + } + } @@ -113,6 +117,13 @@ return newUrl; } +function showWarning(){ + if (store.data.length == 0){ + Ext.MessageBox.alert("", '', grid); + return; + } +} + function updateCapabilities() { var ele = Ext.Element.get('capfield'); @@ -126,8 +137,10 @@ store = new GeoExt.data.WMSCapabilitiesStore({ url: url }); - store.load(); - + store.load({ + callback: showWarning + }); + grid.destroy(); grid = new Ext.grid.GridPanel({ id: 'wmsgrid',