[PATCH] legend URL fix

Wald Commits scm-commit at wald.intevation.org
Mon Dec 2 16:32:13 CET 2019


# HG changeset patch
# User dnt_bjoernsen <d.tironi at bjoernsen.de>
# Date 1575300724 -3600
#      Mon Dec 02 16:32:04 2019 +0100
# Node ID 152299dadb36c2c95e652d0f581ae49597142cfd
# Parent  58f3fe98fd6b21c9c6b8dd3f710471925caaae7e
legend URL fix

diff -r 58f3fe98fd6b -r 152299dadb36 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java
--- 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.;


More information about the Dive4Elements-commits mailing list