Hello, I am using the WMSGetFeatureInfo funciton to return information about various layers in my OpenLayers web app. I recieve the gml back well enough however, i was wondereing if there is an easy way to format this GML for display in a bubble box or something along those popup lines. I am hoping that I don't have to write a GML parser. Here is my code as it is now:
function identify(){ for (var i = 0; i < map.layers.length; i++) { test = map.layers[i].name; } info = new OpenLayers.Control.WMSGetFeatureInfo({ url: url, title: 'Identify features by clicking', layers: [map.layers[1],map.layers[2]], queryVisible: true, }); info.events.register("getfeatureinfo", this, pickInfo); info.infoFormat = 'application/vnd.ogc.gml'; map.addControl(info); info.activate(); } function pickInfo(e){
alert(e.text); map.addPopup(new OpenLayers.Popup.FramedCloud( "Feature Info:", map.getLonLatFromPixel(e.xy), null, e.text, null, true )); } Cheers, Derek
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
