0

I would like to make use of a public geoRSS feed with content from 10years (200+ items), however since it is too much information, i would like to show only a subset of this content in my map.

I have been unable to find any reference of how to filter/query the content of an esri georsslayer with the JS API

1 Answer 1

0

I failed to find a documented solution for this problem. However i did solve it by looping through once the layer is loaded and hiding all the items which did not meet my criteria, as below:

    dojo.forEach(tmpLayer.items,function(s) //tmpLayer is georsslayer name
    {
        var pointDate = new Date(s.attributes['pubDate']); //the graphic attribute to filter
        if (pointDate > LastMonth) //if successful symbolise the graphic
        {
            //here i am using another function to set icon based on attribute value;
            s.setSymbol(getCategoryIcon(s.attributes['category']));
            s.setInfoTemplate(geoRSSTemplate);
        }
        else //else hide it
        {
            s.hide();
        }
    });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.