Mercurial > dive4elements > river
changeset 1306:2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
flys-client/trunk@2940 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 11 Oct 2011 13:25:18 +0000 |
parents | 014fc183c640 |
children | 489e6a82fe84 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java |
diffstat | 2 files changed, 37 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Tue Oct 11 12:20:32 2011 +0000 +++ b/flys-client/ChangeLog Tue Oct 11 13:25:18 2011 +0000 @@ -1,3 +1,11 @@ +2011-10-11 Ingo Weinzierl <ingo@intevation.de> + + flys/issue300 (ÜSK: Reihenfolge der Ebenen findet keine Berücksichtigung) + + * src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java: + Implemented a ThemeMovedCallback to synchronize the ThemePanel's layer + order with the internal order of the Map. + 2011-10-11 Felix Wolfsteller <felix.wolfsteller@intevation.de> Squashed "swapped minuend and subtrahend"-bug in wdiff calculation.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java Tue Oct 11 12:20:32 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java Tue Oct 11 13:25:18 2011 +0000 @@ -146,7 +146,7 @@ Bounds extent = null; Bounds wsplgenExtent = null; - for (int i = 1; i <= num; i++) { + for (int i = num; i >= 0; i--) { Theme theme = themeList.getThemeAt(i); Layer layer = createWMSLayer(theme); @@ -231,6 +231,11 @@ } + protected Map getMap() { + return floodMap.getMap(); + } + + protected String getGeoJSONFromDynamic(ArtifactDescription desc) { DataList list = desc.getCurrentData(); @@ -401,11 +406,32 @@ c.setBorder("1px solid black"); themePanel = new MapThemePanel( - collection, mode, new MapThemePanel.ActivateCallback() { + collection, + mode, + new MapThemePanel.ActivateCallback() { public void activate(Theme theme, boolean active) { activateTheme(theme, active); } - }); + }, + new MapThemePanel.ThemeMovedCallback() { + public void onThemeMoved(Theme theme, int oldIdx, int newIdx) { + // this code synchronizes the ThemePanel and the OpenLayers + // internal order of layers. + String name = theme.getDescription(); + Map map = getMap(); + Layer[] layers = map.getLayersByName(name); + + if (layers == null || layers.length == 0) { + GWT.log("Error: Cannot find layer '" + name + "'"); + return; + } + + map.raiseLayer(layers[0], (newIdx-oldIdx)*-1); + map.zoomTo(map.getZoom()-1); + map.zoomTo(map.getZoom()+1); + } + } + ); c.addChild(themePanel); return c;