comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java @ 1403:6a7cfe9d87fe

Repaired broken WMS layer controls in map theme panel. flys-client/trunk@3288 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 18 Nov 2011 12:06:16 +0000
parents 96708d81eaf6
children 659a488243da
comparison
equal deleted inserted replaced
1402:15ef3d3081b7 1403:6a7cfe9d87fe
403 }, 403 },
404 new MapThemePanel.ThemeMovedCallback() { 404 new MapThemePanel.ThemeMovedCallback() {
405 public void onThemeMoved(Theme theme, int oldIdx, int newIdx) { 405 public void onThemeMoved(Theme theme, int oldIdx, int newIdx) {
406 // this code synchronizes the ThemePanel and the OpenLayers 406 // this code synchronizes the ThemePanel and the OpenLayers
407 // internal order of layers. 407 // internal order of layers.
408 String name = theme.getDescription(); 408 AttributedTheme at = (AttributedTheme) theme;
409
410 String name = at.getAttr("layers");
409 Map map = getMap(); 411 Map map = getMap();
410 Layer[] layers = map.getLayersByName(name); 412 Layer[] layers = map.getLayersByName(name);
411 413
412 if (layers == null || layers.length == 0) { 414 if (layers == null || layers.length == 0) {
413 GWT.log("Error: Cannot find layer '" + name + "'"); 415 GWT.log("Error: Cannot find layer '" + name + "'");
438 return c; 440 return c;
439 } 441 }
440 442
441 443
442 protected void activateTheme(Theme theme, boolean active) { 444 protected void activateTheme(Theme theme, boolean active) {
443 String name = theme.getDescription(); 445 AttributedTheme at = (AttributedTheme) theme;
446
447 String name = at.getAttr("layers");
444 Layer layer = floodMap.getMap().getLayerByName(name); 448 Layer layer = floodMap.getMap().getLayerByName(name);
445 449
446 GWT.log("Set visibility of '" + name + "': " + active); 450 GWT.log("Set visibility of '" + name + "': " + active);
447 451
448 if (layer != null) { 452 if (layer != null) {

http://dive4elements.wald.intevation.org