Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i followed a GeoEXT example to create popup menu that gets WMSFeatureinfo on click on the map, What i want to do is to get some specific fields not all the fields, i try the propertyName (with name1,name2 and name3) and defined the wanted fields but id doesn't work, also i want to change the title by bringing a specific value not the fid but it doesn't work, here's the code: am new to this plz how to restrict the fields fetched from WMSGetFeatureInfo request

 feature Control, a "button" control
    action = new GeoExt.Action({
    control: new OpenLayers.Control.WMSGetFeatureInfo({
autoActivate: true,
infoFormat: "application/vnd.ogc.gml",
maxFeatures: 6,
layers: [layers1],
propertyName: "name1,name2,name3", 

eventListeners: {
    "getfeatureinfo": function(e) {
        var items = [];
        Ext.each(e.features, function(feature) {

            items.push({
               xtype: "propertygrid",
               title: feature.fid, // here i change it to feature.name1 it doesn't work
                source: feature.attributes

            });
        });
        new GeoExt.Popup({
            title: "infos",
            width: 250,
            height: 300,
            layout: "accordion",
            map: map,
            location: e.xy,
            items: items
        }).show();
      }
    }
   }),
    map: map,
    text: "infos",
    tooltip: "Infos "
      });
    actions["infos"] = action;
    toolbarItems.push(action);
    toolbarItems.push("-");     
share|improve this question
1  
Try "feature.attributes.name1" –  atlefren May 28 '13 at 13:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.