# HG changeset patch # User Ingo Weinzierl # Date 1317051507 0 # Node ID 45791d12a1f4a075786e266e9613e45e84e0653b # Parent d0500e993218756366293afa1f43fd18cfe44e59 Bugfix: #298 Floodmaps initial zoom is determined by the WSPLGEN layer's extent. flys-client/trunk@2828 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r d0500e993218 -r 45791d12a1f4 flys-client/ChangeLog --- a/flys-client/ChangeLog Mon Sep 26 11:04:00 2011 +0000 +++ b/flys-client/ChangeLog Mon Sep 26 15:38:27 2011 +0000 @@ -1,3 +1,12 @@ +2011-09-26 Ingo Weinzierl + + flys/issue298 (Karte: Automatischer Zoom auf Berechnungsergebnisse) + + * src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java: + The initial zoom of the map is determined by the extents of all layers + in the map OR by the wsplgen layer, if such layer is existing and if it + has an extent set. + 2011-09-26 Ingo Weinzierl * src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java: diff -r d0500e993218 -r 45791d12a1f4 flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java Mon Sep 26 11:04:00 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java Mon Sep 26 15:38:27 2011 +0000 @@ -54,6 +54,8 @@ public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers"; + public static final String WSPLGEN_FACET = "floodmap.wsplgen"; + protected StepForwardServiceAsync feedService = GWT.create(StepForwardService.class); @@ -140,8 +142,9 @@ int num = themeList.getThemeCount(); - Map map = floodMap.getMap(); - Bounds extent = null; + Map map = floodMap.getMap(); + Bounds extent = null; + Bounds wsplgenExtent = null; for (int i = 1; i <= num; i++) { Theme theme = themeList.getThemeAt(i); @@ -156,6 +159,12 @@ AttributedTheme at = (AttributedTheme) theme; String tmp = at.getAttr("extent"); + if (WSPLGEN_FACET.equals(at.getFacet())) { + // if there is a wsplgen layer, we want to zoom to + // that place initially + wsplgenExtent = boundsFromString(tmp); + } + if (theme.getActive() == 1) { if (extent == null) { extent = boundsFromString(tmp); @@ -170,6 +179,8 @@ } } + extent = wsplgenExtent != null ? wsplgenExtent : extent; + GWT.log("Maps initial extent = " + extent); map.zoomToExtent(extent != null