changeset 1404:09566522e899

Query GetFeatureInfo with layers defined in MapThemePanel - which are the real layers in the map. flys-client/trunk@3289 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 18 Nov 2011 12:12:07 +0000
parents 6a7cfe9d87fe
children 442ce7d6bc39
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java
diffstat 3 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Nov 18 12:06:16 2011 +0000
+++ b/flys-client/ChangeLog	Fri Nov 18 12:12:07 2011 +0000
@@ -1,3 +1,10 @@
+2011-11-18  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java,
+	  src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java:
+	  Fetch the list of themes used for the GetFeatureInfo request on the fly
+	  from MapThemePanel.
+
 2011-11-18  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java	Fri Nov 18 12:06:16 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java	Fri Nov 18 12:12:07 2011 +0000
@@ -13,11 +13,11 @@
 import org.gwtopenmaps.openlayers.client.event.MapClickListener;
 
 import de.intevation.flys.client.shared.model.FeatureInfo;
-import de.intevation.flys.client.shared.model.Theme;
 
 import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.client.services.GFIService;
 import de.intevation.flys.client.client.services.GFIServiceAsync;
+import de.intevation.flys.client.client.ui.ThemePanel;
 
 
 public class GetFeatureInfo implements MapClickListener {
@@ -26,9 +26,9 @@
 
     protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
 
-    protected Map         map;
-    protected List<Theme> themes;
-    protected String      infoFormat;
+    protected Map        map;
+    protected ThemePanel themePanel;
+    protected String     infoFormat;
 
 
     /**
@@ -37,9 +37,9 @@
      * @param url
      * @param infoFormat
      */
-    public GetFeatureInfo(Map map, List<Theme> themes, String infoFormat) {
+    public GetFeatureInfo(Map map, ThemePanel themePanel, String infoFormat) {
         this.map        = map;
-        this.themes     = themes;
+        this.themePanel = themePanel;
         this.infoFormat = infoFormat;
     }
 
@@ -60,7 +60,7 @@
         Pixel  pixel  = map.getPixelFromLonLat(lonlat);
 
         gfiService.query(
-            themes,
+            themePanel.getThemeList().getThemes(),
             infoFormat,
             map.getExtent().toString(),
             map.getProjection(),
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java	Fri Nov 18 12:06:16 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java	Fri Nov 18 12:12:07 2011 +0000
@@ -20,7 +20,6 @@
 import org.gwtopenmaps.openlayers.client.util.Attributes;
 
 import de.intevation.flys.client.client.FLYSConstants;
-import de.intevation.flys.client.client.ui.OutputTab;
 import de.intevation.flys.client.client.ui.Toolbar;
 import de.intevation.flys.client.client.utils.EnableDisableCmd;
 import de.intevation.flys.client.shared.model.ThemeList;
@@ -485,7 +484,7 @@
 
 
     protected ImgButton createGetFeatureInfo() {
-        OutputTab ot = getOutputTab();
+        MapOutputTab ot = (MapOutputTab) getOutputTab();
         if (ot == null) {
             return null;
         }
@@ -494,7 +493,7 @@
 
         getFeatureInfo = new GetFeatureInfo(
             getMap(),
-            tl.getThemes(),
+            ot.getThemePanel(),
             "gml");
 
         EnableDisableCmd cmd = new EnableDisableCmd() {

http://dive4elements.wald.intevation.org