changeset 1328:ab93960ac2fb

Added missing MapUtils class from last commit. flys-client/trunk@2972 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 14 Oct 2011 12:56:31 +0000
parents 8a93fb299e64
children b18b32269a3f
files flys-client/src/main/java/de/intevation/flys/client/shared/MapUtils.java
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/MapUtils.java	Fri Oct 14 12:56:31 2011 +0000
@@ -0,0 +1,29 @@
+package de.intevation.flys.client.shared;
+
+
+public class MapUtils {
+
+    public static final String GET_LEGEND_GRAPHIC_TEMPLATE =
+        "${SERVER}SERVICE=WMS&VERSION=1.1.1&layer=${LAYER}" +
+        "&REQUEST=getLegendGraphic&FORMAT=image/png";
+
+
+    private MapUtils() {
+    }
+
+
+    public static String getLegendGraphicUrl(String server, String layer) {
+        if (server == null || layer == null) {
+            return null;
+        }
+
+        server = server.indexOf("?") >= 0 ? server : server + "?";
+
+        String url = GET_LEGEND_GRAPHIC_TEMPLATE;
+        url = url.replace("${SERVER}", server);
+        url = url.replace("${LAYER}", layer);
+
+        return url;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org