[OpenLayers-Users] WFS using OpenLayers.Layer.Vector() fails to render

gingerbbm stuart.jones at jacobs.com
Thu May 13 11:16:47 EDT 2010


Dear all

I am trying to render a vector layer from Geoserver using the WFS protocol
onto my British National Grid (EPSG:27700) map as follows:

    var wfslayer = new OpenLayers.Layer.Vector("WFS", {
        strategies: [new OpenLayers.Strategy.BBOX()],
        protocol: new OpenLayers.Protocol.WFS({
            url: "http://d2.elgin.gov.uk/geoserver.2/wfs",
            featureType: "NSG_STREET_PUBLIC",
            featureNS: "http://www.elgin.gov.uk/",
            featurePrefix: "e",
            geometryName: "GEOM"
        })
    });
    map.addLayer(wfslayer);

But it's not rendering. In Firebug, I see that the XML response looks good.
In fact, if I save the XML and add it to the map as a GML layer as follows,
it renders perfectly:

    var gmllayer = new OpenLayers.Layer.GML("GML", "nsg_street_public.xml")
    map.addLayer(gmllayer);

Does anyone have any ideas what I'm missing here?

Thanks, in advance,
Stuart
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/WFS-using-OpenLayers-Layer-Vector-fails-to-render-tp5046572p5046572.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list