changeset 9644:152299dadb36

legend URL fix
author dnt_bjoernsen <d.tironi@bjoernsen.de>
date Mon, 02 Dec 2019 16:32:04 +0100
parents 58f3fe98fd6b
children eb1a29fe823f
files gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java	Mon Dec 02 14:14:06 2019 +0100
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java	Mon Dec 02 16:32:04 2019 +0100
@@ -17,6 +17,7 @@
 import org.dive4elements.river.client.shared.model.ThemeList;
 
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.URL;
 import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.Widget;
 import com.smartgwt.client.types.ImageStyle;
@@ -85,7 +86,10 @@
         final String legend = at.getAttr("legend");
         // TEST: final Image img = new Image("/images/FLYS_Donau.png"); (funktioniert!), ebenso FLYSResources.getTest();
         if (legend != null && !"".equals(legend)) {
-            final Image image = new Image("/images/wms_legend/" + legend);
+
+            final String imgUrl = URL.encode(GWT.getHostPageBaseURL() + "images/wms_legend/" + legend);
+
+            final Image image = new Image(imgUrl);
             final int imageWidth = image.getWidth();
             final int imageHeight = image.getHeight();
             final double widthPercent = imageWidth / 400.;

http://dive4elements.wald.intevation.org