[OpenLayers-Users] howto manage empty geojson streams

Didrik Pinte lists at dipole-consulting.com
Tue Mar 17 04:02:03 EDT 2009


On Mon, 2009-03-16 at 13:55 +0100, Eric Lemoine wrote:
> Consider using OpenLayers.Protocol.HTTP.
> 
> var protocol = new OpenLayers.Protocol.HTTP({
>     url: "url-to-your-service",
>     format: new OpenLayers.Format.GeoJSON()
> });
> protocol.read({
>     callback: function(response) {
>         var features = response.features;
>         // features will be null if the GeoJSON stream is empty
>     }
> });
> 
> Hope that helps,

Hi Eric,

Sure it helps and it works fine !

Thanks.

Didrik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090317/6deab598/attachment.bin


More information about the Users mailing list