changeset 9702:20456a3c92e2

Img -> Image; correct URL for WMS Legend
author dnt_bjoernsen <d.tironi@bjoernsen.de>
date Thu, 21 Jan 2021 13:22:37 +0100
parents 0caaca0df028
children 0c8374059484
files artifacts/doc/conf/backend-db.xml artifacts/doc/conf/seddb-db.xml gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java
diffstat 3 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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>
--- 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>
     <!--
--- 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() {

http://dive4elements.wald.intevation.org