diff flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java @ 3347:6d749af6a9c2

Issue #726 work. flys-client/trunk@5022 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Christian Lins <christian.lins@intevation.de>
date Tue, 17 Jul 2012 11:45:35 +0000
parents ddf43791244c
children c84630d544a1
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java	Mon Jul 16 08:37:24 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java	Tue Jul 17 11:45:35 2012 +0000
@@ -1,6 +1,7 @@
 package de.intevation.flys.client.client.ui.map;
 
 import org.gwtopenmaps.openlayers.client.Bounds;
+import org.gwtopenmaps.openlayers.client.LonLat;
 import org.gwtopenmaps.openlayers.client.Map;
 import org.gwtopenmaps.openlayers.client.MapOptions;
 import org.gwtopenmaps.openlayers.client.MapWidget;
@@ -8,7 +9,6 @@
 import org.gwtopenmaps.openlayers.client.control.ScaleLine;
 import org.gwtopenmaps.openlayers.client.control.ScaleLineOptions;
 import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener;
-import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener.FeatureAddedEvent;
 import org.gwtopenmaps.openlayers.client.feature.VectorFeature;
 import org.gwtopenmaps.openlayers.client.format.GeoJSON;
 import org.gwtopenmaps.openlayers.client.layer.Layer;
@@ -17,7 +17,6 @@
 import org.gwtopenmaps.openlayers.client.util.Attributes;
 import org.gwtopenmaps.openlayers.client.util.JObjectArray;
 import org.gwtopenmaps.openlayers.client.util.JSObject;
-import org.gwtopenmaps.openlayers.client.LonLat;
 
 
 public class FloodMap implements VectorFeatureAddedListener {
@@ -38,7 +37,12 @@
     public FloodMap(String srid, Bounds maxExtent) {
         this.srid      = srid;
         this.maxExtent = maxExtent;
+        recreateWidget("100%", "99px");
+        getBarrierLayer();
+    }
 
+
+    public void recreateWidget(String width, String height) {
         MapOptions opts = new MapOptions();
         opts.setControls(new JObjectArray(new JSObject[] {}));
         opts.setNumZoomLevels(16);
@@ -47,10 +51,8 @@
         opts.setUnits("m");
         opts.setMaxResolution(500); // TODO DO THIS ON THE FLY
 
-        mapWidget = new MapWidget("510px", "635px", opts);
+        mapWidget = new MapWidget(width, height, opts);
         map       = mapWidget.getMap();
-
-        getBarrierLayer();
     }
 
 

http://dive4elements.wald.intevation.org