problem: openlayer read GML3 from Geoserver

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

problem: openlayer read GML3 from Geoserver

zhanglang86
This post has NOT been accepted by the mailing list yet.
Dear All,

I use 52n for WPS, the interface is opanlayer. the get vector data is :var wfs = new OpenLayers.Layer.Vector("WFS", {
                strategies: [new OpenLayers.Strategy.BBOX()]
                protocol: new OpenLayers.Protocol.WFS({
//    url: "http://geoprocessing.demo.52north.org:8080/geoserver/wfs",
                url: "http://localhost:8081/geoserver/wfs",
                featureType: "tasmania_roads",
                featureNS: "http://www.openplans.org/topp",
                version: "1.1.0",
                formatOptions: {outputFormat: 'GML3'},
                outputFormat: "GML3",
                readFormat: new OpenLayers.Format.GML.v3(gmlOptionsIn) // GML3 parser with options
        }),
                        })
var gmlOptionsIn = OpenLayers.Util.extend(
                OpenLayers.Util.extend({}, gmlOptions),
                in_options
                );
var in_options = {
                'internalProjection': new OpenLayers.Projection("EPSG:4326"),
                'externalProjection': new OpenLayers.Projection("EPSG:4326")
                                                };
 var gmlOptions = {
                featureType: "tasmania_roads",
                featureNS: "http://www.openplans.org/topp"
                                                };

the Geoserver version 2.1.4. When I read wfs as GML3, it is failed, in firebug when I click XML tag, it shows the XML content, however, it can not show in Openlays as Vector layer, When I use the url:http://geoprocessing.demo.52north.org:8080/geoserver/wfs, it shows finely.  would you give me any suggestion how to do it in localhost.