Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java @ 797:cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
flys-client/trunk@2314 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 08 Jul 2011 14:56:02 +0000 |
parents | |
children | f4299b90c996 |
comparison
equal
deleted
inserted
replaced
796:cd8603aaa730 | 797:cc3f481e9484 |
---|---|
1 package de.intevation.flys.client.client.ui.map; | |
2 | |
3 import org.gwtopenmaps.openlayers.client.Map; | |
4 import org.gwtopenmaps.openlayers.client.MapOptions; | |
5 import org.gwtopenmaps.openlayers.client.MapWidget; | |
6 import org.gwtopenmaps.openlayers.client.control.Navigation; | |
7 import org.gwtopenmaps.openlayers.client.util.JObjectArray; | |
8 import org.gwtopenmaps.openlayers.client.util.JSObject; | |
9 | |
10 | |
11 public class FloodMap { | |
12 | |
13 protected MapWidget mapWidget; | |
14 protected Map map; | |
15 | |
16 | |
17 public FloodMap() { | |
18 MapOptions opts = new MapOptions(); | |
19 opts.setControls(new JObjectArray(new JSObject[] {})); | |
20 opts.setNumZoomLevels(16); | |
21 opts.setProjection(getRiverProjection()); | |
22 | |
23 mapWidget = new MapWidget("510px", "635px", opts); | |
24 map = mapWidget.getMap(); | |
25 | |
26 initControls(); | |
27 } | |
28 | |
29 | |
30 protected void initControls() { | |
31 map.addControl(new Navigation()); | |
32 } | |
33 | |
34 | |
35 public MapWidget getMapWidget() { | |
36 return mapWidget; | |
37 } | |
38 | |
39 | |
40 public Map getMap() { | |
41 return map; | |
42 } | |
43 | |
44 | |
45 public String getRiverProjection() { | |
46 return "EPSG:4326"; | |
47 } | |
48 | |
49 | |
50 public void setSize(String width, String height) { | |
51 mapWidget.setWidth(width); | |
52 mapWidget.setHeight(height); | |
53 } | |
54 } |