comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java @ 1269:45791d12a1f4

Bugfix: #298 Floodmaps initial zoom is determined by the WSPLGEN layer's extent. flys-client/trunk@2828 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 26 Sep 2011 15:38:27 +0000
parents c89a42950d11
children 2e57776f77b5
comparison
equal deleted inserted replaced
1268:d0500e993218 1269:45791d12a1f4
52 52
53 public static final String DEFAULT_SRID = "4326"; 53 public static final String DEFAULT_SRID = "4326";
54 54
55 public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers"; 55 public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers";
56 56
57 public static final String WSPLGEN_FACET = "floodmap.wsplgen";
58
57 59
58 protected StepForwardServiceAsync feedService = 60 protected StepForwardServiceAsync feedService =
59 GWT.create(StepForwardService.class); 61 GWT.create(StepForwardService.class);
60 62
61 protected CollectionView parent; 63 protected CollectionView parent;
138 protected void initLayers() { 140 protected void initLayers() {
139 ThemeList themeList = themePanel.getThemeList(); 141 ThemeList themeList = themePanel.getThemeList();
140 142
141 int num = themeList.getThemeCount(); 143 int num = themeList.getThemeCount();
142 144
143 Map map = floodMap.getMap(); 145 Map map = floodMap.getMap();
144 Bounds extent = null; 146 Bounds extent = null;
147 Bounds wsplgenExtent = null;
145 148
146 for (int i = 1; i <= num; i++) { 149 for (int i = 1; i <= num; i++) {
147 Theme theme = themeList.getThemeAt(i); 150 Theme theme = themeList.getThemeAt(i);
148 Layer layer = createWMSLayer(theme); 151 Layer layer = createWMSLayer(theme);
149 152
154 map.addLayer(layer); 157 map.addLayer(layer);
155 158
156 AttributedTheme at = (AttributedTheme) theme; 159 AttributedTheme at = (AttributedTheme) theme;
157 String tmp = at.getAttr("extent"); 160 String tmp = at.getAttr("extent");
158 161
162 if (WSPLGEN_FACET.equals(at.getFacet())) {
163 // if there is a wsplgen layer, we want to zoom to
164 // that place initially
165 wsplgenExtent = boundsFromString(tmp);
166 }
167
159 if (theme.getActive() == 1) { 168 if (theme.getActive() == 1) {
160 if (extent == null) { 169 if (extent == null) {
161 extent = boundsFromString(tmp); 170 extent = boundsFromString(tmp);
162 } 171 }
163 else { 172 else {
167 extent.extend(b); 176 extent.extend(b);
168 } 177 }
169 } 178 }
170 } 179 }
171 } 180 }
181
182 extent = wsplgenExtent != null ? wsplgenExtent : extent;
172 183
173 GWT.log("Maps initial extent = " + extent); 184 GWT.log("Maps initial extent = " + extent);
174 185
175 map.zoomToExtent(extent != null 186 map.zoomToExtent(extent != null
176 ? extent 187 ? extent

http://dive4elements.wald.intevation.org