Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java @ 9635:a03c54129819
pos 21 another review...
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Thu, 31 Oct 2019 15:24:23 +0100 |
parents | 63bbd5e45839 |
children | 152299dadb36 |
comparison
equal
deleted
inserted
replaced
9634:694062b1875a | 9635:a03c54129819 |
---|---|
87 if (legend != null && !"".equals(legend)) { | 87 if (legend != null && !"".equals(legend)) { |
88 final Image image = new Image("/images/wms_legend/" + legend); | 88 final Image image = new Image("/images/wms_legend/" + legend); |
89 final int imageWidth = image.getWidth(); | 89 final int imageWidth = image.getWidth(); |
90 final int imageHeight = image.getHeight(); | 90 final int imageHeight = image.getHeight(); |
91 final double widthPercent = imageWidth / 400.; | 91 final double widthPercent = imageWidth / 400.; |
92 final double heightPercent = imageHeight / 150.; | 92 |
93 if (widthPercent > 1 || heightPercent > 1) { | 93 // removing the limit of 150px height (legend can have an infinite height now, |
94 if (widthPercent > heightPercent) | 94 // as long as the width is less/eq 400px; if the width is >400, |
95 image.setSize((int) (imageWidth / widthPercent) + "px", (int) (imageHeight / widthPercent) + "px"); | 95 // the legend will be scaled to 400px width; the ratio will be kept) |
96 else | 96 |
97 image.setSize((int) (imageWidth / heightPercent) + "px", (int) (imageHeight / heightPercent) + "px"); | 97 // final double heightPercent = imageHeight / 150.; |
98 } | 98 if (widthPercent > 1)// || heightPercent > 1) { |
99 // if (widthPercent > heightPercent) | |
100 image.setSize((int) (imageWidth / widthPercent) + "px", (int) (imageHeight / widthPercent) + "px"); | |
101 // else | |
102 // image.setSize((int) (imageWidth / heightPercent) + "px", (int) (imageHeight / heightPercent) + "px"); | |
103 // } | |
99 return image; | 104 return image; |
100 } | 105 } |
101 final String imgUrl = MapUtils.getLegendGraphicUrl(at.getAttr("url"), at.getAttr("layers")); | 106 final String imgUrl = MapUtils.getLegendGraphicUrl(at.getAttr("url"), at.getAttr("layers")); |
102 | 107 |
103 final Img img = new Img(imgUrl); | 108 final Img img = new Img(imgUrl); |