changeset 997:f55692e3e0ce

Modified output of the GetfeatureInfo-request. gnv/trunk@1198 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 11 Jun 2010 09:25:44 +0000
parents 0a652fd10638
children 27029f0ec7e1
files gnv/ChangeLog gnv/src/main/webapp/scripts/olutils.jsp gnv/src/main/webapp/scripts/viewport.jsp
diffstat 3 files changed, 42 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Fri Jun 11 08:25:46 2010 +0000
+++ b/gnv/ChangeLog	Fri Jun 11 09:25:44 2010 +0000
@@ -1,3 +1,11 @@
+2010-06-11  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/webapp/scripts/viewport.jsp,
+	  src/main/webapp/scripts/olutils.jsp: 
+	  Modified output of the GetfeatureInfo-request.
+	  All attributes of each feature which was returned by the request will be 
+	  put in one separte Table.
+
 2010-06-11  Tim Englich  <tim.englich@intevation.de>
 
 	* src/main/resources/applicationMessages*.properties:
--- a/gnv/src/main/webapp/scripts/olutils.jsp	Fri Jun 11 08:25:46 2010 +0000
+++ b/gnv/src/main/webapp/scripts/olutils.jsp	Fri Jun 11 09:25:44 2010 +0000
@@ -203,3 +203,35 @@
 
     map.addControl(panel);
 }
+function parseGetFeatureInfoData(event) {
+   var contentHTML = "<div>";
+   var features = event.features;
+   var first = true;
+   for (feat in features){
+      if (feat != 'remove'){
+          var feature = features[feat];
+          var attributes = feature.attributes;
+          if (first){
+            first = false;
+          }else{
+            contentHTML += "<br/>";
+          }
+          contentHTML += "<table>";
+          for (att in attributes){
+             contentHTML += "<tr><td><b>"+att+":</b></td><td>" + attributes[att] + "</td></tr>";
+          }
+          contentHTML += "</table>";
+      }
+    
+   }
+   contentHTML += "</div>";
+   
+    mapPanel.map.addPopup(new OpenLayers.Popup.FramedCloud(
+                    "chicken", 
+                    mapPanel.map.getLonLatFromPixel(event.xy),
+                    null,
+                    contentHTML,
+                    null,
+                    true
+                ));
+}
\ No newline at end of file
--- a/gnv/src/main/webapp/scripts/viewport.jsp	Fri Jun 11 08:25:46 2010 +0000
+++ b/gnv/src/main/webapp/scripts/viewport.jsp	Fri Jun 11 09:25:44 2010 +0000
@@ -75,20 +75,11 @@
             queryVisible: true,
             infoFormat: 'application/vnd.ogc.gml',
             eventListeners: {
-                getfeatureinfo: function(event) {
-                    mapPanel.map.addPopup(new OpenLayers.Popup.FramedCloud(
-                        "chicken", 
-                        mapPanel.map.getLonLatFromPixel(event.xy),
-                        null,
-                        event.text,
-                        null,
-                        true
-                    ));
-                }
+                getfeatureinfo: parseGetFeatureInfoData
             }
         })
     };
-
+    
     for (var key in controls) {
         panel.addControls([controls[key]]);
     }

http://dive4elements.wald.intevation.org