comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/GetFeatureInfo.java @ 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 15ef3d3081b7
children e0f4ea518d59
comparison
equal deleted inserted replaced
1403:6a7cfe9d87fe 1404:09566522e899
11 import org.gwtopenmaps.openlayers.client.LonLat; 11 import org.gwtopenmaps.openlayers.client.LonLat;
12 import org.gwtopenmaps.openlayers.client.Pixel; 12 import org.gwtopenmaps.openlayers.client.Pixel;
13 import org.gwtopenmaps.openlayers.client.event.MapClickListener; 13 import org.gwtopenmaps.openlayers.client.event.MapClickListener;
14 14
15 import de.intevation.flys.client.shared.model.FeatureInfo; 15 import de.intevation.flys.client.shared.model.FeatureInfo;
16 import de.intevation.flys.client.shared.model.Theme;
17 16
18 import de.intevation.flys.client.client.FLYSConstants; 17 import de.intevation.flys.client.client.FLYSConstants;
19 import de.intevation.flys.client.client.services.GFIService; 18 import de.intevation.flys.client.client.services.GFIService;
20 import de.intevation.flys.client.client.services.GFIServiceAsync; 19 import de.intevation.flys.client.client.services.GFIServiceAsync;
20 import de.intevation.flys.client.client.ui.ThemePanel;
21 21
22 22
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 28
29 protected Map map; 29 protected Map map;
30 protected List<Theme> themes; 30 protected ThemePanel themePanel;
31 protected String infoFormat; 31 protected String infoFormat;
32 32
33 33
34 /** 34 /**
35 * @param map 35 * @param map
36 * @param themes 36 * @param themes
37 * @param url 37 * @param url
38 * @param infoFormat 38 * @param infoFormat
39 */ 39 */
40 public GetFeatureInfo(Map map, List<Theme> themes, String infoFormat) { 40 public GetFeatureInfo(Map map, ThemePanel themePanel, String infoFormat) {
41 this.map = map; 41 this.map = map;
42 this.themes = themes; 42 this.themePanel = themePanel;
43 this.infoFormat = infoFormat; 43 this.infoFormat = infoFormat;
44 } 44 }
45 45
46 46
47 public void activate(boolean activate) { 47 public void activate(boolean activate) {
58 public void onClick(MapClickListener.MapClickEvent e) { 58 public void onClick(MapClickListener.MapClickEvent e) {
59 LonLat lonlat = e.getLonLat(); 59 LonLat lonlat = e.getLonLat();
60 Pixel pixel = map.getPixelFromLonLat(lonlat); 60 Pixel pixel = map.getPixelFromLonLat(lonlat);
61 61
62 gfiService.query( 62 gfiService.query(
63 themes, 63 themePanel.getThemeList().getThemes(),
64 infoFormat, 64 infoFormat,
65 map.getExtent().toString(), 65 map.getExtent().toString(),
66 map.getProjection(), 66 map.getProjection(),
67 (int) map.getSize().getHeight(), 67 (int) map.getSize().getHeight(),
68 (int) map.getSize().getWidth(), 68 (int) map.getSize().getWidth(),

http://dive4elements.wald.intevation.org