changeset 2439:46fc11ad697f

#555 Close existing GetFeatureInfoWindows before creating new ones. flys-client/trunk@4107 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 01 Mar 2012 15:18:33 +0000
parents e0f4ea518d59
children 661e3ae77c8a
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java
diffstat 2 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Mar 01 15:07:04 2012 +0000
+++ b/flys-client/ChangeLog	Thu Mar 01 15:18:33 2012 +0000
@@ -1,3 +1,10 @@
+2012-03-01  Ingo Weinzierl <ingo@intevation.de>
+
+	flys/issue555 (ÜSK: Info-Button)
+
+	* src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java:
+	  Close old GetFeatureInfoWindows before creating new ones.
+
 2012-03-01  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/shared/model/ThemeList.java: New
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java	Thu Mar 01 15:07:04 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java	Thu Mar 01 15:18:33 2012 +0000
@@ -26,6 +26,8 @@
 
     protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
 
+    protected GetFeatureInfoWindow gfiWindow;
+
     protected Map        map;
     protected ThemePanel themePanel;
     protected String     infoFormat;
@@ -54,6 +56,16 @@
     }
 
 
+    protected void newGetFeatureInfoWindow(List<FeatureInfo> features) {
+        if (gfiWindow != null) {
+            gfiWindow.destroy();
+        }
+
+        gfiWindow = new GetFeatureInfoWindow(features);
+        gfiWindow.show();
+    }
+
+
     @Override
     public void onClick(MapClickListener.MapClickEvent e) {
         LonLat lonlat = e.getLonLat();
@@ -73,7 +85,7 @@
             }
 
             public void onSuccess(List<FeatureInfo> features) {
-                new GetFeatureInfoWindow(features).show();
+                newGetFeatureInfoWindow(features);
             }
         });
     }

http://dive4elements.wald.intevation.org