1

I'm trying to display a popup (containing the attribute data) by clicking on an entity in my layer with the WMSGetFeatureInfo control from OpenLayers. It's turning but without displaying the popup

Note: I'm working with OpenLayers-2.13.1 , geoext2-2.1.0, ext-js-gpl-master

var info = Ext.create('GeoExt.Action',{
  tooltip: "Feature Info",
  icon:"Librs/geoext2-2.1.0/resources/images/default/information.png",
  text: "Get Info",
  enableToggle: true,
  allowDepress: true,
  enableToggle: true,
  control: new OpenLayers.Control.WMSGetFeatureInfo({
    //autoActivate: true,
    url: "http://localhost:8081/geoserver/STAGE/wms",
    title: 'Identify features by clicking',
    queryVisible: true,
    eventListeners: {
      getfeatureinfo: function(event) {   
        if(popup) {map.removePopup(popup);}
        popup = new OpenLayers.Popup.FramedCloud(
        "getInfo", 
        map.getLonLatFromPixel(event.xy),
        null,
        event.text,
        null,
        true
      );        
      map.addPopup(popup, true);
      }
    }
  }),
  map: map,
  toggleGroup: 'tools'
});

Your Answer

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

Browse other questions tagged or ask your own question.