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

paweluz paweluz at o2.pl
Tue Apr 13 02:36:11 EDT 2010


Hi!

I have been reading for a while that using JSON format is better in some
cases that using just GML (XML). I have been trying to use it, but in
firebug all the time I can see just XML not the json file... My code looks
like this:

	var  wfsproba = new OpenLayers.Layer.Vector("Editable Features", {
        strategies: [new OpenLayers.Strategy.BBOX(),saveStrategy],
        projection: new OpenLayers.Projection("EPSG:4326"),
	styleMap: wfs_style, 
        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",
	    formatOptions: {outputFormat: 'json'}, 
	    readFormat: new OpenLayers.Format.GeoJSON() ,
            schema:
"http://localhost/geoserver2_0_1/wfs/DescribeFeatureType?version=1.1.0&typename=topp:bazadanych",
	    featurePrefix: "topp"
        })

Did I make some mistake. If I understand this right In firebug I should have
response in JSON not GML?? I used Openlayers 2.9-rc2.

Can anyone please help me in this.... 

Regards,
Poul  


-- 
View this message in context: http://n2.nabble.com/JSON-format-does-not-work-in-Protocol-WFS-tp4894449p4894449.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list