Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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,

share|improve this question
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: "",
    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

Your Answer


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.