Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java @ 800:95cc560ce7c4
Added map controls for digitizing and removing barriers.
flys-client/trunk@2321 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 12 Jul 2011 13:43:49 +0000 |
parents | f4299b90c996 |
children | e50da1f74e58 |
comparison
equal
deleted
inserted
replaced
799:f4299b90c996 | 800:95cc560ce7c4 |
---|---|
1 package de.intevation.flys.client.client.ui.map; | 1 package de.intevation.flys.client.client.ui.map; |
2 | 2 |
3 import org.gwtopenmaps.openlayers.client.Map; | 3 import org.gwtopenmaps.openlayers.client.Map; |
4 import org.gwtopenmaps.openlayers.client.MapOptions; | 4 import org.gwtopenmaps.openlayers.client.MapOptions; |
5 import org.gwtopenmaps.openlayers.client.MapWidget; | 5 import org.gwtopenmaps.openlayers.client.MapWidget; |
6 import org.gwtopenmaps.openlayers.client.layer.Vector; | |
6 import org.gwtopenmaps.openlayers.client.util.JObjectArray; | 7 import org.gwtopenmaps.openlayers.client.util.JObjectArray; |
7 import org.gwtopenmaps.openlayers.client.util.JSObject; | 8 import org.gwtopenmaps.openlayers.client.util.JSObject; |
8 | 9 |
9 | 10 |
10 public class FloodMap { | 11 public class FloodMap { |
11 | 12 |
13 public static final String LAYER_BARRIERS = "vector_layer_barriers"; | |
14 | |
12 protected MapWidget mapWidget; | 15 protected MapWidget mapWidget; |
13 protected Map map; | 16 protected Map map; |
17 protected Vector barrierLayer; | |
14 | 18 |
15 | 19 |
16 public FloodMap() { | 20 public FloodMap() { |
17 MapOptions opts = new MapOptions(); | 21 MapOptions opts = new MapOptions(); |
18 opts.setControls(new JObjectArray(new JSObject[] {})); | 22 opts.setControls(new JObjectArray(new JSObject[] {})); |
37 public String getRiverProjection() { | 41 public String getRiverProjection() { |
38 return "EPSG:4326"; | 42 return "EPSG:4326"; |
39 } | 43 } |
40 | 44 |
41 | 45 |
46 public Vector getBarrierLayer() { | |
47 if (barrierLayer == null) { | |
48 barrierLayer = new Vector(LAYER_BARRIERS); | |
49 map.addLayer(barrierLayer); | |
50 } | |
51 | |
52 return barrierLayer; | |
53 } | |
54 | |
55 | |
42 public void setSize(String width, String height) { | 56 public void setSize(String width, String height) { |
43 mapWidget.setWidth(width); | 57 mapWidget.setWidth(width); |
44 mapWidget.setHeight(height); | 58 mapWidget.setHeight(height); |
45 } | 59 } |
46 } | 60 } |