[OpenLayers-Dev] WMS layer displayed but not WFS layer

Toby ramotswa at gmail.com
Wed Mar 19 07:35:55 PDT 2014


Hi Pierre, 

Two things -

1. this should be on the geoserver users forum list, rather than the dev user list.
2. I suspect you are running against CORS restrictions - i.e. you are trying to pull in data to localhost:xx from localhost:8080 where XX isn’t 8080. Images are allowed through via CORS, however ‘scripts’ (xml / gml - what WFS is) isn’t. 
Have a look at that and post any other problems on the users list.

Cheers

Toby



On 19 Mar 2014, at 14:28, Pierre Marcel Anselme Lacroix <Pierre.Lacroix at unige.ch> wrote:

> Hi,
> I have installed Geoserver on my local computer. I cannot display a WFS layer while the WMS is displaying. What am I doing wrong?
> 
> The following WMS is shown on the map:
> WMS_Layer = new OpenLayers.Layer.WMS( "WMS Layer",
> "http://localhost:8080/geoserver/wms",
> {layers: 'topp:tasmania_roads', transparent: 'true'}, {opacity: .2});
> 
> The following WFS is not shown whereas it is the same layer as the WMS:
> WFS_Layer = new OpenLayers.Layer.Vector("WFS Layer", {
>     strategies: [new OpenLayers.Strategy.BBOX()],
>     protocol: new OpenLayers.Protocol.WFS({
>         url:"http://localhost:8080/geoserver/wfs",
>         featureType: "tasmania_roads",
>         featureNS: "http://www.openplans.org/topp"
>         })             
>     });
> 
> Thanks for your reply.
> 
> ---------
> With best regards - Avec mes meilleures salutations,
> Pierre Lacroix, PhD.
> Scientific Collaborator - University of Geneva - Pole in Environmental Sciences
> GIS Analyst - United Nations Environment Programme - UNEP/DEWA/GRID-Geneva
> http://www.unige.ch/envirospace
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20140319/bc5fff81/attachment.html>


More information about the Dev mailing list