On Oct 28, 2011, at 16:35 , Tito, Joseph wrote:

> Andreas,
> 
> Do you have any code samples that could help me do this?

Something like this (untested):

var vectors = new OpenLayers.Layer.Vector("GeoRSS", {
    strategies: [new OpenLayers.Strategy.Fixed()],
    protocol: new OpenLayers.Protocol.HTTP({
        url: "http://yoursite.com/path/to/your/GeoRSS";,
        format: new OpenLayers.Format.GeoRSS()
    }),
    eventListeners: {
        loadend: function() {
            if (vectors.features.length === 0) {
                alert("No features were loaded. Is your GeoRSS file valid?");
            }
        }
    }
});

Andreas.

> 
> Joe
> 
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Andreas Hocevar
> Sent: Thursday, October 27, 2011 5:46 AM
> To: Tito, Joseph
> Cc: [email protected]
> Subject: Re: [OpenLayers-Users] Reporting creation errors for Vector/GeoRSS 
> layers
> 
> We don't have error handling for this on the library level. But what you 
> could do is register for the layer's loadend event and check for 
> layer.features.length. You could notify the user when the number of features 
> is zero.
> 
> Andreas.
> 
> On Oct 26, 2011, at 18:20 , Tito, Joseph wrote:
> 
>> Is it possible to recover error messages in the following scenarios:
>> 
>> 1)      A vector layer is created from a KML file in which the KML file is 
>> corrupted.
>> 2)      A GeoRSS layer is created from a GeoRSS file in which the file is 
>> corrupted.
>> 
>> I'm trying to report errors to my users if they supply a file that is 
>> corrupted.
>> 
>> Joe Tito
>> 
>> _______________________________________________
>> Users mailing list
>> [email protected]
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> 
> -- 
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
> 
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to