Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java @ 9702:20456a3c92e2
Img -> Image; correct URL for WMS Legend
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Thu, 21 Jan 2021 13:22:37 +0100 |
parents | 0caaca0df028 |
children | 0c8374059484 |
comparison
equal
deleted
inserted
replaced
9701:0caaca0df028 | 9702:20456a3c92e2 |
---|---|
82 row.addMember(img); | 82 row.addMember(img); |
83 | 83 |
84 // String url = "url"; | 84 // String url = "url"; |
85 if (img instanceof Image) { | 85 if (img instanceof Image) { |
86 // url = " url " + ((Image) img).getUrl(); | 86 // url = " url " + ((Image) img).getUrl(); |
87 new MyLoadHandler(row, ((Image) img)); | 87 // new MyLoadHandler(row, ((Image) img)); |
88 | 88 |
89 // } else if (img instanceof Img) { | 89 // } else if (img instanceof Img) { |
90 // setDimensions(row, ((Img) img).getHeight(), ((Img) img).getWidth()); | 90 // setDimensions(row, ((Img) img).getHeight(), ((Img) img).getWidth()); |
91 // url = " dataPath " + ((Img) img).getDataPath(); | 91 // url = " dataPath " + ((Img) img).getDataPath(); |
92 } else { | 92 } else { |
108 private Widget createLegendGraphics(HLayout row, final AttributedTheme at) { | 108 private Widget createLegendGraphics(HLayout row, final AttributedTheme at) { |
109 | 109 |
110 final String legend = at.getAttr("legend"); | 110 final String legend = at.getAttr("legend"); |
111 // TEST: final Image img = new Image("/images/FLYS_Donau.png"); (funktioniert!), | 111 // TEST: final Image img = new Image("/images/FLYS_Donau.png"); (funktioniert!), |
112 // ebenso FLYSResources.getTest(); | 112 // ebenso FLYSResources.getTest(); |
113 // if (legend != null && !"".equals(legend)) { | 113 if (legend != null && !"".equals(legend)) { |
114 | 114 |
115 final String imgUrl = URL.encode(GWT.getHostPageBaseURL() + "images/wms_legend/" + legend); | 115 final String imgUrl = URL.encode(GWT.getHostPageBaseURL() + "images/wms_legend/" + legend); |
116 | 116 |
117 final Image image = new Image(imgUrl); | 117 final Image image = new Image(imgUrl); |
118 new MyWMSLoadHandler(row, image); | 118 new MyWMSLoadHandler(row, image); |
119 | 119 |
120 return image; | 120 return image; |
121 // } | 121 } |
122 // final String imgUrl = MapUtils.getLegendGraphicUrl(at.getAttr("url"), at.getAttr("layers")); | 122 final String imgUrl = MapUtils.getLegendGraphicUrl(at.getAttr("url"), at.getAttr("layers")); |
123 final Image image = new Image(imgUrl); | |
124 | |
125 new MyLoadHandler(row, ((Image) image)); | |
126 // Image image = new Image(imgUrl); | |
127 // Widget widget = image.asWidget(); | |
123 // final Img img = new Img(imgUrl); | 128 // final Img img = new Img(imgUrl); |
124 // img.setImageType(ImageStyle.CENTER); | 129 // img.setImageType(ImageStyle.CENTER); |
125 // img.setAutoFit(true); | 130 // img.setAutoFit(true); |
126 | 131 |
127 // return img; | 132 return image; |
128 } | 133 } |
129 | 134 |
130 private void init() { | 135 private void init() { |
131 this.legendContainer.setAutoHeight(); | 136 this.legendContainer.setAutoHeight(); |
132 this.legendContainer.setLayoutAlign(VerticalAlignment.TOP); | 137 this.legendContainer.setLayoutAlign(VerticalAlignment.TOP); |