[OpenLayers-Users] AW: wfs getinfo with radiobutton -more response than requests

Sarah Schuessler sarah_flip at yahoo.de
Wed Mar 30 06:37:10 EDT 2011


No one has an idea?

best regards
Sarah




________________________________



Hi list,

I have my overlays tree with checkbox and radiobutton. If I click a radiobutton 
(start a radiochange event to get information about feature) and click at my map 
than I get a response. If I change again radiobutton/layer than I get a response 
from new layer and from one before. 


code of my tree panel:
                    id: 'panel',
                    title: 'Menu',
                    region: "east",
                    split: true,
                     width: 200,                    
                    maxSize: 400,
                    collapsible: true,
                    collapseMode: "mini",
                    margins: '0 0 0 5',
                    layout: 'accordion',
                    layoutConfig: { animate: true},
                    items:  [{
                        title: "Layer tree",
                        width: 200, 
                        id: "treelayer",
                        margins: '5 0 5 5',
                        xtype: "treepanel",                                  
                         loader: new Ext.tree.TreeLoader({
                                applyLoader: false}),
                                root: {  nodeType: "async",
                            children: [                                
                             {
                                nodeType: "gx_baselayercontainer", expanded: 
true
                                }, 
                            {
                                nodeType: "gx_overlaylayercontainer",
                                expanded: true,        
                                 loader: { baseAttrs: {radioGroup: "foo"}
                                   } 
                               }                              
                            ]                            
                              }, listeners: {"radiochange": 
function(node){getAttributes(node);}
                                            },
                                rootVisible: false
                        }

and my code to get information:

function getAttributes(node) {

    var name = node.layer.name;
    var qlayer= node.layer.params.LAYERS;
    var opt = node.layer.options;

    var bbox=  node.layer.map.getExtent().toBBOX();
    var breite = node.layer.map.size.w;
    var hoehe = node.layer.map.size.h;

    map.events.register('click', map, function (e) {
               var url =  node.layer.getFullRequestString({
                                REQUEST: "GetFeatureInfo",
                                SERVICE: 'WMS',
                                VERSION: '1.0.0',
                                 LAYERS: [qlayer],
                                TYPENAME: [qlayer],                
                                EXCEPTIONS: "application/vnd.ogc.se_xml",
                                BBOX:  bbox,
                                X: e.xy.x,
                                Y: e.xy.y,
                                BUFFER: 50, 
                                INFO_FORMAT: 'text/plain', 
                                 QUERY_LAYERS: [qlayer],
                                WIDTH: breite,
                                HEIGHT: hoehe});
            OpenLayers.loadURL(url, '', this, setHTML);
            OpenLayers.Event.stop(e);
      });
    function setHTML(response) {
    //doesn`t work:
    //map.addPopup(new GeoExt.Popup({html: response.responseText, map: map})); 
    alert(response.responseText);
     OpenLayers.Util.getElement('south').innerHTML = ""; 
    };
};

It seems that qlayers and/or QUERY_LAYERS were not deleted (is an array) after 
one request. Removing brakets [] did not help.
Any hints or tips about that?
Thanks for any comment.

Best regards
Sarah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110330/beef25e0/attachment.html


More information about the Users mailing list