changeset 5032:4bf3b89b38d5

Added attribution to osm wms background layer.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 20 Feb 2013 09:53:24 +0100
parents 9c529b9de6b5
children ef289466917a
files flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java flys-client/src/main/webapp/FLYS.css
diffstat 8 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Wed Feb 20 09:47:24 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Wed Feb 20 09:53:24 2013 +0100
@@ -1048,6 +1048,8 @@
 
     String areatransparency();
 
+    String attribution();
+
     // Manual Points editor
 
     String addpoints();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Wed Feb 20 09:47:24 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Wed Feb 20 09:53:24 2013 +0100
@@ -543,6 +543,7 @@
 wsplgen_cat3 = Fill Color 2.0 <= DIFF < 3
 wsplgen_cat4 = Fill Color 3.0 <= DIFF < 4
 wsplgen_cat5 = Fill Color 4.0 <= DIFF
+attribution = &copyIntevation GmbH 2012<br>Data &copy<a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>
 
 # Manual Points Editor
 addpoints = Add points
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Wed Feb 20 09:47:24 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Wed Feb 20 09:53:24 2013 +0100
@@ -402,6 +402,7 @@
 requireDGM = Sie m\u00fcssen ein DGM ausw\u00e4hlen.
 upload_file = hochladen
 shape_file_upload = Shapedatei hochladen
+attribution = &copyIntevation GmbH 2012<br>Data &copy<a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>
 
 # data cage
 waterlevels = Wasserst\u00e4nde
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Wed Feb 20 09:47:24 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Wed Feb 20 09:53:24 2013 +0100
@@ -402,6 +402,7 @@
 requireDGM = You need to choose a DEM.
 upload_file = upload
 shape_file_upload = Upload shapefile
+attribution = &copyIntevation GmbH 2012<br>Data &copy<a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>
 
 # data cage
 waterlevels = Waterlevels
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java	Wed Feb 20 09:47:24 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java	Wed Feb 20 09:53:24 2013 +0100
@@ -39,6 +39,7 @@
 import java.util.List;
 
 import org.gwtopenmaps.openlayers.client.Map;
+import org.gwtopenmaps.openlayers.client.control.Attribution;
 import org.gwtopenmaps.openlayers.client.feature.VectorFeature;
 import org.gwtopenmaps.openlayers.client.format.GeoJSON;
 import org.gwtopenmaps.openlayers.client.layer.WMS;
@@ -269,7 +270,7 @@
             VectorFeature[] features = new GeoJSON().read(geojson);
             floodMap.getBarrierLayer().addFeatures(features);
         }
-
+        map.addControl(new Attribution());
         map.zoomToMaxExtent();
     }
 
@@ -285,7 +286,9 @@
         opts.setSingleTile(true);
         opts.setRatio(1);
         opts.setBuffer(0);
-
+        if (layers.equals("OSM-WMS-Dienst")) {
+            opts.setAttribution(MSG.attribution());
+        }
         WMS wms = new WMS(layers, url, params, opts);
         wms.setIsVisible(true);
         wms.setIsBaseLayer(x);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java	Wed Feb 20 09:47:24 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java	Wed Feb 20 09:53:24 2013 +0100
@@ -6,6 +6,7 @@
 import org.gwtopenmaps.openlayers.client.MapOptions;
 import org.gwtopenmaps.openlayers.client.MapWidget;
 import org.gwtopenmaps.openlayers.client.Style;
+import org.gwtopenmaps.openlayers.client.control.Attribution;
 import org.gwtopenmaps.openlayers.client.control.ScaleLine;
 import org.gwtopenmaps.openlayers.client.control.ScaleLineOptions;
 import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener;
@@ -56,6 +57,7 @@
                 Integer.toString(height),
                 opts);
         map       = mapWidget.getMap();
+        map.addControl(new Attribution());
     }
 
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Wed Feb 20 09:47:24 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Wed Feb 20 09:53:24 2013 +0100
@@ -454,7 +454,6 @@
         if (url == null || layers == null) {
             return null;
         }
-
         this.wmsUrls.put(name, url);
 
         WMSParams params = new WMSParams();
@@ -466,7 +465,9 @@
         opts.setProjection("EPSG:" + getSrid());
         opts.setSingleTile(true);
         opts.setRatio(1);
-
+        if (layers.equals("OSM-WMS-Dienst")) {
+            opts.setAttribution(MSG.attribution());
+        }
         WMS wms = new WMS(layers, url, params, opts);
         wms.setIsVisible(at.getActive() == 1);
         wms.setIsBaseLayer(false);
--- a/flys-client/src/main/webapp/FLYS.css	Wed Feb 20 09:47:24 2013 +0100
+++ b/flys-client/src/main/webapp/FLYS.css	Wed Feb 20 09:53:24 2013 +0100
@@ -235,3 +235,8 @@
       color: #a9c9e6;
       margin-left: 10px;
 }
+
+.olControlAttribution {
+    bottom: 1em !important;
+    font-size: 12px !important;
+}

http://dive4elements.wald.intevation.org