# HG changeset patch # User Tim Englich # Date 1276248344 0 # Node ID f55692e3e0ce10ceef95fc09bf6972053ce11619 # Parent 0a652fd10638d692d9a183843262b096b8417697 Modified output of the GetfeatureInfo-request. gnv/trunk@1198 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 0a652fd10638 -r f55692e3e0ce gnv/ChangeLog --- 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 + + * 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 * src/main/resources/applicationMessages*.properties: diff -r 0a652fd10638 -r f55692e3e0ce gnv/src/main/webapp/scripts/olutils.jsp --- 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 = "
"; + 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 += "
"; + } + contentHTML += ""; + for (att in attributes){ + contentHTML += ""; + } + contentHTML += "
"+att+":" + attributes[att] + "
"; + } + + } + contentHTML += "
"; + + mapPanel.map.addPopup(new OpenLayers.Popup.FramedCloud( + "chicken", + mapPanel.map.getLonLatFromPixel(event.xy), + null, + contentHTML, + null, + true + )); +} \ No newline at end of file diff -r 0a652fd10638 -r f55692e3e0ce gnv/src/main/webapp/scripts/viewport.jsp --- 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]]); }