[PATCH 1 of 2] Img -> Image; correct URL for WMS Legend

Wald Commits scm-commit at wald.intevation.org
Thu Jan 21 14:07:45 CET 2021


# HG changeset patch
# User dnt_bjoernsen <d.tironi at bjoernsen.de>
# Date 1611231757 -3600
#      Thu Jan 21 13:22:37 2021 +0100
# Node ID 20456a3c92e2d62ac2a172251b465886f92536fa
# Parent  0caaca0df02876bb2d5182678e52a798c38d80db
Img -> Image; correct URL for WMS Legend

diff -r 0caaca0df028 -r 20456a3c92e2 artifacts/doc/conf/backend-db.xml
--- a/artifacts/doc/conf/backend-db.xml	Wed Jan 20 19:25:47 2021 +0100
+++ b/artifacts/doc/conf/backend-db.xml	Thu Jan 21 13:22:37 2021 +0100
@@ -5,7 +5,7 @@
     <password>d4e</password>
     <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
     <driver>org.postgresql.Driver</driver>
-    <url>jdbc:postgresql://localhost:5432/d4e</url>
+    <url>jdbc:postgresql://localhost:63333/d4e2</url>
     <validation-query>select 1 from rivers</validation-query>
     <max-wait>30000</max-wait>
 </backend-database>
diff -r 0caaca0df028 -r 20456a3c92e2 artifacts/doc/conf/seddb-db.xml
--- a/artifacts/doc/conf/seddb-db.xml	Wed Jan 20 19:25:47 2021 +0100
+++ b/artifacts/doc/conf/seddb-db.xml	Thu Jan 21 13:22:37 2021 +0100
@@ -5,7 +5,7 @@
     <password>seddb</password>
     <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
     <driver>org.postgresql.Driver</driver>
-    <url>jdbc:postgresql://localhost:5432/seddb</url>
+    <url>jdbc:postgresql://localhost:63333/seddb2</url>
     <validation-query>select 1 from gewaesser</validation-query>
     <max-wait>30000</max-wait>
     <!--
diff -r 0caaca0df028 -r 20456a3c92e2 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java	Wed Jan 20 19:25:47 2021 +0100
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java	Thu Jan 21 13:22:37 2021 +0100
@@ -84,7 +84,7 @@
 //		String url = "url";
 		if (img instanceof Image) {
 //			url = " url " + ((Image) img).getUrl();
-			new MyLoadHandler(row, ((Image) img));
+//			new MyLoadHandler(row, ((Image) img));
 
 //		} else if (img instanceof Img) {
 //			setDimensions(row, ((Img) img).getHeight(), ((Img) img).getWidth());
@@ -110,7 +110,7 @@
 		final String legend = at.getAttr("legend");
 		// TEST: final Image img = new Image("/images/FLYS_Donau.png"); (funktioniert!),
 		// ebenso FLYSResources.getTest();
-//		if (legend != null && !"".equals(legend)) {
+		if (legend != null && !"".equals(legend)) {
 
 			final String imgUrl = URL.encode(GWT.getHostPageBaseURL() + "images/wms_legend/" + legend);
 
@@ -118,13 +118,18 @@
 			new MyWMSLoadHandler(row, image);
 
 			return image;
-//		}
-//		final String imgUrl = MapUtils.getLegendGraphicUrl(at.getAttr("url"), at.getAttr("layers"));
+		}
+		final String imgUrl = MapUtils.getLegendGraphicUrl(at.getAttr("url"), at.getAttr("layers"));
+		final Image image = new Image(imgUrl);
+		
+		new MyLoadHandler(row, ((Image) image));
+//		Image image = new Image(imgUrl);
+//		Widget widget = image.asWidget();
 //		final Img img = new Img(imgUrl);
 //		img.setImageType(ImageStyle.CENTER);
 //		img.setAutoFit(true);
 
-//		return img;
+		return image;
 	}
 
 	private void init() {


More information about the Dive4Elements-commits mailing list