# HG changeset patch # User Ingo Weinzierl # Date 1314174743 0 # Node ID 303a923d232b5a8fdf2ab5228b7d1badfe69032c # Parent 9101b4d646665c5ada3fee9715c1f691937ed483 Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers. flys-client/trunk@2543 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 9101b4d64666 -r 303a923d232b flys-client/ChangeLog --- a/flys-client/ChangeLog Tue Aug 23 16:58:07 2011 +0000 +++ b/flys-client/ChangeLog Wed Aug 24 08:32:23 2011 +0000 @@ -1,3 +1,9 @@ +2011-08-24 Ingo Weinzierl + + * src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java: + New. A widget that displays a map with a toolbar. It wraps all the stuff + to combine SmartGWT with GWT-OpenLayers. + 2011-08-23 Sascha L. Teichmann * src/main/java/de/intevation/flys/client/shared/model/ToLoad.java: diff -r 9101b4d64666 -r 303a923d232b flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java Wed Aug 24 08:32:23 2011 +0000 @@ -0,0 +1,66 @@ +package de.intevation.flys.client.client.ui.map; + +import com.google.gwt.user.client.ui.HorizontalPanel; + +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.gwtopenmaps.openlayers.client.Bounds; + +import de.intevation.flys.client.shared.model.BBox; +import de.intevation.flys.client.shared.model.MapInfo; + + +public class MapPanel extends VLayout { + + protected MapToolbar toolbar; + protected HorizontalPanel mapArea; + + protected FloodMap floodMap; + protected boolean digitizeEnabled; + + + public MapPanel(MapInfo mapInfo, boolean digitizeEnabled) { + super(); + + BBox bbox = mapInfo.getBBox(); + + this.digitizeEnabled = digitizeEnabled; + this.floodMap = new FloodMap( + String.valueOf(mapInfo.getSrid()), + new Bounds( + bbox.getLowerX(), + bbox.getLowerY(), + bbox.getUpperX(), + bbox.getUpperY())); + + initLayout(); + } + + + private void initLayout() { + setWidth100(); + setHeight100(); + + mapArea = new HorizontalPanel(); + mapArea.setWidth("99%"); + mapArea.setHeight("99%"); + mapArea.add(floodMap.getMapWidget()); + + Canvas wrapper = new Canvas(); + wrapper.setWidth100(); + wrapper.setHeight100(); + wrapper.addChild(mapArea); + + toolbar = new MapToolbar(floodMap, this, digitizeEnabled); + + addMember(toolbar); + addMember(mapArea); + } + + + public FloodMap getFloodMap() { + return floodMap; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :