[Dive4elements-commits] [PATCH] Try to fix resize problems with MapWidget in DigitizePanel (#802)
Wald Commits
scm-commit at wald.intevation.org
Mon Nov 12 21:12:07 CET 2012
# HG changeset patch
# User Christian Lins <christian.lins at intevation.de>
# Date 1352751128 -3600
# Node ID 099d136b215bda527ff6cc64fcd7230216a9d07f
# Parent 6fb4e29a2a9ba10be9434c8b7b3233c46433346c
Try to fix resize problems with MapWidget in DigitizePanel (#802).
diff -r 6fb4e29a2a9b -r 099d136b215b flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java Mon Nov 12 10:53:32 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java Mon Nov 12 21:12:08 2012 +0100
@@ -12,8 +12,6 @@
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.events.ResizedEvent;
-import com.smartgwt.client.widgets.events.ResizedHandler;
import com.smartgwt.client.widgets.events.VisibilityChangedEvent;
import com.smartgwt.client.widgets.events.VisibilityChangedHandler;
import com.smartgwt.client.widgets.form.DynamicForm;
@@ -244,21 +242,6 @@
Map map = floodMap.getMap();
helperContainer.addMember(mapPanel);
- helperContainer.addResizedHandler(new ResizedHandler() {
- @Override
- public void onResized(ResizedEvent e) {
- Integer height = helperContainer.getHeight();
- Integer width = helperContainer.getWidth();
-
- height = height * 99 / 100;
- width = width * 99 / 100;
-
- String w = String.valueOf(width) + "px";
- String h = String.valueOf(height) + "px";
-
- mapPanel.getFloodMap().setSize(w, h);
- }
- });
parameterList.registerCollectionViewTabHandler(this);
diff -r 6fb4e29a2a9b -r 099d136b215b flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java Mon Nov 12 10:53:32 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java Mon Nov 12 21:12:08 2012 +0100
@@ -34,7 +34,7 @@
protected Bounds maxExtent;
protected ScaleLine scaleLine;
- public FloodMap(String srid, Bounds maxExtent, String width, String height) {
+ public FloodMap(String srid, Bounds maxExtent, int width, int height) {
this.srid = srid;
this.maxExtent = maxExtent;
recreateWidget(width, height);
@@ -42,7 +42,7 @@
}
- public void recreateWidget(String width, String height) {
+ public void recreateWidget(int width, int height) {
MapOptions opts = new MapOptions();
opts.setControls(new JObjectArray(new JSObject[] {}));
opts.setNumZoomLevels(16);
@@ -51,7 +51,10 @@
opts.setUnits("m");
opts.setMaxResolution(500); // TODO DO THIS ON THE FLY
- mapWidget = new MapWidget(width, height, opts);
+ mapWidget = new MapWidget(
+ Integer.toString(width - 4),
+ Integer.toString(height),
+ opts);
map = mapWidget.getMap();
}
@@ -157,6 +160,7 @@
barrierLayer.setIsBaseLayer(true);
map.addLayer(barrierLayer);
+ map.raiseLayer(barrierLayer, -10);
barrierLayer.addVectorFeatureAddedListener(this);
}
diff -r 6fb4e29a2a9b -r 099d136b215b 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 Nov 12 10:53:32 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java Mon Nov 12 21:12:08 2012 +0100
@@ -123,7 +123,7 @@
initial = max;
}
- setFloodmap(new FloodMap(c.getSrid(), max, "100%", "100%"));
+ setFloodmap(new FloodMap(c.getSrid(), max, 640, 480));
initLayout();
initBarriers();
diff -r 6fb4e29a2a9b -r 099d136b215b flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java Mon Nov 12 10:53:32 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java Mon Nov 12 21:12:08 2012 +0100
@@ -35,7 +35,7 @@
bbox.getLowerY(),
bbox.getUpperX(),
bbox.getUpperY()),
- "100%", "100%");
+ 640, 480);
initLayout();
}
More information about the Dive4elements-commits
mailing list