Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java @ 1315:cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
flys-client/trunk@2954 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 13 Oct 2011 09:08:43 +0000 |
parents | 89a47098bcbd |
children | 45b9b1fc26e2 |
comparison
equal
deleted
inserted
replaced
1314:4c716bec7822 | 1315:cf0f906921de |
---|---|
17 | 17 |
18 | 18 |
19 public class FloodMap implements VectorFeatureAddedListener { | 19 public class FloodMap implements VectorFeatureAddedListener { |
20 | 20 |
21 public static final String LAYER_BARRIERS = "vector_layer_barriers"; | 21 public static final String LAYER_BARRIERS = "vector_layer_barriers"; |
22 | |
23 public static final String MARK_SELECTED = "mark.selected"; | |
22 | 24 |
23 protected MapWidget mapWidget; | 25 protected MapWidget mapWidget; |
24 protected Map map; | 26 protected Map map; |
25 protected Vector barrierLayer; | 27 protected Vector barrierLayer; |
26 protected String srid; | 28 protected String srid; |
55 | 57 |
56 if (type == null || type.length() == 0) { | 58 if (type == null || type.length() == 0) { |
57 return; | 59 return; |
58 } | 60 } |
59 | 61 |
60 feature.setStyle(getStyle(type)); | 62 Style style = getStyle(type); |
63 if (style != null) { | |
64 feature.setStyle(style); | |
65 } | |
61 | 66 |
62 // necessary, otherwise the setStyle() has no effect | 67 // necessary, otherwise the setStyle() has no effect |
63 barrierLayer.redraw(); | 68 barrierLayer.redraw(); |
64 } | 69 } |
65 | 70 |
72 * | 77 * |
73 * @return an OpenLayers.Style object. | 78 * @return an OpenLayers.Style object. |
74 */ | 79 */ |
75 public static Style getStyle(String type) { | 80 public static Style getStyle(String type) { |
76 Style style = new Style(); | 81 Style style = new Style(); |
82 | |
83 if (type == null) { | |
84 return null; | |
85 } | |
77 | 86 |
78 if (type.equals(DrawControl.BARRIER_PIPE1) | 87 if (type.equals(DrawControl.BARRIER_PIPE1) |
79 || type.equals(DrawControl.BARRIER_PIPE1_VALUE) | 88 || type.equals(DrawControl.BARRIER_PIPE1_VALUE) |
80 ) { | 89 ) { |
81 style.setFillColor("#800080"); | 90 style.setFillColor("#800080"); |
123 public String getRiverProjection() { | 132 public String getRiverProjection() { |
124 return "EPSG:" + srid; | 133 return "EPSG:" + srid; |
125 } | 134 } |
126 | 135 |
127 | 136 |
137 public Bounds getMaxExtent() { | |
138 return maxExtent; | |
139 } | |
140 | |
141 | |
128 public Vector getBarrierLayer() { | 142 public Vector getBarrierLayer() { |
129 if (barrierLayer == null) { | 143 if (barrierLayer == null) { |
130 VectorOptions opts = new VectorOptions(); | 144 VectorOptions opts = new VectorOptions(); |
131 opts.setProjection(getRiverProjection()); | 145 opts.setProjection(getRiverProjection()); |
132 opts.setMaxExtent(maxExtent); | 146 opts.setMaxExtent(getMaxExtent()); |
133 | 147 |
134 barrierLayer = new Vector(LAYER_BARRIERS, opts); | 148 barrierLayer = new Vector(LAYER_BARRIERS, opts); |
135 barrierLayer.setIsBaseLayer(true); | 149 barrierLayer.setIsBaseLayer(true); |
136 | 150 |
137 map.addLayer(barrierLayer); | 151 map.addLayer(barrierLayer); |