diff flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java @ 1377:b0fe35d4ce6b

Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme. flys-client/trunk@3122 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 31 Oct 2011 11:52:42 +0000
parents 28eb4dfe2cbf
children 78542ff1f562
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Fri Oct 28 06:12:51 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Mon Oct 31 11:52:42 2011 +0000
@@ -401,6 +401,18 @@
                     map.zoomTo(map.getZoom()-1);
                     map.zoomTo(map.getZoom()+1);
                 }
+            },
+            new MapThemePanel.LayerZoomCallback() {
+                public void onLayerZoom(Theme theme, String extent) {
+                    Bounds zoomTo = boundsFromString(extent);
+
+                    if (zoomTo == null) {
+                        GWT.log("WARNING: No valid bounds for zooming found!");
+                        return;
+                    }
+
+                    getMap().zoomToExtent(zoomTo);
+                }
             }
         );
         c.addChild(themePanel);

http://dive4elements.wald.intevation.org