Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java @ 833:dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
flys-client/trunk@2544 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 24 Aug 2011 08:36:51 +0000 |
parents | 407de0f4b66a |
children | 4af1ee86b0b1 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java Wed Aug 24 08:32:23 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java Wed Aug 24 08:36:51 2011 +0000 @@ -4,6 +4,8 @@ import org.gwtopenmaps.openlayers.client.Map; import org.gwtopenmaps.openlayers.client.MapOptions; import org.gwtopenmaps.openlayers.client.MapWidget; +import org.gwtopenmaps.openlayers.client.feature.VectorFeature; +import org.gwtopenmaps.openlayers.client.format.GeoJSON; import org.gwtopenmaps.openlayers.client.layer.Vector; import org.gwtopenmaps.openlayers.client.layer.VectorOptions; import org.gwtopenmaps.openlayers.client.util.JObjectArray; @@ -70,6 +72,17 @@ } + public String getFeaturesAsGeoJSON() { + VectorFeature[] features = barrierLayer.getFeatures(); + + if (features == null || features.length == 0) { + return null; + } + + return new GeoJSON().write(features); + } + + public void setSize(String width, String height) { mapWidget.setWidth(width); mapWidget.setHeight(height);