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,


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

control: new OpenLayers.Control.WMSGetFeatureInfo({
    url: "",
    eventListeners: {
        'getfeatureinfo': function(evt) {
            var lonLat = evt.xy;
            addToPopup(lonLat, evt.text);

enter image description here

  • Thanks a lot. I did use eventListeners but I had forgotten to add the '' for getfeatureinfo – Sam007 Aug 31 '12 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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