Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java @ 832:303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
flys-client/trunk@2543 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 24 Aug 2011 08:32:23 +0000 |
parents | |
children | 9aa1a453eed5 |
comparison
equal
deleted
inserted
replaced
831:9101b4d64666 | 832:303a923d232b |
---|---|
1 package de.intevation.flys.client.client.ui.map; | |
2 | |
3 import com.google.gwt.user.client.ui.HorizontalPanel; | |
4 | |
5 import com.smartgwt.client.widgets.Canvas; | |
6 import com.smartgwt.client.widgets.layout.VLayout; | |
7 | |
8 import org.gwtopenmaps.openlayers.client.Bounds; | |
9 | |
10 import de.intevation.flys.client.shared.model.BBox; | |
11 import de.intevation.flys.client.shared.model.MapInfo; | |
12 | |
13 | |
14 public class MapPanel extends VLayout { | |
15 | |
16 protected MapToolbar toolbar; | |
17 protected HorizontalPanel mapArea; | |
18 | |
19 protected FloodMap floodMap; | |
20 protected boolean digitizeEnabled; | |
21 | |
22 | |
23 public MapPanel(MapInfo mapInfo, boolean digitizeEnabled) { | |
24 super(); | |
25 | |
26 BBox bbox = mapInfo.getBBox(); | |
27 | |
28 this.digitizeEnabled = digitizeEnabled; | |
29 this.floodMap = new FloodMap( | |
30 String.valueOf(mapInfo.getSrid()), | |
31 new Bounds( | |
32 bbox.getLowerX(), | |
33 bbox.getLowerY(), | |
34 bbox.getUpperX(), | |
35 bbox.getUpperY())); | |
36 | |
37 initLayout(); | |
38 } | |
39 | |
40 | |
41 private void initLayout() { | |
42 setWidth100(); | |
43 setHeight100(); | |
44 | |
45 mapArea = new HorizontalPanel(); | |
46 mapArea.setWidth("99%"); | |
47 mapArea.setHeight("99%"); | |
48 mapArea.add(floodMap.getMapWidget()); | |
49 | |
50 Canvas wrapper = new Canvas(); | |
51 wrapper.setWidth100(); | |
52 wrapper.setHeight100(); | |
53 wrapper.addChild(mapArea); | |
54 | |
55 toolbar = new MapToolbar(floodMap, this, digitizeEnabled); | |
56 | |
57 addMember(toolbar); | |
58 addMember(mapArea); | |
59 } | |
60 | |
61 | |
62 public FloodMap getFloodMap() { | |
63 return floodMap; | |
64 } | |
65 } | |
66 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |