[Users] Customizing Feature Info for a WMS Layer

IT Intern itintern12 at gmail.com
Thu Sep 23 18:42:39 CEST 2010


Hello GeoExt Users,

Sorry in advance if this is trivial.  I am trying to limit the number of
columns that appear in my feature info popup for my WMS layer.  So far I
have the all the columns of the feature info of my WMS layer popping up.
I'd like to show maybe only 2 columns?  This is what I got so far:

var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo();
                featureInfo.events.on({
                    getfeatureinfo: function(e) {
                        new GeoExt.Popup({
                            title: "Feature Info",
                            width: 900,
                            height: 250,
                            autoScroll: true,
                            maximizable: true,
                            map: mapPanel.map,
                            lonlat: mapPanel.map.getLonLatFromPixel(e.xy),
                            html: e.text
                            //html:
e.featureInfo.attributes.LAT                                   //This didn't
work, but is there a way to say which coulmns I want???
                        }).show();
                    }
                });

            mapPanel.map.addControl(featureInfo);
            featureInfo.activate();

My other issue is that I have multiple layers in my map.  I would like it if
only the feature info for the active layer of a point comes up, however
right now I have feature info showing up for all the layers of that point.
In other words if layer a is checked on, I only want the feature info of
that point in layer a.  Thanks for all your help :).  I've been stuck on
this for a while now and haven't made any progress pass this :-/

elshae
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100923/48472611/attachment.htm 


More information about the Users mailing list