Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to create a GeoExt function out of this OpenLayers function, which displays the getFeatureInfo.

I was able to create this GeoExt.Action() but it does not give me any output. Any idea where am I going wrong? This is the function addToPopup().

This is my application, http://128.196.142.12/geo/test/test_new.html.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

It seems that you forgot to add eventListeners propperty to your WMSGetFeatureInfo control. Working code should looks like:

control: new OpenLayers.Control.WMSGetFeatureInfo({
    url: "http://128.196.142.12:8080/geoserver/opengeo/wms",
    eventListeners: {
        'getfeatureinfo': function(evt) {
            var lonLat = evt.xy;
            addToPopup(lonLat, evt.text);
        }
    }
});

enter image description here

share|improve this answer
    
Thanks a lot. I did use eventListeners but I had forgotten to add the '' for getfeatureinfo –  Sam007 Aug 31 '12 at 16:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.