[Users] Question about adding WMSGetFeatureInfo to Popup

Andrew Stewart Andrew.Stewart at reddeer.ca
Fri Sep 3 00:32:59 CEST 2010


My below GetFeatureInfo command is working correctly and whenever I click on the feature it displays the correct information about the feature into a div I created called 'nodeList'. Well I am trying to get this info to be shown in a popup like the example on the site using popup.js but it won't work. Now I can create the popup no problem (empty) but not sure how to add the getfeatureinfo response to the popup as the example uses a openlayers control instead. Any help appreciated!

 //support GetFeatureInfo
 map.events.register('click', map, function (e) {
new OpenLayers.Util.getElement('nodeList').innerHTML = "Loading... please wait...";
 var url = layer_Major_Parks.getFullRequestString({
 REQUEST: "GetFeatureInfo",
 EXCEPTIONS: "application/vnd.ogc.se_xml",
 BBOX: map.getExtent().toBBOX(),
 X: e.xy.x,
 Y: e.xy.y,
 INFO_FORMAT: 'text/html',
 QUERY_LAYERS: layer_Major_Parks.params.LAYERS,
WIDTH: map.size.w,
 HEIGHT: map.size.h});

//put in an alert for debugging
 OpenLayers.loadURL(url, '', this, setHTML);
 OpenLayers.Event.stop(e);
 });

//function to set the HTML
 function setHTML(response) {
 new OpenLayers.Util.getElement('nodeList').innerHTML = response.responseText;
 }



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100902/1652f207/attachment.htm 


More information about the Users mailing list