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 have a popup that get the featureInfo on the map, what i want to do is to customize the display of the WMS GetInfo Results, i don't want to avoid automatic alphabetic sortingof the attribute declared on the source (see the code). Plz tell me how to do that, here's my code:

  action = new GeoExt.Action({
    control: new OpenLayers.Control.WMSGetFeatureInfo({
autoActivate: true,
infoFormat: "application/vnd.ogc.gml",
maxFeatures: 6,
layers: [layer1],

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

            items.push({
                xtype: "propertygrid",
                title: feature.fid,
                source: {"aaaaa": feature.attributes['aaaa'], "bbbb": feature.attributes['bbbb']},
            });
        });
        new GeoExt.Popup({
            title: "informations",
            width: 250,
            height: 300,
            layout: "accordion",
            map: map,
            location: e.xy,
            items: items
        }).show();

      }


    }
   }),
    map: map,
    text: "infos",
    tooltip: "Informations "
      });
    actions["infos"] = action;
    toolbarItems.push(action);
    toolbarItems.push("-"); 
share|improve this question
    
Can you tell us, how you want the pop up to appear? and what is your geoserver version? are you getting the data back in json? –  Devdatta Tengshe May 28 '13 at 13:56
    
the popup appears when the user click on a feature on the map, for geoserver it's 2.2-SNAPSHOT –  Geographic May 28 '13 at 14:09
    
and am specifing in source how to get them and to get only two: {"aaaaa": feature.attributes['aaaa'], "bbbb": feature.attributes['bbbb']} but they appear on the popup with alphabetic order ( because when i inverse like this : {"bbbbb": feature.attributes['bbbb'], "aaaa": feature.attributes['aaaa']} i get aaaa before bbbb on the popup –  Geographic May 28 '13 at 14:11

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.