changeset 2438:e0f4ea518d59

Query GetFeatureInfo for active layers only. flys-client/trunk@4106 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 01 Mar 2012 15:07:04 +0000
parents 18478c9baa67
children 46fc11ad697f
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/shared/model/ThemeList.java
diffstat 3 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Mar 01 13:24:52 2012 +0000
+++ b/flys-client/ChangeLog	Thu Mar 01 15:07:04 2012 +0000
@@ -1,3 +1,11 @@
+2012-03-01  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/shared/model/ThemeList.java: New
+	  method getActiveThemes() that returns the active themes only.
+
+	* src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java:
+	  Query GetFeatureInfo for active layers only!
+
 2012-03-01  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java	Thu Mar 01 13:24:52 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java	Thu Mar 01 15:07:04 2012 +0000
@@ -60,7 +60,7 @@
         Pixel  pixel  = map.getPixelFromLonLat(lonlat);
 
         gfiService.query(
-            themePanel.getThemeList().getThemes(),
+            themePanel.getThemeList().getActiveThemes(),
             infoFormat,
             map.getExtent().toString(),
             map.getProjection(),
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java	Thu Mar 01 13:24:52 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java	Thu Mar 01 15:07:04 2012 +0000
@@ -2,6 +2,7 @@
 
 import java.io.Serializable;
 
+import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 
@@ -29,6 +30,24 @@
     }
 
 
+    public List<Theme> getActiveThemes() {
+        List<Theme> active = new ArrayList<Theme>();
+        List<Theme> all    = getThemes();
+
+        if (all == null || all.isEmpty()) {
+            return active;
+        }
+
+        for (Theme theme: all) {
+            if (theme.getActive() == 1) {
+                active.add(theme);
+            }
+        }
+
+        return active;
+    }
+
+
     public int getThemeCount() {
         return themes.size();
     }

http://dive4elements.wald.intevation.org