Mercurial > dive4elements > river
changeset 4476:099d136b215b
Try to fix resize problems with MapWidget in DigitizePanel (#802).
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Mon, 12 Nov 2012 21:12:08 +0100 |
parents | 6fb4e29a2a9b |
children | 79bb64f66c74 |
files | flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java |
diffstat | 4 files changed, 9 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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); }
--- 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();
--- 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(); }