changeset 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 d0500e993218
children ea9a73782de4
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java
diffstat 2 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 <ingo@intevation.de>
+
+	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 <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.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

http://dive4elements.wald.intevation.org