annotate flys-client/src/main/java/de/intevation/flys/client/shared/MapUtils.java @ 4198:1cdbd8a0c994

Added two new tables ClickableQDTable and ClickableWTable and made Ws and Qs clickable in historical discharge calculation. The new tables define listener interfaces (clicked lower or upper icon) to listen to user clicks. In addition to this, there is an enum ClickMode with NONE, SINGLE and RANGE options, which allows to specifiy, which icons are displayed in the tables. NONE means no icon for user clicks, SINGLE has 1 icon, RANGE 2 icons for lower and upper.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 22 Oct 2012 13:31:25 +0200
parents 661e3ae77c8a
children f8409fbe3b88
rev   line source
1328
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.shared;
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
2440
661e3ae77c8a #558 Reload GetLegendGraphics images when changing the style of a map layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1328
diff changeset
3 import java.util.Date;
661e3ae77c8a #558 Reload GetLegendGraphics images when changing the style of a map layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1328
diff changeset
4
1328
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 public class MapUtils {
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 public static final String GET_LEGEND_GRAPHIC_TEMPLATE =
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 "${SERVER}SERVICE=WMS&VERSION=1.1.1&layer=${LAYER}" +
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 "&REQUEST=getLegendGraphic&FORMAT=image/png";
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 private MapUtils() {
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 }
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 public static String getLegendGraphicUrl(String server, String layer) {
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 if (server == null || layer == null) {
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 return null;
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 }
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 server = server.indexOf("?") >= 0 ? server : server + "?";
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 String url = GET_LEGEND_GRAPHIC_TEMPLATE;
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 url = url.replace("${SERVER}", server);
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 url = url.replace("${LAYER}", layer);
2440
661e3ae77c8a #558 Reload GetLegendGraphics images when changing the style of a map layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1328
diff changeset
27 url = url + "&timestamp=" + new Date().getTime();
1328
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 return url;
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 }
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 }
ab93960ac2fb Added missing MapUtils class from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org