1

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.

1

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

  • 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.