Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/shared/MapUtils.java @ 5777:e95427ed80e5
Merged
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 21 Apr 2013 10:46:59 +0200 |
parents | f8409fbe3b88 |
children |
comparison
equal
deleted
inserted
replaced
5776:1126b9e00378 | 5777:e95427ed80e5 |
---|---|
11 | 11 |
12 | 12 |
13 private MapUtils() { | 13 private MapUtils() { |
14 } | 14 } |
15 | 15 |
16 public static String getLegendGraphicUrl(String server, String layer) { | |
17 return getLegendGraphicUrl(server, layer, -1); | |
18 } | |
16 | 19 |
17 public static String getLegendGraphicUrl(String server, String layer) { | 20 public static String getLegendGraphicUrl(String server, String layer, int dpi) { |
18 if (server == null || layer == null) { | 21 if (server == null || layer == null) { |
19 return null; | 22 return null; |
20 } | 23 } |
21 | 24 |
25 if (server.contains("osm.intevation.de")) { | |
26 // GetLegend is not implemented at osm.intevation.de | |
27 // This avoids an error in the print log | |
28 return null; | |
29 } | |
22 server = server.indexOf("?") >= 0 ? server : server + "?"; | 30 server = server.indexOf("?") >= 0 ? server : server + "?"; |
23 | 31 |
24 String url = GET_LEGEND_GRAPHIC_TEMPLATE; | 32 String url = GET_LEGEND_GRAPHIC_TEMPLATE; |
25 url = url.replace("${SERVER}", server); | 33 url = url.replace("${SERVER}", server); |
26 url = url.replace("${LAYER}", layer); | 34 url = url.replace("${LAYER}", layer); |
27 url = url + "×tamp=" + new Date().getTime(); | 35 url = url + "×tamp=" + new Date().getTime(); |
36 if (dpi != -1) { | |
37 url+="&legend_options=dpi:" + dpi; | |
38 } | |
28 | 39 |
29 return url; | 40 return url; |
30 } | 41 } |
31 } | 42 } |
32 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 43 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |