Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java @ 1448:c39aa5a6478c
#409 Made layer list and map layers synchron.
flys-client/trunk@3465 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 19 Dec 2011 14:58:24 +0000 |
parents | 25be27e33b77 |
children | 0ba23e6fef0c |
comparison
equal
deleted
inserted
replaced
1447:c4bc320e3d44 | 1448:c39aa5a6478c |
---|---|
17 import com.smartgwt.client.widgets.menu.Menu; | 17 import com.smartgwt.client.widgets.menu.Menu; |
18 import com.smartgwt.client.widgets.menu.MenuItem; | 18 import com.smartgwt.client.widgets.menu.MenuItem; |
19 import com.smartgwt.client.widgets.menu.events.ClickHandler; | 19 import com.smartgwt.client.widgets.menu.events.ClickHandler; |
20 import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; | 20 import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; |
21 | 21 |
22 import org.gwtopenmaps.openlayers.client.Map; | |
23 import org.gwtopenmaps.openlayers.client.layer.Layer; | |
24 | |
25 import de.intevation.flys.client.shared.MapUtils; | 22 import de.intevation.flys.client.shared.MapUtils; |
26 import de.intevation.flys.client.shared.model.AttributedTheme; | 23 import de.intevation.flys.client.shared.model.AttributedTheme; |
27 import de.intevation.flys.client.shared.model.Collection; | 24 import de.intevation.flys.client.shared.model.Collection; |
28 import de.intevation.flys.client.shared.model.FacetRecord; | 25 import de.intevation.flys.client.shared.model.FacetRecord; |
29 import de.intevation.flys.client.shared.model.Theme; | 26 import de.intevation.flys.client.shared.model.Theme; |
195 | 192 |
196 @Override | 193 @Override |
197 protected void clearGrid() { | 194 protected void clearGrid() { |
198 oldRecords = list.getRecords(); | 195 oldRecords = list.getRecords(); |
199 super.clearGrid(); | 196 super.clearGrid(); |
200 } | |
201 | |
202 | |
203 /** | |
204 * This method calls super.updateGrid() at first. Finally, it is used to | |
205 * reorder the layers in the map. The first layer added to the map is the | |
206 * layer which is least visible. So, the order needs to be reflected. | |
207 */ | |
208 @Override | |
209 protected void updateGrid() { | |
210 super.updateGrid(); | |
211 | |
212 Map map = mapOut.getMap(); | |
213 int num = map.getNumLayers() - 1; // without the vector layer | |
214 | |
215 Layer[] layers = map.getLayers(); | |
216 | |
217 for (int i = 1; i < num; i++) { | |
218 map.raiseLayer(layers[i], num-i); | |
219 } | |
220 } | 197 } |
221 | 198 |
222 | 199 |
223 @Override | 200 @Override |
224 protected void addFacetRecord(FacetRecord rec) { | 201 protected void addFacetRecord(FacetRecord rec) { |