[OpenLayers-Users] WFS

strk strk at keybit.net
Thu Nov 12 05:20:08 EST 2009


On Wed, Nov 11, 2009 at 12:19:41PM -0800, pericoltoxic wrote:

> I changed  this code:
> 
>                 var layer = new OpenLayers.Layer.Vector("WFS", {
>                     strategies: [new OpenLayers.Strategy.BBOX()],
>                     protocol: new OpenLayers.Protocol.WFS({
>                         url:  "http://demo.opengeo.org/geoserver/wfs",
>                         featureType: "tasmania_roads",
>                         featureNS: "http://www.openplans.org/topp"
>                     })
>                 });
> 
> with my code:
> 
>  var layer = new OpenLayers.Layer.Vector("WFS", {
>                     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"
>                     })
>                 });
> 
> I read  tasmania_roads  from my GeoServer( localhost:8080 ), but the
> tasmania_roads not appear. Where is the mistake?

Is the OpenLayers code served by http://localhost:8080 too ?
If this is the case you may need to tweak 'featureNS' to match
the namespace found in the WFS returned by geoserver.
At least I had to change it to "http://mapserver.gis.umn.edu/mapserver"
for that to work with mapserver.

--strk; 

 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
 http://foo.keybit.net/~strk/services.html  /\  Keep it simple! 



More information about the Users mailing list