[Users] Help with QueryPanel Example

Eoin Mac Aoidh eoinyp at yahoo.com
Fri Aug 20 09:31:38 CEST 2010


Dear all,
I am trying to breakdown and understand the QueryPanel example, which allows you to add WFS layers matching given criteria to a map. Original example hosted at: http://gxp.opengeo.org/trunk/core/examples/query.html

I am having trouble with two things:
1: returning a filtered XML containing only the objects meeting the query criteria (the xml file returned contains All objects)
2: adding the new layer to the map.

My attempt is online at: 
https://fishpoptrace.jrc.ec.europa.eu/newmap/query.html

An example query would be "CODE = FI" (to highlight Finland)
Firebug shows the xml returned, which does
 not filter out the other countries (it returns all countries)
Placing breakpoints in the javascript, it appears to stall during the code for the listener to the query button, which should add the layer to the map,
 (code snippet for listener below).

I would be really grateful if any of you could help point me in the right direction so that I could add the filtered layer to the map.
Many thanks,
Eoin

listeners: {
            storeload: function(panel, store) {
                vector.destroyFeatures();
                var features = [];
                store.each(function(record) {
                    features.push(record.get("feature"));
               
 });
                vector.addFeatures(features);
            }
        }

The code appears to stall at the lines:
  
store.each(function(record) {

                    features.push(record.get("feature"));

                });
  


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100820/7abd4148/attachment.htm 


More information about the Users mailing list