Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java @ 9644:152299dadb36
legend URL fix
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Mon, 02 Dec 2019 16:32:04 +0100 |
parents | a03c54129819 |
children | 2197a7ccb4a8 |
comparison
equal
deleted
inserted
replaced
9643:58f3fe98fd6b | 9644:152299dadb36 |
---|---|
15 import org.dive4elements.river.client.shared.model.AttributedTheme; | 15 import org.dive4elements.river.client.shared.model.AttributedTheme; |
16 import org.dive4elements.river.client.shared.model.Theme; | 16 import org.dive4elements.river.client.shared.model.Theme; |
17 import org.dive4elements.river.client.shared.model.ThemeList; | 17 import org.dive4elements.river.client.shared.model.ThemeList; |
18 | 18 |
19 import com.google.gwt.core.client.GWT; | 19 import com.google.gwt.core.client.GWT; |
20 import com.google.gwt.http.client.URL; | |
20 import com.google.gwt.user.client.ui.Image; | 21 import com.google.gwt.user.client.ui.Image; |
21 import com.google.gwt.user.client.ui.Widget; | 22 import com.google.gwt.user.client.ui.Widget; |
22 import com.smartgwt.client.types.ImageStyle; | 23 import com.smartgwt.client.types.ImageStyle; |
23 import com.smartgwt.client.types.VerticalAlignment; | 24 import com.smartgwt.client.types.VerticalAlignment; |
24 import com.smartgwt.client.widgets.Canvas; | 25 import com.smartgwt.client.widgets.Canvas; |
83 private Widget createLegendGraphics(final AttributedTheme at) { | 84 private Widget createLegendGraphics(final AttributedTheme at) { |
84 | 85 |
85 final String legend = at.getAttr("legend"); | 86 final String legend = at.getAttr("legend"); |
86 // TEST: final Image img = new Image("/images/FLYS_Donau.png"); (funktioniert!), ebenso FLYSResources.getTest(); | 87 // TEST: final Image img = new Image("/images/FLYS_Donau.png"); (funktioniert!), ebenso FLYSResources.getTest(); |
87 if (legend != null && !"".equals(legend)) { | 88 if (legend != null && !"".equals(legend)) { |
88 final Image image = new Image("/images/wms_legend/" + legend); | 89 |
90 final String imgUrl = URL.encode(GWT.getHostPageBaseURL() + "images/wms_legend/" + legend); | |
91 | |
92 final Image image = new Image(imgUrl); | |
89 final int imageWidth = image.getWidth(); | 93 final int imageWidth = image.getWidth(); |
90 final int imageHeight = image.getHeight(); | 94 final int imageHeight = image.getHeight(); |
91 final double widthPercent = imageWidth / 400.; | 95 final double widthPercent = imageWidth / 400.; |
92 | 96 |
93 // removing the limit of 150px height (legend can have an infinite height now, | 97 // removing the limit of 150px height (legend can have an infinite height now, |