Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java @ 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 | af2aa716152f |
comparison
equal
deleted
inserted
replaced
2438:e0f4ea518d59 | 2439:46fc11ad697f |
---|---|
23 public class GetFeatureInfo implements MapClickListener { | 23 public class GetFeatureInfo implements MapClickListener { |
24 | 24 |
25 protected GFIServiceAsync gfiService = GWT.create(GFIService.class); | 25 protected GFIServiceAsync gfiService = GWT.create(GFIService.class); |
26 | 26 |
27 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); | 27 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
28 | |
29 protected GetFeatureInfoWindow gfiWindow; | |
28 | 30 |
29 protected Map map; | 31 protected Map map; |
30 protected ThemePanel themePanel; | 32 protected ThemePanel themePanel; |
31 protected String infoFormat; | 33 protected String infoFormat; |
32 | 34 |
52 map.removeListener(this); | 54 map.removeListener(this); |
53 } | 55 } |
54 } | 56 } |
55 | 57 |
56 | 58 |
59 protected void newGetFeatureInfoWindow(List<FeatureInfo> features) { | |
60 if (gfiWindow != null) { | |
61 gfiWindow.destroy(); | |
62 } | |
63 | |
64 gfiWindow = new GetFeatureInfoWindow(features); | |
65 gfiWindow.show(); | |
66 } | |
67 | |
68 | |
57 @Override | 69 @Override |
58 public void onClick(MapClickListener.MapClickEvent e) { | 70 public void onClick(MapClickListener.MapClickEvent e) { |
59 LonLat lonlat = e.getLonLat(); | 71 LonLat lonlat = e.getLonLat(); |
60 Pixel pixel = map.getPixelFromLonLat(lonlat); | 72 Pixel pixel = map.getPixelFromLonLat(lonlat); |
61 | 73 |
71 public void onFailure(Throwable e) { | 83 public void onFailure(Throwable e) { |
72 SC.warn(MSG.getString(e.getMessage())); | 84 SC.warn(MSG.getString(e.getMessage())); |
73 } | 85 } |
74 | 86 |
75 public void onSuccess(List<FeatureInfo> features) { | 87 public void onSuccess(List<FeatureInfo> features) { |
76 new GetFeatureInfoWindow(features).show(); | 88 newGetFeatureInfoWindow(features); |
77 } | 89 } |
78 }); | 90 }); |
79 } | 91 } |
80 } | 92 } |