[OpenLayers-Users] JSON format does not work in Protocol.WFS

Bart van den Eijnden bartvde at osgis.nl
Wed Apr 14 02:36:12 EDT 2010


This is what I normally use see also http://trac.openlayers.org/ticket/2107:

var protocol = new OpenLayers.Protocol.WFS({ 
    url: "http://some.url.org", 
    featureNS: "http://namespace.org", 
    featureType: "type", 
    formatOptions: {outputFormat: 'json'}, 
    readFormat: new OpenLayers.Format.GeoJSON() 
}); 

Best regards,
Bart

On Apr 14, 2010, at 8:32 AM, paweluz wrote:

> 
> Hi Andreas
> 
> Unfortunately it still does not work. My code for protocol looks now like
> this:
> 
>        protocol: new OpenLayers.Protocol.WFS({
>            version: "1.1.0",
>            srsName: "EPSG:4326",
>            url: "http://localhost/geoserver2_0_1/wfs",
>            featureNS :  "http://www.openplans.org/topp",
>            featureType: "bazadanych",
>            geometryName: "the_geom",
> 	    outputFormat: "json",
>            readFormat: new OpenLayers.Format.GeoJSON() ,
>            schema:
> "http://localhost/geoserver2_0_1/wfs/DescribeFeatureType?version=1.1.0&typename=topp:bazadanych",
> 	    featurePrefix: "topp"
>        })
>    }); 
> 
> I changed line you suggested but still in firebug I can see only GML file as
> RESPONSE. Are you sure that this is the way I should define the
> outputFormat. In here http://trac.openlayers.org/ticket/2107#comment:11 I
> found that my old version was correct. Or maybe in 2.9 version of OL your
> version is correct.... What else should I try?? 
> 
> Regards,
> Poul 
> -- 
> View this message in context: http://n2.nabble.com/JSON-format-does-not-work-in-Protocol-WFS-tp4894449p4900100.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100414/7f2223a5/attachment.html


More information about the Users mailing list